feat: add customizing keybinds
This commit is contained in:
9 files changed
+113
-63
No files matched your search
@@ -66,10 +66,13 @@
|
||||
User,
|
||||
VideoCamera,
|
||||
ViewColumns,
|
||||
ViewfinderCircle,
|
||||
} from 'svelte-hero-icons'
|
||||
import Section from './Section.svelte'
|
||||
import Setting from './Setting.svelte'
|
||||
import ToggleSetting from './ToggleSetting.svelte'
|
||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||
let importing = $state(false)
|
||||
let importText = $state('')
|
||||
|
||||
@@ -461,6 +464,29 @@
|
||||
description={$t('settings.app.titleTags.description')}
|
||||
bind:checked={settings.parseTags}
|
||||
/>
|
||||
<Setting icon={ViewfinderCircle} adaptive={false}>
|
||||
{#snippet title()}
|
||||
{$t('settings.app.keybinds.title')}
|
||||
{/snippet}
|
||||
{#snippet description()}
|
||||
{$t('settings.app.keybinds.description')}
|
||||
{/snippet}
|
||||
<div class="flex flex-col my-2">
|
||||
<Expandable>
|
||||
{#snippet title()}
|
||||
{$t('content.posts')}
|
||||
{/snippet}
|
||||
<CommonList depth={2}>
|
||||
{#each Object.entries(settings.keybinds.post) as [key, value] (key)}
|
||||
<li class="flex items-center justify-between gap-2 secondary">
|
||||
<div class="capitalize font-medium">{key}</div>
|
||||
<TextInput bind:value={value.key} size="sm" class="w-24" />
|
||||
</li>
|
||||
{/each}
|
||||
</CommonList>
|
||||
</Expandable>
|
||||
</div>
|
||||
</Setting>
|
||||
</Section>
|
||||
|
||||
<Section id="embeds" title={$t('settings.embeds.title')}>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
description?: import('svelte').Snippet
|
||||
children?: import('svelte').Snippet
|
||||
icon?: IconSource
|
||||
adaptive?: boolean
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -37,6 +38,7 @@
|
||||
description,
|
||||
children,
|
||||
icon,
|
||||
adaptive = true,
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
@@ -74,7 +76,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<div class={['setting-grid items-center', clazz]}>
|
||||
<div class={['setting-grid items-center', adaptive && 'adaptive', clazz]}>
|
||||
{#if icon}
|
||||
<Icon
|
||||
src={icon}
|
||||
@@ -124,7 +126,7 @@
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.setting-grid {
|
||||
.setting-grid.adaptive {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
grid-template-rows: auto auto;
|
||||
|
||||
Reference in new issue
Block a user