design: reorganize profile (#451)
* fix: re-add actions to community header * impr: reorganize the profile menu * misc: improve blocks page * fix: use a better icon for expands * misc: reorganize some settings
This commit is contained in:
1 parent
7c7df02e3d
commit
62e20fcb69
14 files changed
+257
-73
No files matched your search
@@ -23,7 +23,9 @@
|
|||||||
class="{open ? 'rotate-180' : ''} transition-transform"
|
class="{open ? 'rotate-180' : ''} transition-transform"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<slot name="content">
|
||||||
<div class="pt-2 text-slate-900 dark:text-zinc-100">
|
<div class="pt-2 text-slate-900 dark:text-zinc-100">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
</slot>
|
||||||
</Disclosure>
|
</Disclosure>
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
"
|
"
|
||||||
style="{pageHeader
|
style="{pageHeader
|
||||||
? `margin-top: min(-1.5rem, calc(-1 * calc(${$contentPadding.top}px))); padding-top: max(1.5rem, calc(${$contentPadding.top}px));`
|
? `margin-top: min(-6rem, calc(-1 * calc(${$contentPadding.top}px))); padding-top: max(6rem, calc(${$contentPadding.top}px));`
|
||||||
: ''};
|
: ''} {$$props.style};
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<h1
|
<h1
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
currentRoute: string | undefined,
|
currentRoute: string | undefined,
|
||||||
href: string
|
href: string
|
||||||
) => string = (route, href) => href
|
) => string = (route, href) => href
|
||||||
export let defaultRoute: string | undefined
|
export let defaultRoute: string | undefined = undefined
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
|
|||||||
+14
-3
@@ -201,8 +201,14 @@
|
|||||||
"profile": {
|
"profile": {
|
||||||
"user": "User",
|
"user": "User",
|
||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
"blocks": "Blocks",
|
"blocks": {
|
||||||
"credentials": "Account",
|
"title": "Blocked",
|
||||||
|
"empty": {
|
||||||
|
"title": "No blocked entities",
|
||||||
|
"description": "When you block anything, it will no longer appear in your feeds."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"credentials": "Credentials",
|
||||||
"moderates": "Moderating",
|
"moderates": "Moderating",
|
||||||
"favorites": "Favorites",
|
"favorites": "Favorites",
|
||||||
"upvoted": "Upvoted",
|
"upvoted": "Upvoted",
|
||||||
@@ -216,7 +222,9 @@
|
|||||||
"delete": {
|
"delete": {
|
||||||
"title": "Delete account",
|
"title": "Delete account",
|
||||||
"warning": "This is permanent. Are you sure you want to do this?"
|
"warning": "This is permanent. Are you sure you want to do this?"
|
||||||
}
|
},
|
||||||
|
"overview": "Overview",
|
||||||
|
"submissions": "Submissions"
|
||||||
},
|
},
|
||||||
"translators": "Translators",
|
"translators": "Translators",
|
||||||
"accounts": "Accounts",
|
"accounts": "Accounts",
|
||||||
@@ -827,6 +835,9 @@
|
|||||||
"title": "Don't virtualize feeds",
|
"title": "Don't virtualize feeds",
|
||||||
"description": "Virtualization only renders visible posts, increasing performance drastically. Disable virtualization if you are having stutter problems. This will disable infinite scroll."
|
"description": "Virtualization only renders visible posts, increasing performance drastically. Disable virtualization if you are having stutter problems. This will disable infinite scroll."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"account": {
|
||||||
|
"title": "Account"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import Entity from '$lib/components/ui/Entity.svelte'
|
import Entity from '$lib/components/ui/Entity.svelte'
|
||||||
import { t } from '$lib/translations.js'
|
import { t } from '$lib/translations.js'
|
||||||
|
import Switch from '$lib/components/input/Switch.svelte'
|
||||||
|
import UserAutocomplete from '$lib/components/lemmy/user/UserAutocomplete.svelte'
|
||||||
|
import { expoOut } from 'svelte/easing'
|
||||||
|
|
||||||
// sveltekit doesn't feel like making types work right now
|
// sveltekit doesn't feel like making types work right now
|
||||||
export let data: PageData & {
|
export let data: PageData & {
|
||||||
@@ -86,22 +89,23 @@
|
|||||||
<EditableList let:action on:action={(i) => unblockInstances(i.detail)}>
|
<EditableList let:action on:action={(i) => unblockInstances(i.detail)}>
|
||||||
{#each data.my_user?.instance_blocks as block (block.instance.id)}
|
{#each data.my_user?.instance_blocks as block (block.instance.id)}
|
||||||
<div
|
<div
|
||||||
class="flex flex-row gap-2 items-center py-4 justify-between"
|
class="flex flex-row gap-2 items-center py-4"
|
||||||
animate:flip={{ duration: 250 }}
|
animate:flip={{ duration: 250 }}
|
||||||
out:slide|local={{ axis: 'y' }}
|
out:slide|local={{ axis: 'y' }}
|
||||||
>
|
>
|
||||||
|
<Button
|
||||||
|
title="Unblock"
|
||||||
|
size="square-md"
|
||||||
|
rounding="pill"
|
||||||
|
on:click={() => action(block)}
|
||||||
|
>
|
||||||
|
<Icon src={XMark} mini size="16" slot="prefix" />
|
||||||
|
</Button>
|
||||||
<Entity
|
<Entity
|
||||||
icon={block.site?.icon}
|
icon={block.site?.icon}
|
||||||
name={block.site?.name ?? block.instance.domain}
|
name={block.site?.name ?? block.instance.domain}
|
||||||
label={block.instance.domain}
|
label={block.instance.domain}
|
||||||
/>
|
/>
|
||||||
<Button
|
|
||||||
title="Unblock"
|
|
||||||
size="square-md"
|
|
||||||
on:click={() => action(block)}
|
|
||||||
>
|
|
||||||
<Icon src={XMark} mini size="16" slot="prefix" />
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</EditableList>
|
</EditableList>
|
||||||
@@ -113,18 +117,19 @@
|
|||||||
<EditableList let:action on:action={(i) => unblockCommunity(i.detail)}>
|
<EditableList let:action on:action={(i) => unblockCommunity(i.detail)}>
|
||||||
{#each data.community_blocks as block (block.community.id)}
|
{#each data.community_blocks as block (block.community.id)}
|
||||||
<div
|
<div
|
||||||
class="flex flex-row gap-2 items-center py-2 justify-between"
|
class="flex flex-row gap-2 items-center py-2"
|
||||||
animate:flip={{ duration: 250 }}
|
animate:flip={{ duration: 250 }}
|
||||||
out:slide|local={{ axis: 'y' }}
|
out:slide|global={{ axis: 'y', easing: expoOut, duration: 300 }}
|
||||||
>
|
>
|
||||||
<CommunityLink community={block.community} avatar />
|
|
||||||
<Button
|
<Button
|
||||||
title="Unblock"
|
title="Unblock"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
|
rounding="pill"
|
||||||
on:click={() => action(block)}
|
on:click={() => action(block)}
|
||||||
>
|
>
|
||||||
<Icon src={XMark} mini size="16" slot="prefix" />
|
<Icon src={XMark} mini size="16" slot="prefix" />
|
||||||
</Button>
|
</Button>
|
||||||
|
<CommunityLink community={block.community} avatar />
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</EditableList>
|
</EditableList>
|
||||||
@@ -136,21 +141,30 @@
|
|||||||
<EditableList let:action on:action={(i) => unblockUser(i.detail)}>
|
<EditableList let:action on:action={(i) => unblockUser(i.detail)}>
|
||||||
{#each data.person_blocks as block (block.target.id)}
|
{#each data.person_blocks as block (block.target.id)}
|
||||||
<div
|
<div
|
||||||
class="flex flex-row gap-2 items-center py-2 justify-between"
|
class="flex flex-row gap-2 items-center py-2"
|
||||||
animate:flip={{ duration: 250 }}
|
animate:flip={{ duration: 250 }}
|
||||||
out:slide|local={{ axis: 'y' }}
|
out:slide|global={{ axis: 'y', easing: expoOut, duration: 300 }}
|
||||||
>
|
>
|
||||||
<UserLink user={block.target} avatar badges />
|
|
||||||
<Button
|
<Button
|
||||||
title="Unblock"
|
title="Unblock"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
|
rounding="pill"
|
||||||
on:click={() => action(block)}
|
on:click={() => action(block)}
|
||||||
>
|
>
|
||||||
<Icon src={XMark} mini size="16" slot="prefix" />
|
<Icon src={XMark} mini size="16" slot="prefix" />
|
||||||
</Button>
|
</Button>
|
||||||
|
<UserLink user={block.target} avatar badges />
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</EditableList>
|
</EditableList>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
{:else}
|
||||||
|
<div class="h-full w-full grid place-items-center">
|
||||||
|
<Placeholder
|
||||||
|
icon={Check}
|
||||||
|
title={$t('routes.profile.blocks.empty.title')}
|
||||||
|
description={$t('routes.profile.blocks.empty.description')}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -4,11 +4,12 @@
|
|||||||
import { ImageInput, Material, removeToast, toast } from 'mono-svelte'
|
import { ImageInput, Material, removeToast, toast } from 'mono-svelte'
|
||||||
import { getClient } from '$lib/lemmy.js'
|
import { getClient } from '$lib/lemmy.js'
|
||||||
import type { SaveUserSettings } from 'lemmy-js-client'
|
import type { SaveUserSettings } from 'lemmy-js-client'
|
||||||
import { Button, Checkbox, Modal, TextInput } from 'mono-svelte'
|
import { Button, Switch, TextInput } from 'mono-svelte'
|
||||||
import { uploadImage } from '$lib/util.js'
|
import { uploadImage } from '$lib/util.js'
|
||||||
import { t } from '$lib/translations.js'
|
import { t } from '$lib/translations.js'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
|
|
||||||
|
export let inline: boolean = false
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
let formData: Omit<SaveUserSettings, 'auth'> | undefined = {
|
let formData: Omit<SaveUserSettings, 'auth'> | undefined = {
|
||||||
@@ -56,8 +57,12 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form class="flex flex-col gap-4 h-full" on:submit|preventDefault={save}>
|
<form class="flex flex-col gap-4 h-full" on:submit|preventDefault={save}>
|
||||||
|
{#if !inline}
|
||||||
<Header pageHeader>{$t('routes.profile.settings')}</Header>
|
<Header pageHeader>{$t('routes.profile.settings')}</Header>
|
||||||
|
{/if}
|
||||||
|
<slot />
|
||||||
{#if data.my_user?.local_user_view?.local_user && formData}
|
{#if data.my_user?.local_user_view?.local_user && formData}
|
||||||
|
<TextInput label={$t('form.profile.email')} bind:value={formData.email} />
|
||||||
<TextInput
|
<TextInput
|
||||||
label={$t('form.profile.displayName')}
|
label={$t('form.profile.displayName')}
|
||||||
bind:value={formData.display_name}
|
bind:value={formData.display_name}
|
||||||
@@ -69,29 +74,30 @@
|
|||||||
label={$t('form.profile.bio')}
|
label={$t('form.profile.bio')}
|
||||||
previewButton
|
previewButton
|
||||||
/>
|
/>
|
||||||
|
<div class="flex gap-2 items-center *:flex-1">
|
||||||
<ImageInput label={$t('form.profile.avatar')} bind:files={profileImage} />
|
<ImageInput label={$t('form.profile.avatar')} bind:files={profileImage} />
|
||||||
<ImageInput label={$t('form.profile.banner')} bind:files={bannerImage} />
|
<ImageInput label={$t('form.profile.banner')} bind:files={bannerImage} />
|
||||||
<TextInput label={$t('form.profile.email')} bind:value={formData.email} />
|
</div>
|
||||||
<TextInput
|
<TextInput
|
||||||
label={$t('form.profile.matrix')}
|
label={$t('form.profile.matrix')}
|
||||||
bind:value={formData.matrix_user_id}
|
bind:value={formData.matrix_user_id}
|
||||||
placeholder="@user:example.com"
|
placeholder="@user:example.com"
|
||||||
/>
|
/>
|
||||||
<Checkbox bind:checked={formData.show_nsfw}>
|
<Switch bind:checked={formData.show_nsfw}>
|
||||||
{$t('form.profile.showNSFW')}
|
{$t('form.profile.showNSFW')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox bind:checked={formData.show_scores}>
|
<Switch bind:checked={formData.show_scores}>
|
||||||
{$t('form.profile.scores')}
|
{$t('form.profile.scores')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox bind:checked={formData.bot_account}>
|
<Switch bind:checked={formData.bot_account}>
|
||||||
{$t('form.profile.bot')}
|
{$t('form.profile.bot')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox bind:checked={formData.show_bot_accounts}>
|
<Switch bind:checked={formData.show_bot_accounts}>
|
||||||
{$t('form.profile.showBots')}
|
{$t('form.profile.showBots')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox bind:checked={formData.show_read_posts}>
|
<Switch bind:checked={formData.show_read_posts}>
|
||||||
{$t('form.profile.showRead')}
|
{$t('form.profile.showRead')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
submit
|
submit
|
||||||
|
|||||||
@@ -30,9 +30,13 @@
|
|||||||
<Tabs
|
<Tabs
|
||||||
class="overflow-auto"
|
class="overflow-auto"
|
||||||
routes={[
|
routes={[
|
||||||
|
{
|
||||||
|
href: '/profile',
|
||||||
|
name: $t('routes.profile.overview'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
href: '/profile/user',
|
href: '/profile/user',
|
||||||
name: $t('routes.profile.user'),
|
name: $t('routes.profile.submissions'),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -42,7 +46,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
href: '/profile/blocks',
|
href: '/profile/blocks',
|
||||||
name: $t('routes.profile.blocks'),
|
name: $t('routes.profile.blocks.title'),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,5 +17,6 @@ export async function load({ params, url, fetch }) {
|
|||||||
community_blocks: my_user?.community_blocks,
|
community_blocks: my_user?.community_blocks,
|
||||||
person_blocks: my_user?.person_blocks,
|
person_blocks: my_user?.person_blocks,
|
||||||
follows: my_user?.follows,
|
follows: my_user?.follows,
|
||||||
|
moderates: my_user?.moderates,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1 +1,91 @@
|
|||||||
how did you get here? something in my code must have broke
|
<script lang="ts">
|
||||||
|
import { profile } from '$lib/auth'
|
||||||
|
import ItemList from '$lib/components/lemmy/generic/ItemList.svelte'
|
||||||
|
import { isAdmin } from '$lib/components/lemmy/moderation/moderation.js'
|
||||||
|
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
|
||||||
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
|
import EntityHeader from '$lib/components/ui/EntityHeader.svelte'
|
||||||
|
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||||
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
|
import { publishedToDate } from '$lib/components/util/date.js'
|
||||||
|
import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte'
|
||||||
|
import { communityLink } from '$lib/lemmy/generic.js'
|
||||||
|
import { userSettings } from '$lib/settings.js'
|
||||||
|
import { t } from '$lib/translations'
|
||||||
|
import { Spinner, Button, Menu, MenuButton } from 'mono-svelte'
|
||||||
|
import {
|
||||||
|
AtSymbol,
|
||||||
|
EllipsisHorizontal,
|
||||||
|
Envelope,
|
||||||
|
Icon,
|
||||||
|
ShieldExclamation,
|
||||||
|
} from 'svelte-hero-icons'
|
||||||
|
|
||||||
|
export let data
|
||||||
|
|
||||||
|
$: my_user = data.my_user!.local_user_view
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Header pageHeader>
|
||||||
|
{$t('routes.profile.overview')}
|
||||||
|
</Header>
|
||||||
|
|
||||||
|
<EntityHeader
|
||||||
|
avatar={my_user.person.avatar}
|
||||||
|
name={my_user.person.display_name || my_user.person.name}
|
||||||
|
banner={my_user.person.banner}
|
||||||
|
bio={my_user.person.bio}
|
||||||
|
stats={[
|
||||||
|
{
|
||||||
|
name: $t('content.posts'),
|
||||||
|
value: my_user.counts.post_count.toString(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: $t('content.comments'),
|
||||||
|
value: my_user.counts.comment_count.toString(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: $t('stats.joined'),
|
||||||
|
value: formatRelativeDate(publishedToDate(my_user.person.published), {
|
||||||
|
style: 'short',
|
||||||
|
}).toString(),
|
||||||
|
format: false,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<span class="text-sm flex gap-0 items-center w-max" slot="nameDetail">
|
||||||
|
@
|
||||||
|
<UserLink
|
||||||
|
showInstance
|
||||||
|
user={my_user.person}
|
||||||
|
displayName={false}
|
||||||
|
class="font-normal"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
{#if (data.moderates ?? []).length > 0}
|
||||||
|
<Expandable
|
||||||
|
class="border rounded-xl bg-white/50 dark:bg-zinc-900/50 w-full p-3 px-4
|
||||||
|
dark:border-zinc-800 border-slate-300 border-opacity-50 text-slate-700 dark:text-zinc-300 transition-colors"
|
||||||
|
>
|
||||||
|
<span slot="title" class="flex items-center gap-1">
|
||||||
|
<ShieldIcon width={14} filled />
|
||||||
|
{$t('routes.profile.moderates')}
|
||||||
|
</span>
|
||||||
|
<ItemList
|
||||||
|
items={data.moderates?.map((m) => ({
|
||||||
|
id: m.community.id,
|
||||||
|
name: m.community.title,
|
||||||
|
url: communityLink(m.community),
|
||||||
|
avatar: m.community.icon,
|
||||||
|
instance: new URL(m.community.actor_id).hostname,
|
||||||
|
})) ?? []}
|
||||||
|
/>
|
||||||
|
</Expandable>
|
||||||
|
{/if}
|
||||||
|
</EntityHeader>
|
||||||
|
|
||||||
|
{#if $userSettings.debugInfo}
|
||||||
|
<pre>
|
||||||
|
{JSON.stringify(my_user, undefined, 4)}
|
||||||
|
</pre>
|
||||||
|
{/if}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import { redirect } from '@sveltejs/kit'
|
|
||||||
|
|
||||||
export const load = async () => {
|
|
||||||
redirect(302, '/profile/user');
|
|
||||||
}
|
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
{#if data.user && data.sort && data.type && data.page}
|
{#if data.user && data.sort && data.type && data.page}
|
||||||
<UserPage
|
<UserPage
|
||||||
|
inline
|
||||||
data={{
|
data={{
|
||||||
items: data.user.submissions,
|
items: data.user.submissions,
|
||||||
page: data.page,
|
page: data.page,
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||||
import { removalTemplate } from '$lib/components/lemmy/moderation/moderation.js'
|
import { removalTemplate } from '$lib/components/lemmy/moderation/moderation.js'
|
||||||
import { Button, Checkbox, Select } from 'mono-svelte'
|
import { Button, Checkbox, Select, Spinner } from 'mono-svelte'
|
||||||
import ViewSelect from '$lib/components/lemmy/dropdowns/ViewSelect.svelte'
|
import ViewSelect from '$lib/components/lemmy/dropdowns/ViewSelect.svelte'
|
||||||
import { LINKED_INSTANCE_URL } from '$lib/instance.js'
|
import { LINKED_INSTANCE_URL } from '$lib/instance.js'
|
||||||
import { DOMAIN_REGEX_FORMS, removeItem } from '$lib/util.js'
|
import { DOMAIN_REGEX_FORMS, removeItem } from '$lib/util.js'
|
||||||
@@ -45,6 +45,8 @@
|
|||||||
import { locale, locales, t } from '$lib/translations'
|
import { locale, locales, t } from '$lib/translations'
|
||||||
import { getDefaultLinks, iconOfLink } from '$lib/components/ui/navbar/link'
|
import { getDefaultLinks, iconOfLink } from '$lib/components/ui/navbar/link'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
|
import { profile } from '$lib/auth'
|
||||||
|
import AccountPage from '../profile/(local_user)/settings/+page.svelte'
|
||||||
let importing = false
|
let importing = false
|
||||||
let importText = ''
|
let importText = ''
|
||||||
|
|
||||||
@@ -150,7 +152,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</Header>
|
</Header>
|
||||||
|
|
||||||
<div class="flex items-center gap-2 flex-wrap w-full mt-5">
|
<div class="flex items-center gap-2 flex-wrap w-full my-5">
|
||||||
<Button href="#app" size="sm" class="text-xs" rounding="pill">
|
<Button href="#app" size="sm" class="text-xs" rounding="pill">
|
||||||
<Icon src={ArrowTopRightOnSquare} size="14" micro />
|
<Icon src={ArrowTopRightOnSquare} size="14" micro />
|
||||||
{$t('settings.app.title')}
|
{$t('settings.app.title')}
|
||||||
@@ -177,7 +179,25 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-4" style="scroll-behavior: smooth;">
|
<div
|
||||||
|
class="flex flex-col *:py-2 divide-y divide-slate-200 dark:divide-zinc-800"
|
||||||
|
style="scroll-behavior: smooth;"
|
||||||
|
>
|
||||||
|
{#if $profile?.jwt}
|
||||||
|
<Section open={false} id="account" title={$t('settings.account.title')}>
|
||||||
|
<div>
|
||||||
|
<Button
|
||||||
|
color="primary"
|
||||||
|
size="lg"
|
||||||
|
href="/profile/settings"
|
||||||
|
class="block"
|
||||||
|
>
|
||||||
|
{$t('profile.profile')}
|
||||||
|
<Icon src={ArrowRight} micro size="16" slot="suffix" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</Section>
|
||||||
|
{/if}
|
||||||
<Section id="app" title={$t('settings.app.title')}>
|
<Section id="app" title={$t('settings.app.title')}>
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<Setting>
|
<Setting>
|
||||||
@@ -291,36 +311,10 @@
|
|||||||
title={$t('settings.app.infiniteScroll.title')}
|
title={$t('settings.app.infiniteScroll.title')}
|
||||||
description={$t('settings.app.infiniteScroll.description')}
|
description={$t('settings.app.infiniteScroll.description')}
|
||||||
/>
|
/>
|
||||||
<ToggleSetting
|
|
||||||
bind:checked={$userSettings.openLinksInNewTab}
|
|
||||||
title={$t('settings.app.postsInNewTab.title')}
|
|
||||||
description={$t('settings.app.postsInNewTab.description')}
|
|
||||||
/>
|
|
||||||
<ToggleSetting
|
|
||||||
supportedPlatforms={{ desktop: true, tablet: false, mobile: false }}
|
|
||||||
bind:checked={$userSettings.newWidth}
|
|
||||||
title={$t('settings.app.limitLayoutWidth.title')}
|
|
||||||
description={$t('settings.app.limitLayoutWidth.description')}
|
|
||||||
/>
|
|
||||||
<ToggleSetting
|
|
||||||
bind:checked={$userSettings.randomPlaceholders}
|
|
||||||
title={$t('settings.app.placeholders.title')}
|
|
||||||
description={$t('settings.app.placeholders.description')}
|
|
||||||
/>
|
|
||||||
<ToggleSetting
|
|
||||||
bind:checked={$userSettings.expandImages}
|
|
||||||
title={$t('settings.app.expandImages.title')}
|
|
||||||
description={$t('settings.app.expandImages.description')}
|
|
||||||
/>
|
|
||||||
<ToggleSetting
|
|
||||||
bind:checked={$userSettings.posts.deduplicateEmbed}
|
|
||||||
title={$t('settings.app.duplicateTitles.title')}
|
|
||||||
description={$t('settings.app.duplicateTitles.description')}
|
|
||||||
/>
|
|
||||||
<Setting>
|
<Setting>
|
||||||
<span slot="title">{$t('settings.app.thumbnailSide.title')}</span>
|
<span slot="title">{$t('settings.app.thumbnailSide.title')}</span>
|
||||||
<span slot="description">
|
<span slot="description">
|
||||||
{$t('settings.app.thumbnailSide.title')}
|
{$t('settings.app.thumbnailSide.description')}
|
||||||
</span>
|
</span>
|
||||||
<MultiSelect
|
<MultiSelect
|
||||||
options={[true, false]}
|
options={[true, false]}
|
||||||
@@ -331,6 +325,17 @@
|
|||||||
bind:selected={$userSettings.leftAlign}
|
bind:selected={$userSettings.leftAlign}
|
||||||
/>
|
/>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<ToggleSetting
|
||||||
|
supportedPlatforms={{ desktop: true, tablet: false, mobile: false }}
|
||||||
|
bind:checked={$userSettings.newWidth}
|
||||||
|
title={$t('settings.app.limitLayoutWidth.title')}
|
||||||
|
description={$t('settings.app.limitLayoutWidth.description')}
|
||||||
|
/>
|
||||||
|
<ToggleSetting
|
||||||
|
bind:checked={$userSettings.openLinksInNewTab}
|
||||||
|
title={$t('settings.app.postsInNewTab.title')}
|
||||||
|
description={$t('settings.app.postsInNewTab.description')}
|
||||||
|
/>
|
||||||
<Setting>
|
<Setting>
|
||||||
<span slot="title">{$t('settings.app.font.title')}</span>
|
<span slot="title">{$t('settings.app.font.title')}</span>
|
||||||
<span slot="description">{$t('settings.app.font.description')}</span>
|
<span slot="description">{$t('settings.app.font.description')}</span>
|
||||||
@@ -349,6 +354,21 @@
|
|||||||
<Icon src={ArrowRight} size="16" mini slot="suffix" />
|
<Icon src={ArrowRight} size="16" mini slot="suffix" />
|
||||||
</Button>
|
</Button>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<ToggleSetting
|
||||||
|
bind:checked={$userSettings.randomPlaceholders}
|
||||||
|
title={$t('settings.app.placeholders.title')}
|
||||||
|
description={$t('settings.app.placeholders.description')}
|
||||||
|
/>
|
||||||
|
<ToggleSetting
|
||||||
|
bind:checked={$userSettings.expandImages}
|
||||||
|
title={$t('settings.app.expandImages.title')}
|
||||||
|
description={$t('settings.app.expandImages.description')}
|
||||||
|
/>
|
||||||
|
<ToggleSetting
|
||||||
|
bind:checked={$userSettings.posts.deduplicateEmbed}
|
||||||
|
title={$t('settings.app.duplicateTitles.title')}
|
||||||
|
description={$t('settings.app.duplicateTitles.description')}
|
||||||
|
/>
|
||||||
<Setting>
|
<Setting>
|
||||||
<span slot="title">{$t('settings.app.translation.title')}</span>
|
<span slot="title">{$t('settings.app.translation.title')}</span>
|
||||||
<span slot="description">
|
<span slot="description">
|
||||||
|
|||||||
@@ -1,11 +1,43 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||||
|
import { ChevronDown, Icon, Minus, Plus } from 'svelte-hero-icons'
|
||||||
|
import { backOut, expoOut } from 'svelte/easing'
|
||||||
|
import { slide } from 'svelte/transition'
|
||||||
|
|
||||||
export let title: string
|
export let title: string
|
||||||
export let id: string
|
export let id: string
|
||||||
|
|
||||||
|
export let open = true
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div class="flex flex-col max-w-full w-full">
|
||||||
|
<button
|
||||||
|
class="text-left hover:text-primary-900 dark:hover:text-primary-100
|
||||||
|
flex items-center justify-between z-0 relative group transition-colors"
|
||||||
|
on:click={() => (open = !open)}
|
||||||
|
>
|
||||||
|
<h2 class="text-xl font-semibold text-inherit" {id}>
|
||||||
|
<span>{title}</span>
|
||||||
|
</h2>
|
||||||
|
<Icon
|
||||||
|
src={open ? Minus : Plus}
|
||||||
|
size="16"
|
||||||
|
micro
|
||||||
|
class="{open
|
||||||
|
? ''
|
||||||
|
: 'rotate-90'} transition-transform duration-500 ease-out"
|
||||||
|
/>
|
||||||
<div
|
<div
|
||||||
class="flex flex-col min-w-0 divide-y divide-slate-200 dark:divide-zinc-800 *:py-3.5 max-w-full w-full"
|
class="absolute inset-x-0 inset-y-1 opacity-0 rounded-full bg-slate-50 dark:bg-zinc-900
|
||||||
|
group-hover:-inset-x-3 group-hover:-inset-y-1 group-hover:opacity-100 transition-all -z-10"
|
||||||
|
></div>
|
||||||
|
</button>
|
||||||
|
{#if open}
|
||||||
|
<div
|
||||||
|
transition:slide={{ axis: 'y', duration: 500, easing: expoOut }}
|
||||||
|
class="w-full flex flex-col divide-y divide-slate-200 dark:divide-zinc-800 *:py-3"
|
||||||
>
|
>
|
||||||
<h2 class="text-xl font-semibold text-inherit" {id}>{title}</h2>
|
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte'
|
import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
export let inline: boolean = false
|
||||||
|
|
||||||
let blocking = false
|
let blocking = false
|
||||||
|
|
||||||
@@ -144,6 +145,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full">
|
<div class="flex flex-col gap-4 max-w-full w-full">
|
||||||
|
{#if !inline}
|
||||||
<div class="">
|
<div class="">
|
||||||
<EntityHeader
|
<EntityHeader
|
||||||
avatar={data.person_view.person.avatar}
|
avatar={data.person_view.person.avatar}
|
||||||
@@ -234,7 +236,12 @@
|
|||||||
data.person_view.person
|
data.person_view.person
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Icon slot="prefix" mini size="16" src={ShieldExclamation} />
|
<Icon
|
||||||
|
slot="prefix"
|
||||||
|
mini
|
||||||
|
size="16"
|
||||||
|
src={ShieldExclamation}
|
||||||
|
/>
|
||||||
{data.person_view.person.banned ? 'Unban' : 'Ban'}
|
{data.person_view.person.banned ? 'Unban' : 'Ban'}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
@@ -265,6 +272,7 @@
|
|||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</EntityHeader>
|
</EntityHeader>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
||||||
<div class="flex flex-row gap-4 flex-wrap">
|
<div class="flex flex-row gap-4 flex-wrap">
|
||||||
|
|||||||
Reference in new issue
Block a user