design: improve tabs design
This commit is contained in:
9 files changed
+124
-172
No files matched your search
@@ -28,26 +28,21 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav
|
<nav class="flex flex-row items-center gap-8 p-1 justify-start">
|
||||||
class="flex flex-row items-center gap-1 p-1 rounded-full bg-white/60 dark:bg-zinc-900/60
|
|
||||||
backdrop-blur-lg border border-slate-200 dark:border-zinc-800 shadow-sm {clazz ??
|
|
||||||
''}
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{#each routes as route (route.href)}
|
{#each routes as route (route.href)}
|
||||||
|
{@const selected = isSelected(
|
||||||
|
page.url,
|
||||||
|
new SvelteURL(`${page.url.origin}${route.href}`),
|
||||||
|
)}
|
||||||
<a
|
<a
|
||||||
onclick={() => invalidateAll()}
|
onclick={() => invalidateAll()}
|
||||||
href={buildUrl(currentRoute, route.href)}
|
href={buildUrl(currentRoute, route.href)}
|
||||||
class="font-medium rounded-full px-4 py-1 hover:bg-slate-200/40 dark:hover:bg-zinc-700/40
|
class={[
|
||||||
transition-colors duration-100 relative z-0 shrink-0"
|
'rounded-full transition-colors duration-100 relative z-0 shrink-0',
|
||||||
|
selected ? 'font-medium' : 'text-slate-600 dark:text-zinc-400',
|
||||||
|
]}
|
||||||
>
|
>
|
||||||
{route.name}
|
{route.name}
|
||||||
{#if isSelected(page.url, new SvelteURL(`${page.url.origin}${route.href}`))}
|
|
||||||
<div
|
|
||||||
class="rounded-full bg-slate-200/60 dark:bg-zinc-700/60
|
|
||||||
absolute inset-0 w-full h-full -z-10"
|
|
||||||
></div>
|
|
||||||
{/if}
|
|
||||||
</a>
|
</a>
|
||||||
{/each}
|
{/each}
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
|
|||||||
@@ -22,39 +22,34 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="flex flex-col gap-4 h-full">
|
<div class="flex flex-col gap-4 h-full">
|
||||||
<div
|
<Tabs
|
||||||
class="sticky mx-auto z-50 max-w-full min-w-0 flex items-center gap-2
|
routes={[
|
||||||
top-6 lg:top-22"
|
{
|
||||||
>
|
href: '/admin/config',
|
||||||
<Tabs
|
name: $t('routes.admin.config.title'),
|
||||||
routes={[
|
},
|
||||||
{
|
{
|
||||||
href: '/admin/config',
|
href: '/admin/applications',
|
||||||
name: $t('routes.admin.config.title'),
|
name: $t('routes.admin.applications.title'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '/admin/applications',
|
href: '/admin/taglines',
|
||||||
name: $t('routes.admin.applications.title'),
|
name: $t('routes.admin.taglines.title'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '/admin/taglines',
|
href: '/admin/team',
|
||||||
name: $t('routes.admin.taglines.title'),
|
name: $t('routes.admin.team.title'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '/admin/team',
|
href: '/admin/federation',
|
||||||
name: $t('routes.admin.team.title'),
|
name: $t('routes.admin.federation.title'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '/admin/federation',
|
href: '/admin/media',
|
||||||
name: $t('routes.admin.federation.title'),
|
name: $t('routes.admin.media.title'),
|
||||||
},
|
},
|
||||||
{
|
]}
|
||||||
href: '/admin/media',
|
class="overflow-auto"
|
||||||
name: $t('routes.admin.media.title'),
|
/>
|
||||||
},
|
|
||||||
]}
|
|
||||||
class="overflow-auto"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</div>
|
</div>
|
||||||
@@ -20,21 +20,17 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-4 h-full">
|
<div class="flex flex-col gap-4 h-full">
|
||||||
<div
|
<Tabs
|
||||||
class="sticky mx-auto z-50 max-w-full min-w-0 flex items-center gap-2 top-6 lg:top-22"
|
routes={[
|
||||||
>
|
{
|
||||||
<Tabs
|
href: `${communityUrl}/settings`,
|
||||||
routes={[
|
name: $t('routes.community.settings.settings'),
|
||||||
{
|
},
|
||||||
href: `${communityUrl}/settings`,
|
{
|
||||||
name: $t('routes.community.settings.settings'),
|
href: `${communityUrl}/settings/team`,
|
||||||
},
|
name: $t('routes.community.settings.team'),
|
||||||
{
|
},
|
||||||
href: `${communityUrl}/settings/team`,
|
]}
|
||||||
name: $t('routes.community.settings.team'),
|
></Tabs>
|
||||||
},
|
|
||||||
]}
|
|
||||||
></Tabs>
|
|
||||||
</div>
|
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</div>
|
</div>
|
||||||
@@ -1,47 +1,29 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/state'
|
|
||||||
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { SvelteURLSearchParams } from 'svelte/reactivity'
|
|
||||||
|
|
||||||
let { children } = $props()
|
let { children } = $props()
|
||||||
|
|
||||||
function addSearchParam(
|
|
||||||
currentSearchParams: URLSearchParams,
|
|
||||||
newParamString: string,
|
|
||||||
) {
|
|
||||||
const updatedParams = new SvelteURLSearchParams(currentSearchParams)
|
|
||||||
const newParam = new SvelteURLSearchParams(newParamString)
|
|
||||||
const [key, value]: [string, string] = newParam.entries().next().value!
|
|
||||||
updatedParams.set(key, value)
|
|
||||||
return updatedParams
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<Tabs
|
||||||
class="mt-4 mb-2 z-30 mx-auto max-w-full flex gap-2 md:flex-row flex-col
|
routes={[
|
||||||
items-center px-2 w-max top-6 lg:top-22"
|
{
|
||||||
>
|
href: '/inbox',
|
||||||
<Tabs
|
name: $t('filter.location.all'),
|
||||||
routes={[
|
},
|
||||||
{
|
{
|
||||||
href: '/inbox',
|
href: '/inbox?type=replies',
|
||||||
name: $t('filter.location.all'),
|
name: $t('filter.inbox.replies'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '/inbox?type=replies',
|
href: '/inbox?type=mentions',
|
||||||
name: $t('filter.inbox.replies'),
|
name: $t('filter.inbox.mentions'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '/inbox?type=mentions',
|
href: '/inbox/messages',
|
||||||
name: $t('filter.inbox.mentions'),
|
name: $t('filter.inbox.messages'),
|
||||||
},
|
},
|
||||||
{
|
]}
|
||||||
href: '/inbox/messages',
|
class="overflow-auto"
|
||||||
name: $t('filter.inbox.messages'),
|
/>
|
||||||
},
|
|
||||||
]}
|
|
||||||
class="overflow-auto"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
</CommonList>
|
</CommonList>
|
||||||
|
|
||||||
{#if res.private_messages.length == 50 || data.page != 1}
|
{#if res.private_messages.length == 50 || data.page != 1}
|
||||||
<div class="mt-auto pb-4">
|
<div class="mt-auto pb-4 mx-auto">
|
||||||
<Pageination
|
<Pageination
|
||||||
page={data.page}
|
page={data.page}
|
||||||
hasMore={res.private_messages.length == 50}
|
hasMore={res.private_messages.length == 50}
|
||||||
|
|||||||
@@ -6,19 +6,14 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Header pageHeader>Instances</Header>
|
<Header pageHeader>Instances</Header>
|
||||||
<div
|
<Tabs
|
||||||
class="mt-4 mb-2 z-30 mx-auto max-w-full flex gap-2 md:flex-row flex-col
|
routes={[
|
||||||
items-center px-2 w-max top-6 lg:top-22"
|
{
|
||||||
>
|
href: '/instances/linked',
|
||||||
<Tabs
|
name: 'Linked',
|
||||||
routes={[
|
},
|
||||||
{
|
{ href: '/instances/blocked', name: 'Blocked' },
|
||||||
href: '/instances/linked',
|
]}
|
||||||
name: 'Linked',
|
></Tabs>
|
||||||
},
|
|
||||||
{ href: '/instances/blocked', name: 'Blocked' },
|
|
||||||
]}
|
|
||||||
></Tabs>
|
|
||||||
</div>
|
|
||||||
<div class="h-3 sm:h-6"></div>
|
<div class="h-3 sm:h-6"></div>
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
@@ -10,22 +10,18 @@
|
|||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="w-full space-y-4 pb-8">
|
<div class="w-full space-y-4 pb-8">
|
||||||
<div
|
<Tabs
|
||||||
class="sticky w-max mx-auto z-50 max-w-full min-w-0 flex items-center gap-2 top-6 lg:top-22"
|
class="overflow-auto"
|
||||||
>
|
routes={[
|
||||||
<Tabs
|
{
|
||||||
class="overflow-auto"
|
href: '/moderation',
|
||||||
routes={[
|
name: $t('routes.moderation.feed'),
|
||||||
{
|
},
|
||||||
href: '/moderation',
|
{
|
||||||
name: $t('routes.moderation.feed'),
|
href: '/moderation/communities',
|
||||||
},
|
name: $t('routes.communities.title'),
|
||||||
{
|
},
|
||||||
href: '/moderation/communities',
|
]}
|
||||||
name: $t('routes.communities.title'),
|
/>
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</div>
|
</div>
|
||||||
@@ -25,9 +25,7 @@
|
|||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="flex flex-col gap-4 h-full z-0">
|
<div class="flex flex-col gap-4 h-full z-0">
|
||||||
<div
|
<div class="flex flex-row justify-between">
|
||||||
class="sticky mx-auto z-50 max-w-full min-w-0 flex items-center gap-2 top-6 lg:top-22"
|
|
||||||
>
|
|
||||||
<Tabs
|
<Tabs
|
||||||
class="overflow-auto"
|
class="overflow-auto"
|
||||||
routes={[
|
routes={[
|
||||||
|
|||||||
@@ -9,39 +9,34 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<div
|
<Tabs
|
||||||
class="sticky mx-auto z-50 max-w-full min-w-0 flex items-center gap-2 top-6 lg:top-22"
|
routes={[
|
||||||
>
|
{
|
||||||
<Tabs
|
href: '/util',
|
||||||
routes={[
|
name: 'Home',
|
||||||
{
|
},
|
||||||
href: '/util',
|
{
|
||||||
name: 'Home',
|
href: '/util/instance',
|
||||||
},
|
name: 'Photon instance',
|
||||||
{
|
},
|
||||||
href: '/util/instance',
|
{
|
||||||
name: 'Photon instance',
|
href: '/util/photonify',
|
||||||
},
|
name: 'Photonify Links',
|
||||||
{
|
},
|
||||||
href: '/util/photonify',
|
{
|
||||||
name: 'Photonify Links',
|
href: '/util/placeholder',
|
||||||
},
|
name: 'Placeholders',
|
||||||
{
|
},
|
||||||
href: '/util/placeholder',
|
{
|
||||||
name: 'Placeholders',
|
href: '/util/constants',
|
||||||
},
|
name: 'Constants',
|
||||||
{
|
},
|
||||||
href: '/util/constants',
|
{
|
||||||
name: 'Constants',
|
href: '/functions',
|
||||||
},
|
name: 'Functions',
|
||||||
{
|
},
|
||||||
href: '/functions',
|
]}
|
||||||
name: 'Functions',
|
class="overflow-auto"
|
||||||
},
|
/>
|
||||||
]}
|
|
||||||
class="overflow-auto"
|
|
||||||
currentRoute={page.url.toString()}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</div>
|
</div>
|
||||||
Reference in new issue
Block a user