mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
on the way to get shortcuts working
This commit is contained in:
@@ -1,25 +1,37 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { settingsState } from "@/seqta/utils/listeners/SettingsState.ts"
|
import { settingsState } from "@/seqta/utils/listeners/SettingsState.ts"
|
||||||
|
import Switch from "../../components/Switch.svelte"
|
||||||
|
console.log(settingsState.shortcuts)
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#snippet Shortcuts([string, Shortcut]) }
|
{#snippet Shortcuts({ name, enabled, Component, props }) }
|
||||||
<div class="flex items-center justify-between px-4 py-3">
|
<div class="flex items-center justify-between px-4 py-3">
|
||||||
<div class="pr-4">
|
<div class="pr-4">
|
||||||
<h2 class="text-sm font-bold">{Shortcut.name}</h2>
|
<h2 class="text-sm font-bold">{name}</h2>
|
||||||
<p class="text-xs">{Shortcut.enabled}</p>
|
<p class="text-xs">{enabled}</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Component {...props} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
|
|
||||||
<div class="text-xl">shortcuts tab</div>
|
|
||||||
|
|
||||||
<div class="flex flex-col -mt-4 overflow-y-scroll divide-y divide-zinc-100 dark:divide-zinc-700">
|
<div class="flex flex-col -mt-4 overflow-y-scroll divide-y divide-zinc-100 dark:divide-zinc-700">
|
||||||
{#each Object.entries(settingsState.shortcuts) as shortcut}
|
{#each settingsState.shortcuts as shortcut}
|
||||||
<!-- do processing stuff here -->
|
{@const shortcutFinal = {
|
||||||
{@render Shortcuts(shortcut)}
|
...shortcut,
|
||||||
|
name: shortcut.name,
|
||||||
|
enabled: shortcut.enabled,
|
||||||
|
Component: Switch,
|
||||||
|
props: {
|
||||||
|
// placeholder
|
||||||
|
// state: $settingsState.onoff,
|
||||||
|
// onChange: (isOn: boolean) => settingsState.onoff = isOn
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
{@render Shortcuts(shortcutFinal)}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user