cleanup: remove pins

This commit is contained in:
James Xylight committed 2025-02-02 17:44:59 -08:00
1 parent acf92a7647
commit b3b2397bfa
4 files changed
-67

No files matched your search

@@ -46,10 +46,6 @@
let translating = $state(false)
</script>
{#if translating}
<Translation bind:open={translating} />
{/if}
<div
class="flex flex-row items-center gap-0.5 h-7 w-full"
class:flex-row-reverse={settings.posts.reverseActions}
@@ -36,28 +36,6 @@
gap-1 h-fit max-h-screen {clazz}"
{style}
>
{#if settings.dock.pins?.length ?? 0 > 0}
<div class="flex items-center flex-wrap gap-2 pl-1.5">
{#each settings.dock.pins as pin}
<SidebarButton
icon={iconOfLink(pin.url)}
onclick={() => goto(pin.url)}
alignment="center"
selected={`${$page.url.pathname}${$page.url.search}` == pin.url}
oncontextmenu={(e) => {
e.preventDefault()
settings.dock.pins = settings.dock.pins.toSpliced(
settings.dock.pins.findLastIndex((p) => pin.url == p.url),
1,
)
return false
}}
size="square-md"
></SidebarButton>
{/each}
</div>
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
{/if}
{#if $profile?.jwt}
<SidebarButton icon={UserCircle} href="/profile">
{#snippet label()}
-2
View File
@@ -86,7 +86,6 @@ interface Settings {
dock: {
noGap: boolean | null
top: boolean | null
pins: Link[]
paletteHotkey: string
}
posts: {
@@ -167,7 +166,6 @@ export const defaultSettings: Settings = {
dock: {
noGap: toBool(env.PUBLIC_DOCK_PANEL) ?? null,
top: toBool(env.PUBLIC_DOCK_TOP) ?? null,
pins: [],
paletteHotkey: '/',
},
posts: {
-39
View File
@@ -473,45 +473,6 @@
bind:selected={settings.dock.noGap}
/>
</Setting>
<Setting
supportedPlatforms={{ desktop: true, tablet: true, mobile: false }}
>
{#snippet title()}
<span>{$t('settings.navigation.pins.title')}</span>
{/snippet}
{#snippet description()}
<span>
{$t('settings.navigation.pins.description')}
</span>
{/snippet}
<div class="flex items-center gap-1 flex-wrap">
{#each getDefaultLinks() as pin}
<Popover openOnHover placement="bottom">
{#snippet target()}
<Button
size="square-md"
disabled={settings.dock.pins
?.map((p) => p.url)
?.includes(pin.url)}
onclick={() => {
settings.dock.pins = [...(settings.dock.pins ?? []), pin]
}}
>
<Icon src={iconOfLink(pin.url)} mini size="16" />
</Button>
{/snippet}
{#snippet popover()}
<Material padding="none" class="px-4 py-2 flex flex-col">
<span class="font-medum text-base">{pin.label}</span>
<code class="bg-slate-50 dark:!bg-zinc-950 !rounded-md">
{pin.url}
</code>
</Material>
{/snippet}
</Popover>
{/each}
</div>
</Setting>
</Section>
<Section id="embeds" title={$t('settings.embeds.title')}>