design: redesign credentials page
This commit is contained in:
1 file changed
+14
-51
@@ -1,19 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
|
||||||
import { client } from '$lib/lemmy.svelte'
|
|
||||||
import { t } from '$lib/i18n/translations'
|
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
Checkbox,
|
|
||||||
Material,
|
|
||||||
Modal,
|
|
||||||
removeToast,
|
|
||||||
Switch,
|
|
||||||
TextInput,
|
|
||||||
toast,
|
|
||||||
} from 'mono-svelte'
|
|
||||||
import { profile } from '$lib/auth.svelte'
|
import { profile } from '$lib/auth.svelte'
|
||||||
|
import { t } from '$lib/i18n/translations'
|
||||||
|
import { client } from '$lib/lemmy.svelte'
|
||||||
|
import { Button, removeToast, Switch, TextInput, toast } from 'mono-svelte'
|
||||||
|
|
||||||
let deletion = $state({
|
let deletion = $state({
|
||||||
modal: false,
|
modal: false,
|
||||||
@@ -70,9 +60,7 @@
|
|||||||
delete_content: deletion.deleteContent,
|
delete_content: deletion.deleteContent,
|
||||||
})
|
})
|
||||||
|
|
||||||
profile.meta.profiles.splice(
|
profile.remove(profile.current.id)
|
||||||
profile.meta.profiles.findIndex(p => profile.meta.profile == p.id),
|
|
||||||
)
|
|
||||||
|
|
||||||
profile.meta.profile = -1
|
profile.meta.profile = -1
|
||||||
toast({
|
toast({
|
||||||
@@ -90,43 +78,18 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if deletion.modal}
|
<form
|
||||||
<Modal
|
onsubmit={e => {
|
||||||
bind:open={deletion.modal}
|
e.preventDefault()
|
||||||
action="Submit"
|
deleteAccount(4)
|
||||||
onaction={() => deleteAccount(4)}
|
}}
|
||||||
>
|
class="w-full flex flex-col gap-4 max-w-xl"
|
||||||
{#snippet customTitle()}
|
>
|
||||||
<span>{$t('form.profile.deleteAccount.label')}</span>
|
|
||||||
{/snippet}
|
|
||||||
<TextInput
|
<TextInput
|
||||||
label={$t('form.password')}
|
label={$t('form.password')}
|
||||||
type="password"
|
type="password"
|
||||||
bind:value={deletion.password}
|
bind:value={deletion.password}
|
||||||
/>
|
/>
|
||||||
<Checkbox bind:checked={deletion.deleteContent}>
|
|
||||||
{$t('form.profile.deleteAccount.deleteContent')}
|
|
||||||
{#snippet description()}
|
|
||||||
<span>
|
|
||||||
{$t('form.profile.deleteAccount.warning')}
|
|
||||||
</span>
|
|
||||||
{/snippet}
|
|
||||||
</Checkbox>
|
|
||||||
</Modal>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<Material
|
|
||||||
color="distinct"
|
|
||||||
class="border-2 border-red-500! text-red-600 dark:text-red-400 flex flex-col gap-4"
|
|
||||||
padding="xl"
|
|
||||||
rounding="2xl"
|
|
||||||
>
|
|
||||||
<Header class="mx-auto w-max font-bold!">
|
|
||||||
{$t('routes.profile.delete.title')}
|
|
||||||
</Header>
|
|
||||||
<p class="text-base">
|
|
||||||
{$t('routes.profile.delete.warning')}
|
|
||||||
</p>
|
|
||||||
<Switch bind:checked={deletion.deleteContent}>
|
<Switch bind:checked={deletion.deleteContent}>
|
||||||
{$t('form.profile.deleteAccount.deleteContent')}
|
{$t('form.profile.deleteAccount.deleteContent')}
|
||||||
{#snippet description()}
|
{#snippet description()}
|
||||||
@@ -135,7 +98,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Switch>
|
</Switch>
|
||||||
<Button size="lg" color="danger" onclick={() => deleteAccount(3)}>
|
<Button submit color="danger" size="lg">
|
||||||
{$t('routes.profile.delete.title')}
|
{$t('form.submit')}
|
||||||
</Button>
|
</Button>
|
||||||
</Material>
|
</form>
|
||||||
Reference in new issue
Block a user