cleanup: remove pins
This commit is contained in:
1 parent
acf92a7647
commit
b3b2397bfa
4 files changed
-67
No files matched your search
@@ -46,10 +46,6 @@
|
|||||||
let translating = $state(false)
|
let translating = $state(false)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if translating}
|
|
||||||
<Translation bind:open={translating} />
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="flex flex-row items-center gap-0.5 h-7 w-full"
|
class="flex flex-row items-center gap-0.5 h-7 w-full"
|
||||||
class:flex-row-reverse={settings.posts.reverseActions}
|
class:flex-row-reverse={settings.posts.reverseActions}
|
||||||
|
|||||||
@@ -36,28 +36,6 @@
|
|||||||
gap-1 h-fit max-h-screen {clazz}"
|
gap-1 h-fit max-h-screen {clazz}"
|
||||||
{style}
|
{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}
|
{#if $profile?.jwt}
|
||||||
<SidebarButton icon={UserCircle} href="/profile">
|
<SidebarButton icon={UserCircle} href="/profile">
|
||||||
{#snippet label()}
|
{#snippet label()}
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ interface Settings {
|
|||||||
dock: {
|
dock: {
|
||||||
noGap: boolean | null
|
noGap: boolean | null
|
||||||
top: boolean | null
|
top: boolean | null
|
||||||
pins: Link[]
|
|
||||||
paletteHotkey: string
|
paletteHotkey: string
|
||||||
}
|
}
|
||||||
posts: {
|
posts: {
|
||||||
@@ -167,7 +166,6 @@ export const defaultSettings: Settings = {
|
|||||||
dock: {
|
dock: {
|
||||||
noGap: toBool(env.PUBLIC_DOCK_PANEL) ?? null,
|
noGap: toBool(env.PUBLIC_DOCK_PANEL) ?? null,
|
||||||
top: toBool(env.PUBLIC_DOCK_TOP) ?? null,
|
top: toBool(env.PUBLIC_DOCK_TOP) ?? null,
|
||||||
pins: [],
|
|
||||||
paletteHotkey: '/',
|
paletteHotkey: '/',
|
||||||
},
|
},
|
||||||
posts: {
|
posts: {
|
||||||
|
|||||||
@@ -473,45 +473,6 @@
|
|||||||
bind:selected={settings.dock.noGap}
|
bind:selected={settings.dock.noGap}
|
||||||
/>
|
/>
|
||||||
</Setting>
|
</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>
|
||||||
|
|
||||||
<Section id="embeds" title={$t('settings.embeds.title')}>
|
<Section id="embeds" title={$t('settings.embeds.title')}>
|
||||||
|
|||||||
Reference in new issue
Block a user