migrate: switch to callbacks instead of events
This commit is contained in:
1 parent
c7e2963390
commit
b291aeebf8
67 files changed
+332
-357
No files matched your search
@@ -39,7 +39,7 @@
|
||||
<div class="flex items-center gap-2">
|
||||
<Button
|
||||
rounding="xl"
|
||||
on:click={() => goto($page.url, { invalidateAll: true })}
|
||||
onclick={() => goto($page.url, { invalidateAll: true })}
|
||||
>
|
||||
{$t('message.retry')}
|
||||
</Button>
|
||||
|
||||
+23
-20
@@ -77,28 +77,31 @@
|
||||
themeVars.subscribe((vars) => {
|
||||
document.body.setAttribute('style', vars)
|
||||
})
|
||||
// $effect(() => {
|
||||
// if (settings) {
|
||||
// document.body.classList.remove(
|
||||
// 'font-display',
|
||||
// 'font-inter',
|
||||
// 'font-sans',
|
||||
// 'font-system',
|
||||
// 'font-nunito',
|
||||
// )
|
||||
// document.body.classList.add(
|
||||
// settings.font == 'inter'
|
||||
// ? 'font-inter'
|
||||
// : settings.font == 'system'
|
||||
// ? 'font-system'
|
||||
// : settings.font == 'satoshi/nunito'
|
||||
// ? 'font-nunito'
|
||||
// : 'font-sans',
|
||||
// )
|
||||
// }
|
||||
// })
|
||||
}
|
||||
})
|
||||
|
||||
if (browser) {
|
||||
$effect(() => {
|
||||
if (settings) {
|
||||
document.body.classList.remove(
|
||||
'font-display',
|
||||
'font-inter',
|
||||
'font-sans',
|
||||
'font-system',
|
||||
'font-nunito',
|
||||
)
|
||||
document.body.classList.add(
|
||||
settings.font == 'inter'
|
||||
? 'font-inter'
|
||||
: settings.font == 'system'
|
||||
? 'font-system'
|
||||
: settings.font == 'satoshi/nunito'
|
||||
? 'font-nunito'
|
||||
: 'font-sans',
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
||||
@@ -85,15 +85,11 @@
|
||||
</div>
|
||||
<p>This removes the account from Photon, it does not delete the account.</p>
|
||||
<div class="flex flex-row gap-2 items-center">
|
||||
<Button
|
||||
size="lg"
|
||||
class="flex-1"
|
||||
on:click={() => (removing.shown = false)}
|
||||
>
|
||||
<Button size="lg" class="flex-1" onclick={() => (removing.shown = false)}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
removing.shown = false
|
||||
if (removing.account) deleteProfile(removing.account.id)
|
||||
}}
|
||||
@@ -182,7 +178,7 @@
|
||||
title={profile.id == $currentProfile?.id
|
||||
? 'Switch'
|
||||
: 'Current'}
|
||||
on:click={async () => {
|
||||
onclick={async () => {
|
||||
if (profile.id != $currentProfile?.id) {
|
||||
switching = profile.id
|
||||
await setUserID(profile.id)
|
||||
@@ -248,7 +244,7 @@
|
||||
size="square-md"
|
||||
color="secondary"
|
||||
title={$t('account.moveUp')}
|
||||
on:click={() => moveProfile(profile.id, true)}
|
||||
onclick={() => moveProfile(profile.id, true)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ChevronUp} size="16" mini />
|
||||
@@ -258,7 +254,7 @@
|
||||
size="square-md"
|
||||
color="secondary"
|
||||
title={$t('account.moveDown')}
|
||||
on:click={() => moveProfile(profile.id, false)}
|
||||
onclick={() => moveProfile(profile.id, false)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ChevronDown} size="16" mini />
|
||||
@@ -267,7 +263,7 @@
|
||||
</div>
|
||||
<MenuButton
|
||||
disabled={!profile.color}
|
||||
on:click={() => (profile.color = undefined)}
|
||||
onclick={() => (profile.color = undefined)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ArrowUturnLeft} size="16" mini />
|
||||
@@ -276,7 +272,7 @@
|
||||
</MenuButton>
|
||||
{#if settings.debugInfo}
|
||||
<MenuButton
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
debugProfile = profile
|
||||
debugging = !debugging
|
||||
}}
|
||||
@@ -289,7 +285,7 @@
|
||||
{/if}
|
||||
{#if !LINKED_INSTANCE_URL || profile.user}
|
||||
<MenuButton
|
||||
on:click={() => action(profile)}
|
||||
onclick={() => action(profile)}
|
||||
color="danger-subtle"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
size="custom"
|
||||
color="none"
|
||||
class="w-max hover:underline text-slate-600 dark:text-zinc-400"
|
||||
on:click={() => history?.back()}
|
||||
onclick={() => history?.back()}
|
||||
>
|
||||
<Icon src={ArrowLeft} size="16" micro />
|
||||
{$t('account.accounts')}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
size="custom"
|
||||
color="none"
|
||||
class="w-max hover:underline text-slate-600 dark:text-zinc-400"
|
||||
on:click={() => history?.back()}
|
||||
onclick={() => history?.back()}
|
||||
>
|
||||
<Icon src={ArrowLeft} size="16" micro />
|
||||
{$t('account.accounts')}
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
? '!text-red-500'
|
||||
: ''}"
|
||||
aria-label={$t('routes.admin.applications.deny')}
|
||||
on:click={() => review(false)}
|
||||
onclick={() => review(false)}
|
||||
loading={denying || reviewing}
|
||||
disabled={approving || denying || reviewing}
|
||||
>
|
||||
@@ -154,7 +154,7 @@
|
||||
? '!text-green-500'
|
||||
: ''}"
|
||||
title={$t('routes.admin.applications.approve')}
|
||||
on:click={() => review(true)}
|
||||
onclick={() => review(true)}
|
||||
loading={approving}
|
||||
disabled={approving || denying || reviewing}
|
||||
>
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
|
||||
<Header pageHeader class="font-bold text-2xl flex items-center justify-between">
|
||||
{$t('routes.admin.federation.title')}
|
||||
<Button color="primary" on:click={save} loading={saving} disabled={saving}>
|
||||
<Button color="primary" onclick={save} loading={saving} disabled={saving}>
|
||||
{$t('common.save')}
|
||||
</Button>
|
||||
</Header>
|
||||
@@ -239,7 +239,7 @@
|
||||
</div>
|
||||
<Button
|
||||
size="square-md"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
if (!data.federated_instances?.federated_instances?.blocked)
|
||||
return
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
</div>
|
||||
<Button
|
||||
size="square-md"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
if (!data.federated_instances?.federated_instances?.allowed)
|
||||
return
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<Header pageHeader class="justify-between">
|
||||
{$t('routes.admin.taglines.title')}<Button
|
||||
color="primary"
|
||||
on:click={save}
|
||||
onclick={save}
|
||||
loading={saving}
|
||||
disabled={saving}
|
||||
size="lg"
|
||||
@@ -78,7 +78,7 @@
|
||||
<Markdown source={tagline} inline />
|
||||
|
||||
<div class="flex gap-2 ml-auto">
|
||||
<Button on:click={() => action(tagline)} size="square-md">
|
||||
<Button onclick={() => action(tagline)} size="square-md">
|
||||
<Icon src={Trash} mini size="16" />
|
||||
</Button>
|
||||
</div>
|
||||
@@ -137,7 +137,7 @@
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
<Button on:click={save} color="primary" size="lg" class="w-full">
|
||||
<Button onclick={save} color="primary" size="lg" class="w-full">
|
||||
{$t('common.save')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
{#each data.site?.admins ?? [] as admin}
|
||||
<div class="py-3 flex items-center justify-between">
|
||||
<UserLink avatar showInstance={false} user={admin.person} />
|
||||
<Button on:click={() => action(admin.person.id)} size="square-md">
|
||||
<Button onclick={() => action(admin.person.id)} size="square-md">
|
||||
<Icon src={Trash} mini size="16" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<Button size="square-md" on:click={() => action(moderator.moderator)}>
|
||||
<Button size="square-md" onclick={() => action(moderator.moderator)}>
|
||||
<Icon src={Trash} mini size="16" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -136,7 +136,7 @@ items-center px-2 w-max"
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<Button
|
||||
on:click={() => goto($page.url, { invalidateAll: true })}
|
||||
onclick={() => goto($page.url, { invalidateAll: true })}
|
||||
size="square-lg"
|
||||
rounding="xl"
|
||||
title={$t('common.refresh')}
|
||||
@@ -146,7 +146,7 @@ items-center px-2 w-max"
|
||||
{/snippet}
|
||||
</Button>
|
||||
<Button
|
||||
on:click={markAllAsRead}
|
||||
onclick={markAllAsRead}
|
||||
loading={markingAsRead}
|
||||
disabled={markingAsRead}
|
||||
size="lg"
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
color={item.read ? 'secondary' : 'primary'}
|
||||
{loading}
|
||||
disabled={loading}
|
||||
on:click={(e) => {
|
||||
onclick={(e) => {
|
||||
e.stopPropagation()
|
||||
markAsRead(!item.read)
|
||||
}}
|
||||
@@ -166,7 +166,7 @@
|
||||
color={item.read ? 'secondary' : 'primary'}
|
||||
{loading}
|
||||
disabled={loading}
|
||||
on:click={(e) => {
|
||||
onclick={(e) => {
|
||||
e.stopPropagation()
|
||||
markAsRead(!item.read)
|
||||
}}
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
import { EllipsisVertical, Flag, Icon, Trash } from 'svelte-hero-icons'
|
||||
|
||||
interface Props {
|
||||
message: PrivateMessageView;
|
||||
primary?: boolean;
|
||||
message: PrivateMessageView
|
||||
primary?: boolean
|
||||
}
|
||||
|
||||
let { message, primary = false }: Props = $props();
|
||||
let { message, primary = false }: Props = $props()
|
||||
|
||||
const dispatch = createEventDispatcher<{ delete: boolean; report: boolean }>()
|
||||
</script>
|
||||
@@ -33,36 +33,35 @@
|
||||
</div>
|
||||
<Menu>
|
||||
{#snippet target()}
|
||||
<Button
|
||||
<Button
|
||||
color="tertiary"
|
||||
class="opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-all flex-shrink-0"
|
||||
size="square-md"
|
||||
rounding="pill"
|
||||
|
||||
title={$t('post.actions.more.actions')}
|
||||
>
|
||||
<Icon src={EllipsisVertical} size="16" micro />
|
||||
</Button>
|
||||
{/snippet}
|
||||
{/snippet}
|
||||
<MenuDivider>{$t('post.actions.more.actions')}</MenuDivider>
|
||||
{#if primary}
|
||||
<MenuButton
|
||||
color="danger-subtle"
|
||||
on:click={() => dispatch('delete', true)}
|
||||
onclick={() => dispatch('delete', true)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={Trash} size="16" micro />
|
||||
{/snippet}
|
||||
<Icon src={Trash} size="16" micro />
|
||||
{/snippet}
|
||||
{$t('post.actions.more.delete')}
|
||||
</MenuButton>
|
||||
{:else}
|
||||
<MenuButton
|
||||
color="danger-subtle"
|
||||
on:click={() => dispatch('report', true)}
|
||||
onclick={() => dispatch('report', true)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={Flag} size="16" micro />
|
||||
{/snippet}
|
||||
<Icon src={Flag} size="16" micro />
|
||||
{/snippet}
|
||||
{$t('moderation.report')}
|
||||
</MenuButton>
|
||||
{/if}
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
<Button
|
||||
on:click={resolve}
|
||||
onclick={resolve}
|
||||
class="ml-auto {item.resolved
|
||||
? '!text-green-600 dark:!text-green-400'
|
||||
: ''}"
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
/>
|
||||
{/if}
|
||||
<Button
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
searchParam(
|
||||
$page.url,
|
||||
'',
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
{#if $profile?.jwt}
|
||||
<Button
|
||||
class="ml-auto"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
if ($profile?.jwt) {
|
||||
fetchOnHome($profile?.jwt)
|
||||
}
|
||||
@@ -272,7 +272,7 @@
|
||||
title={data.post.post_view.post.name}
|
||||
style="width: max-content;"
|
||||
/>
|
||||
<Button on:click={() => history.back()} size="square-md">
|
||||
<Button onclick={() => history.back()} size="square-md">
|
||||
{#snippet prefix()}
|
||||
<Icon src={ArrowLeft} micro size="16" />
|
||||
{/snippet}
|
||||
@@ -350,7 +350,7 @@
|
||||
? `/comment/${$page.params.instance}/${data.thread.showContext}`
|
||||
: undefined}
|
||||
class="hover:bg-white/50 dark:hover:bg-zinc-800/30"
|
||||
on:click={data.thread.singleThread ? reloadComments : undefined}
|
||||
onclick={data.thread.singleThread ? reloadComments : undefined}
|
||||
>
|
||||
{data.thread.showContext
|
||||
? $t('routes.post.thread.context')
|
||||
@@ -381,7 +381,7 @@
|
||||
{#if $profile?.jwt}
|
||||
{#if !commenting}
|
||||
<EndPlaceholder class="">
|
||||
<Button color="primary" on:click={() => (commenting = true)}>
|
||||
<Button color="primary" onclick={() => (commenting = true)}>
|
||||
<Icon src={PlusCircle} size="16" micro />
|
||||
{$t('routes.post.addComment')}
|
||||
</Button>
|
||||
@@ -401,7 +401,7 @@
|
||||
{$t('filter.sort.controversial')}
|
||||
</option>
|
||||
</Select>
|
||||
<Button size="square-md" on:click={reloadComments}>
|
||||
<Button size="square-md" onclick={reloadComments}>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ArrowPath} size="16" mini />
|
||||
{/snippet}
|
||||
@@ -447,7 +447,7 @@
|
||||
{$t('filter.sort.controversial')}
|
||||
</option>
|
||||
</Select>
|
||||
<Button size="square-md" on:click={reloadComments}>
|
||||
<Button size="square-md" onclick={reloadComments}>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ArrowPath} size="16" mini />
|
||||
{/snippet}
|
||||
@@ -485,7 +485,7 @@
|
||||
{#snippet action()}
|
||||
<Button
|
||||
color="tertiary"
|
||||
on:click={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
|
||||
onclick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ChevronDoubleUp} mini size="16" />
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
title="Unblock"
|
||||
size="square-md"
|
||||
rounding="pill"
|
||||
on:click={() => action(block)}
|
||||
onclick={() => action(block)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={XMark} mini size="16" />
|
||||
@@ -134,7 +134,7 @@
|
||||
title="Unblock"
|
||||
size="square-md"
|
||||
rounding="pill"
|
||||
on:click={() => action(block)}
|
||||
onclick={() => action(block)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={XMark} mini size="16" />
|
||||
@@ -162,7 +162,7 @@
|
||||
title="Unblock"
|
||||
size="square-md"
|
||||
rounding="pill"
|
||||
on:click={() => action(block)}
|
||||
onclick={() => action(block)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={XMark} mini size="16" />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { run, preventDefault } from 'svelte/legacy';
|
||||
import { run, preventDefault } from 'svelte/legacy'
|
||||
|
||||
import { goto } from '$app/navigation'
|
||||
import { page } from '$app/stores'
|
||||
@@ -10,15 +10,15 @@
|
||||
import { Button, Material, TextInput, toast } from 'mono-svelte'
|
||||
import { ClipboardDocument, Icon } from 'svelte-hero-icons'
|
||||
|
||||
let { data } = $props();
|
||||
let { data } = $props()
|
||||
|
||||
// @ts-ignore
|
||||
let totpLink: string | undefined = $state(undefined)
|
||||
let totpEnabled;
|
||||
let totpEnabled
|
||||
run(() => {
|
||||
totpEnabled =
|
||||
data.my_user?.local_user_view.local_user.totp_2fa_enabled ?? totpLink
|
||||
});
|
||||
})
|
||||
|
||||
let verify_totp = $state('')
|
||||
|
||||
@@ -65,18 +65,17 @@
|
||||
label={$t('form.profile.2fa.totp')}
|
||||
>
|
||||
{#snippet suffix()}
|
||||
<button
|
||||
|
||||
<button
|
||||
class="contents"
|
||||
onclick={() => {
|
||||
if (!totpLink) return
|
||||
navigator.clipboard?.writeText(totpLink)
|
||||
toast({ content: $t('toast.copied') })
|
||||
}}
|
||||
if (!totpLink) return
|
||||
navigator.clipboard?.writeText(totpLink)
|
||||
toast({ content: $t('toast.copied') })
|
||||
}}
|
||||
>
|
||||
<Icon src={ClipboardDocument} size="20" mini />
|
||||
</button>
|
||||
{/snippet}
|
||||
{/snippet}
|
||||
<span class="font-normal text-xs">
|
||||
{$t('form.profile.2fa.paste')}
|
||||
</span>
|
||||
@@ -92,17 +91,17 @@
|
||||
label={$t('form.2fa')}
|
||||
/>
|
||||
{#if totpEnabled}
|
||||
<Button on:click={() => twofa(false, true)} size="lg" color="primary">
|
||||
<Button onclick={() => twofa(false, true)} size="lg" color="primary">
|
||||
{$t('common.disable')}
|
||||
</Button>
|
||||
{:else}
|
||||
<Button on:click={() => twofa(true, true)} size="lg" color="primary">
|
||||
<Button onclick={() => twofa(true, true)} size="lg" color="primary">
|
||||
{$t('common.enable')}
|
||||
</Button>
|
||||
{/if}
|
||||
</form>
|
||||
{:else}
|
||||
<Button on:click={() => twofa(true)} size="lg" color="primary">
|
||||
<Button onclick={() => twofa(true)} size="lg" color="primary">
|
||||
{$t('form.setup')}
|
||||
</Button>
|
||||
{/if}
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
</span>
|
||||
{/snippet}
|
||||
</Switch>
|
||||
<Button size="lg" color="danger" on:click={() => deleteAccount(3)}>
|
||||
<Button size="lg" color="danger" onclick={() => deleteAccount(3)}>
|
||||
{$t('routes.profile.delete.title')}
|
||||
</Button>
|
||||
</Material>
|
||||
@@ -64,7 +64,7 @@
|
||||
</Button>
|
||||
<Button
|
||||
title={$t('post.actions.more.delete')}
|
||||
on:click={() => deleteImage(image)}
|
||||
onclick={() => deleteImage(image)}
|
||||
size="square-md"
|
||||
{loading}
|
||||
disabled={loading}
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
size="square-lg"
|
||||
color="tertiary"
|
||||
class="self-end justify-self-center"
|
||||
on:click={() => (moreOptions = !moreOptions)}
|
||||
onclick={() => (moreOptions = !moreOptions)}
|
||||
>
|
||||
<Icon src={ChevronDown} size="20" mini />
|
||||
</Button>
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<div class="flex items-center">
|
||||
<Button
|
||||
size="square-lg"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
importText = ''
|
||||
importing = true
|
||||
}}
|
||||
@@ -128,7 +128,7 @@
|
||||
</Button>
|
||||
<Button
|
||||
size="square-lg"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
const json = JSON.stringify(settings)
|
||||
navigator?.clipboard?.writeText?.(json)
|
||||
toast({ content: $t('toast.copied') })
|
||||
@@ -143,7 +143,7 @@
|
||||
</Button>
|
||||
<Button
|
||||
size="square-lg"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
toast({
|
||||
content: $t('toast.resetSettings'),
|
||||
action: () => {},
|
||||
@@ -508,7 +508,7 @@
|
||||
disabled={settings.dock.pins
|
||||
?.map((p) => p.url)
|
||||
?.includes(pin.url)}
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
settings.dock.pins = [...(settings.dock.pins ?? []), pin]
|
||||
}}
|
||||
>
|
||||
@@ -705,7 +705,7 @@
|
||||
size="square-md"
|
||||
rounding="lg"
|
||||
class="ml-auto"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
settings.moderation.presets.splice(index, 1)
|
||||
settings.moderation.presets = settings.moderation.presets
|
||||
}}
|
||||
@@ -740,7 +740,7 @@
|
||||
<Button
|
||||
color="none"
|
||||
class="w-full"
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
settings.moderation.presets = [
|
||||
...settings.moderation.presets,
|
||||
{
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
{err}
|
||||
</Material>
|
||||
{/await}
|
||||
<Button on:click={() => getCaptcha()} size="square-md">
|
||||
<Button onclick={() => getCaptcha()} size="square-md">
|
||||
<Icon src={ArrowPath} size="16" mini />
|
||||
</Button>
|
||||
<TextInput required bind:value={verifyCaptcha} />
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -138,13 +138,13 @@
|
||||
Are you sure you want to do this? (The button will enable in 3 seconds.)
|
||||
</p>
|
||||
<div class="flex flex-row gap-2">
|
||||
<Button size="lg" on:click={() => (purgingUser = false)} class="flex-1">
|
||||
<Button size="lg" onclick={() => (purgingUser = false)} class="flex-1">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
size="lg"
|
||||
color="danger"
|
||||
on:click={purgeUser}
|
||||
onclick={purgeUser}
|
||||
disabled={!purgeEnabled}
|
||||
class="flex-1"
|
||||
>
|
||||
@@ -250,7 +250,7 @@
|
||||
{/snippet}
|
||||
<MenuButton
|
||||
color="danger-subtle"
|
||||
on:click={() =>
|
||||
onclick={() =>
|
||||
ban(
|
||||
data.person_view.person.banned,
|
||||
data.person_view.person,
|
||||
@@ -263,7 +263,7 @@
|
||||
</MenuButton>
|
||||
<MenuButton
|
||||
color="danger-subtle"
|
||||
on:click={() => (purgingUser = !purgingUser)}
|
||||
onclick={() => (purgingUser = !purgingUser)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon mini size="16" src={Fire} />
|
||||
@@ -282,7 +282,7 @@
|
||||
{/snippet}
|
||||
<MenuButton
|
||||
color="danger-subtle"
|
||||
on:click={() => blockUser(data.person_view.person.id)}
|
||||
onclick={() => blockUser(data.person_view.person.id)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon mini size="16" src={NoSymbol} />
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<p>
|
||||
{post}
|
||||
</p>
|
||||
<Button on:click={() => (post = placeholders.get('post'))} class="w-max">
|
||||
<Button onclick={() => (post = placeholders.get('post'))} class="w-max">
|
||||
Generate
|
||||
</Button>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<p>
|
||||
{comment}
|
||||
</p>
|
||||
<Button on:click={() => (comment = placeholders.get('comment'))} class="w-max">
|
||||
<Button onclick={() => (comment = placeholders.get('comment'))} class="w-max">
|
||||
Generate
|
||||
</Button>
|
||||
|
||||
@@ -33,6 +33,6 @@
|
||||
<p>
|
||||
{url}
|
||||
</p>
|
||||
<Button on:click={() => (url = placeholders.get('url'))} class="w-max">
|
||||
<Button onclick={() => (url = placeholders.get('url'))} class="w-max">
|
||||
Generate
|
||||
</Button>
|
||||
Reference in new issue
Block a user