-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
95 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<script lang="ts"> | ||
import { page } from '$app/state'; | ||
import type { HeaderItem } from '$lib/types'; | ||
import { Button, HStack, IconButton, Logo, syncToDom, theme, Theme } from '@immich/ui'; | ||
import { mdiWeatherNight, mdiWeatherSunny } from '@mdi/js'; | ||
type Props = { | ||
items: HeaderItem[]; | ||
}; | ||
const isActive = (path: string, options?: { prefix?: boolean }) => | ||
path === page.url.pathname || (options?.prefix && page.url.pathname.startsWith(path)); | ||
let { items }: Props = $props(); | ||
const handleToggleTheme = () => { | ||
theme.value = theme.value === Theme.Dark ? Theme.Light : Theme.Dark; | ||
}; | ||
const themeIcon = $derived(theme.value === Theme.Light ? mdiWeatherSunny : mdiWeatherNight); | ||
$effect(() => { | ||
syncToDom(); | ||
}); | ||
</script> | ||
|
||
<nav class="flex items-center justify-between gap-2 p-2"> | ||
<a href="/" class="flex gap-2 text-4xl"> | ||
<Logo variant="inline" /> | ||
</a> | ||
<HStack gap={0}> | ||
{#each items as item} | ||
<Button | ||
href={item.href} | ||
shape="round" | ||
variant={item.variant ?? 'ghost'} | ||
color={(item.color ?? isActive(item.href)) ? 'primary' : 'secondary'}>{item.title}</Button | ||
> | ||
{/each} | ||
<IconButton | ||
size="large" | ||
shape="round" | ||
color="primary" | ||
variant="ghost" | ||
icon={themeIcon} | ||
onclick={handleToggleTheme} | ||
/> | ||
</HStack> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script lang="ts"> | ||
import Footer from '$lib/components/Footer.svelte'; | ||
import type { Snippet } from 'svelte'; | ||
type Props = { | ||
children: Snippet; | ||
}; | ||
let { children }: Props = $props(); | ||
</script> | ||
|
||
<section class="flex flex-col h-full"> | ||
<div class="grow"> | ||
<div class="w-full h-full md:max-w-screen-lg px-4 py-10 sm:px-20 lg:p-10 m-auto"> | ||
{@render children?.()} | ||
</div> | ||
</div> | ||
<Footer /> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script lang="ts"> | ||
import '$lib/app.css'; | ||
import Header from '$lib/components/Header.svelte'; | ||
import PageContent from '$lib/components/PageContent.svelte'; | ||
import { AppShell, AppShellHeader } from '@immich/ui'; | ||
import type { Snippet } from 'svelte'; | ||
type Props = { | ||
children: Snippet; | ||
}; | ||
let { children }: Props = $props(); | ||
</script> | ||
|
||
<AppShell> | ||
<AppShellHeader> | ||
<Header items={[]} /> | ||
</AppShellHeader> | ||
|
||
<PageContent> | ||
{@render children?.()} | ||
</PageContent> | ||
</AppShell> |