mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
preliminary shortcut loading
This commit is contained in:
@@ -1,8 +1,29 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { settingsState } from "@/seqta/utils/listeners/SettingsState.ts"
|
||||||
|
|
||||||
|
|
||||||
function formatUrl(inputUrl: string) {
|
function formatUrl(inputUrl: string) {
|
||||||
const protocolRegex = /^(http:\/\/|https:\/\/|ftp:\/\/)/;
|
const protocolRegex = /^(http:\/\/|https:\/\/|ftp:\/\/)/;
|
||||||
return protocolRegex.test(inputUrl) ? inputUrl : `https://${inputUrl}`;
|
return protocolRegex.test(inputUrl) ? inputUrl : `https://${inputUrl}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{#snippet Shortcuts([string, Shortcut]) }
|
||||||
|
<div class="flex items-center justify-between px-4 py-3">
|
||||||
|
<div class="pr-4">
|
||||||
|
<h2 class="text-sm font-bold">{Shortcut.name}</h2>
|
||||||
|
<p class="text-xs">{Shortcut.enabled}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/snippet}
|
||||||
|
|
||||||
|
|
||||||
<div class="text-xl">shortcuts tab</div>
|
<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">
|
||||||
|
{#each Object.entries(settingsState.shortcuts) as shortcut}
|
||||||
|
{@render Shortcuts(shortcut)}
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
import type { SettingsState } from './AppProps';
|
import type { SettingsState } from './AppProps';
|
||||||
|
|
||||||
export interface SettingsList {
|
export interface SettingsList {
|
||||||
title: string;
|
title: string;
|
||||||
id: number;
|
id: number;
|
||||||
@@ -7,6 +6,8 @@ export interface SettingsList {
|
|||||||
Component: any; /* TODO: Give this a type */
|
Component: any; /* TODO: Give this a type */
|
||||||
props?: any;
|
props?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface SettingsProps {
|
export interface SettingsProps {
|
||||||
settingsState: SettingsState;
|
settingsState: SettingsState;
|
||||||
setSettingsState: React.Dispatch<React.SetStateAction<SettingsState>>;
|
setSettingsState: React.Dispatch<React.SetStateAction<SettingsState>>;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ interface ToggleItem {
|
|||||||
toggle: boolean;
|
toggle: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Shortcut {
|
export interface Shortcut {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user