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:
Xylight authored and GitHub committed 2024-09-22 14:48:22 -07:00
1 parent 7c7df02e3d
commit 62e20fcb69
14 files changed
+373 -189

No files matched your search

+50 -30
View File
@@ -36,7 +36,7 @@
} from 'svelte-hero-icons'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
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 { LINKED_INSTANCE_URL } from '$lib/instance.js'
import { DOMAIN_REGEX_FORMS, removeItem } from '$lib/util.js'
@@ -45,6 +45,8 @@
import { locale, locales, t } from '$lib/translations'
import { getDefaultLinks, iconOfLink } from '$lib/components/ui/navbar/link'
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 importText = ''
@@ -150,7 +152,7 @@
</div>
</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">
<Icon src={ArrowTopRightOnSquare} size="14" micro />
{$t('settings.app.title')}
@@ -177,7 +179,25 @@
</Button>
</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')}>
<div class="flex flex-col gap-2">
<Setting>
@@ -291,36 +311,10 @@
title={$t('settings.app.infiniteScroll.title')}
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>
<span slot="title">{$t('settings.app.thumbnailSide.title')}</span>
<span slot="description">
{$t('settings.app.thumbnailSide.title')}
{$t('settings.app.thumbnailSide.description')}
</span>
<MultiSelect
options={[true, false]}
@@ -331,6 +325,17 @@
bind:selected={$userSettings.leftAlign}
/>
</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>
<span slot="title">{$t('settings.app.font.title')}</span>
<span slot="description">{$t('settings.app.font.description')}</span>
@@ -349,6 +354,21 @@
<Icon src={ArrowRight} size="16" mini slot="suffix" />
</Button>
</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>
<span slot="title">{$t('settings.app.translation.title')}</span>
<span slot="description">
+37 -5
View File
@@ -1,11 +1,43 @@
<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 id: string
export let open = true
</script>
<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"
>
<h2 class="text-xl font-semibold text-inherit" {id}>{title}</h2>
<slot />
<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
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"
>
<slot />
</div>
{/if}
</div>