migrate: switch to callbacks instead of events

This commit is contained in:
Xylight committed 2024-10-26 11:36:31 -07:00
1 parent c7e2963390
commit b291aeebf8
67 files changed
+332 -357

No files matched your search

+3 -3
View File
@@ -101,7 +101,7 @@
</Material>
<div class="flex items-center gap-4">
<Button
on:click={() => {
onclick={() => {
importing = !importing
}}
size="lg"
@@ -111,7 +111,7 @@
{$t('routes.theme.import')}
</Button>
<Button
on:click={() => {
onclick={() => {
navigator.clipboard.writeText(JSON.stringify($theme.colors))
toast({ content: 'Copied theme to clipboard.' })
}}
@@ -122,7 +122,7 @@
</Button>
<Button
disabled={$theme.id <= 0}
on:click={() => {
onclick={() => {
modal({
actions: [
action({
+8 -8
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { preventDefault } from 'svelte/legacy';
import { preventDefault } from 'svelte/legacy'
import { t } from '$lib/translations'
import { calculateVars, themeData, type Theme } from '$lib/ui/colors'
@@ -7,10 +7,10 @@
import { CheckCircle, Icon, Trash } from 'svelte-hero-icons'
interface Props {
theme: Theme;
theme: Theme
}
let { theme = $bindable() }: Props = $props();
let { theme = $bindable() }: Props = $props()
let editingName = $state(false)
</script>
@@ -33,10 +33,10 @@
</div>
<div
class="bg-white dark:bg-zinc-900 w-8 h-4 rounded-sm border border-slate-200 dark:border-zinc-800"
></div>
></div>
<div
class="w-3 h-3 bg-primary-900 dark:bg-primary-100 rounded-full ml-auto"
></div>
></div>
</div>
{#if theme.id == $themeData.currentTheme}
<Icon
@@ -66,7 +66,7 @@
color="ghost"
size="square-md"
class="flex-shrink-0"
on:click={() => {
onclick={() => {
modal({
actions: [
action({
@@ -97,8 +97,8 @@
}}
>
{#snippet prefix()}
<Icon src={Trash} size="16" mini />
{/snippet}
<Icon src={Trash} size="16" mini />
{/snippet}
</Button>
{/if}
</div>