design: improve settings reachability
This commit is contained in:
13 files changed
+188
-91
No files matched your search
@@ -944,7 +944,7 @@
|
||||
"title": "Account"
|
||||
},
|
||||
"donate": {
|
||||
"description": "Photon will always be free and open-source, and is continously developed and designed to be helpful. If you like Photon and want to finanically support its development, you can donate here."
|
||||
"description": "Photon will always be free and open-source, and is continously developed and designed to be helpful. If you like Photon and want to financially support its development, you can donate here."
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
'flex gap-2 p-5',
|
||||
orientation == 'horizontal'
|
||||
? 'flex-row items-center'
|
||||
: 'flex-col items-staRT',
|
||||
: 'flex-col items-start',
|
||||
]}
|
||||
>
|
||||
<Avatar url={icon} alt={title} width={detail ? 32 : 24} circle={false} />
|
||||
@@ -34,9 +34,11 @@
|
||||
<h3 class="font-medium text-base overflow-hidden text-ellipsis leading-5">
|
||||
{title}
|
||||
</h3>
|
||||
<p class="text-sm text-slate-600 dark:text-zinc-400">
|
||||
{detail}
|
||||
</p>
|
||||
{#if detail}
|
||||
<p class="text-sm text-slate-600 dark:text-zinc-400">
|
||||
{detail}
|
||||
</p>
|
||||
{/if}
|
||||
</a>
|
||||
<div class="flex flex-row gap-2 items-center">
|
||||
{@render children?.()}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state'
|
||||
import { type Snippet } from 'svelte'
|
||||
import { ChevronRight, Icon, type IconSource } from 'svelte-hero-icons/dist'
|
||||
import CommonList from '../CommonList.svelte'
|
||||
import Tabs from './Tabs.svelte'
|
||||
|
||||
interface Props {
|
||||
baseRoute: string
|
||||
routes: { icon?: IconSource; href: string; name: string; detail?: string }[]
|
||||
header?: Snippet
|
||||
children?: Snippet
|
||||
}
|
||||
|
||||
let { baseRoute, routes, header, children }: Props = $props()
|
||||
|
||||
let onBaseRoute = $derived(page.url.pathname == baseRoute)
|
||||
</script>
|
||||
|
||||
{#if !onBaseRoute}
|
||||
<Tabs {routes} />
|
||||
{/if}
|
||||
|
||||
{@render header?.()}
|
||||
{#if onBaseRoute}
|
||||
<CommonList animate={false} items={routes}>
|
||||
{#snippet item(route)}
|
||||
<a class="font-medium flex items-center gap-1" href={route.href}>
|
||||
{#if route.icon}
|
||||
<Icon
|
||||
src={route.icon}
|
||||
mini
|
||||
size="32"
|
||||
class="bg-gray-200/20 dark:bg-gray-600/20 p-1.5 rounded-lg color
|
||||
text-gray-500 dark:text-gray-300 float-left mr-2 clear-both"
|
||||
style="grid-area: icon;"
|
||||
/>
|
||||
{/if}
|
||||
<div class="flex-1">
|
||||
<div>
|
||||
{route.name}
|
||||
</div>
|
||||
{#if route.detail}
|
||||
<div>
|
||||
{route.detail}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<Icon src={ChevronRight} size="20" class />
|
||||
</a>
|
||||
{/snippet}
|
||||
</CommonList>
|
||||
{:else}
|
||||
{@render children?.()}
|
||||
{/if}
|
||||
Reference in new issue
Block a user