-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
7 changed files
with
59 additions
and
31 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 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 |
---|---|---|
@@ -1,29 +1,53 @@ | ||
<script lang="ts"> | ||
import { routes } from '$docs/routes.js'; | ||
import { Button, Icon } from '$lib/index.js'; | ||
import { mdiCompare } from '@mdi/js'; | ||
const { data } = $props(); | ||
const route = $derived(routes.find((route) => route.link === data.link)); | ||
let currentTheme = $state('both'); | ||
const currentThemes = $derived(currentTheme === 'both' ? ['light', 'dark'] : [currentTheme]); | ||
const themes = ['both', 'light', 'dark']; | ||
const handleClick = () => { | ||
const currentIndex = themes.indexOf(currentTheme); | ||
currentTheme = themes[(currentIndex + 1) % themes.length]; | ||
}; | ||
</script> | ||
|
||
<div class="flex min-h-screen flex-col gap-4 bg-gray-200 p-8"> | ||
<div class="flex min-h-screen flex-col overflow-y-auto"> | ||
<!-- TODO replace with breadcrumb component --> | ||
<div class="flex gap-1 rounded-lg bg-light p-2 text-dark"> | ||
<a href="/" class="flex gap-2 underline">Home</a> | ||
<span>></span> | ||
<!-- <span>Components</span> --> | ||
<!-- <span>></span> --> | ||
<span class="capitalize">{data.component}</span> | ||
</div> | ||
<nav class="flex items-center justify-between gap-2 border-b border-gray-300 px-8 py-2"> | ||
<a href="/" class="flex gap-2 text-4xl"> | ||
<h1 class="text-2xl">@immich/ui</h1> | ||
</a> | ||
<div> | ||
<button onclick={handleClick}> | ||
<Icon path={mdiCompare} size="24" class="cursor" /> | ||
</button> | ||
</div> | ||
</nav> | ||
|
||
<nav class="flex justify-between border-b border-gray-300 px-8 py-2"> | ||
<div class="flex items-center gap-2"> | ||
<a href="/" class="underline">Home</a> | ||
<span>/</span> | ||
<span class="capitalize">{data.component}</span> | ||
</div> | ||
</nav> | ||
|
||
<div class="flex gap-2"> | ||
{#if route} | ||
{#each ['light', 'dark'] as theme} | ||
<div class="flex w-1/2 flex-col {theme} gap-2"> | ||
{#if route} | ||
<div class="grid grow grid-cols-1 {currentThemes.length === 2 ? 'md:grid-cols-2' : ''}"> | ||
{#each currentThemes as theme} | ||
<div class="flex flex-col gap-4 {theme} h-full bg-light p-8"> | ||
<h2 class="text-2xl capitalize text-dark">{theme}</h2> | ||
<route.component></route.component> | ||
</div> | ||
{/each} | ||
{:else} | ||
</div> | ||
{:else} | ||
<div class="p-8"> | ||
<h2 class="text-xl">No examples found for {data.component}</h2> | ||
{/if} | ||
</div> | ||
</div> | ||
{/if} | ||
</div> |
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