misc: improve inbox tabs
This commit is contained in:
1 parent
5e45191565
commit
98767a41f5
4 files changed
+70
-45
No files matched your search
@@ -20,7 +20,7 @@
|
||||
"
|
||||
>
|
||||
<h1
|
||||
class="text-3xl font-medium flex items-center gap-2 w-full
|
||||
class="text-3xl font-medium flex gap-2 w-full
|
||||
{$userSettings.font == 'satoshi/nunito'
|
||||
? 'font-display'
|
||||
: ''} {$$props.class ?? ''}"
|
||||
|
||||
@@ -11,9 +11,15 @@
|
||||
export let isSelected: (
|
||||
url: URL,
|
||||
currentRoute: string | undefined,
|
||||
route: string
|
||||
route: string,
|
||||
defaultRoute?: string
|
||||
) => boolean = (url, currentRoute, route) =>
|
||||
(currentRoute ?? url.pathname) == route
|
||||
export let buildUrl: (
|
||||
currentRoute: string | undefined,
|
||||
href: string
|
||||
) => string = (route, href) => href
|
||||
export let defaultRoute: string | undefined
|
||||
</script>
|
||||
|
||||
<nav
|
||||
@@ -25,12 +31,12 @@
|
||||
{#each routes as route}
|
||||
<a
|
||||
on:click={() => invalidate(route.href)}
|
||||
href={route.href}
|
||||
href={buildUrl(currentRoute, route.href)}
|
||||
class="font-medium rounded-full px-4 py-1 hover:bg-slate-200/40 hover:dark:bg-zinc-700/40
|
||||
transition-colors duration-100 relative z-0 flex-shrink-0"
|
||||
>
|
||||
{route.name}
|
||||
{#if isSelected($page.url, currentRoute, route.href)}
|
||||
{#if isSelected($page.url, currentRoute, route.href, defaultRoute)}
|
||||
<div
|
||||
class="rounded-full bg-slate-100/60 dark:bg-zinc-700/60
|
||||
absolute inset-0 w-full h-full -z-10"
|
||||
|
||||
Reference in new issue
Block a user