feat: add custom pins

This commit is contained in:
Xylight committed 2024-06-24 11:22:14 -07:00
1 parent 8957b192b9
commit 0f363114ba
8 files changed
+184 -4

No files matched your search

+95
View File
@@ -0,0 +1,95 @@
import { t } from '$lib/translations'
import {
UserCircle,
type IconSource,
Home,
ChartBar,
Cog6Tooth,
Newspaper,
GlobeAmericas,
GlobeAlt,
MagnifyingGlass,
ShieldCheck,
ServerStack,
PencilSquare,
} from 'svelte-hero-icons'
import { get } from 'svelte/store'
export interface Link {
url: string
label?: string
}
export const defaultLinks: Link[] = [
{
url: '/profile',
label: get(t)('profile.profile'),
},
{
url: '/',
label: t.get('nav.home'),
},
{
url: '/?type=All',
label: t.get('filter.location.all'),
},
{
url: '/?type=Local',
label: t.get('filter.location.local'),
},
{
url: '/?type=Subscribed',
label: t.get('filter.location.subscribed'),
},
{
url: '/communities',
label: t.get('nav.communities'),
},
{
url: '/search',
label: t.get('nav.search'),
},
{
url: '/moderation',
label: t.get('moderation.label'),
},
{
url: '/admin',
label: t.get('admin.label'),
},
{
url: '/settings',
label: t.get('nav.menu.settings'),
},
{
url: '/create/post',
label: t.get('form.post.create'),
},
]
export const iconOfLink = (url: string): IconSource => {
switch (url) {
case '/profile':
return UserCircle
case '/':
return Home
case '/?type=All':
return ChartBar
case '/?type=Subscribed':
return Newspaper
case '/?type=Local':
return GlobeAmericas
case '/communities':
return GlobeAlt
case '/search':
return MagnifyingGlass
case '/moderation':
return ShieldCheck
case '/admin':
return ServerStack
case '/settings':
return Cog6Tooth
case '/create/post':
return PencilSquare
}
}