design: update accounts page and commonlist

This commit is contained in:
Xylight committed 2025-10-14 17:20:26 -07:00
1 parent a61f5d226f
commit 0bb99ddb86
5 files changed
+266 -142

No files matched your search

+100 -101
View File
@@ -132,111 +132,110 @@
/>
{:else}
<form class="accounts-grid gap-4">
<CommonList
selected={(p) => p.id == profile.meta.profile}
items={profile.meta.profiles}
animate={false}
>
{#snippet item(p, index)}
<label class="relative block">
<input
type="radio"
id={p.id.toString()}
name="profile"
value={p.id}
class="hidden peer"
bind:group={radioSelected}
/>
<div
class={[
'flex flex-row items-center gap-2 transition-all duration-75',
'cursor-pointer relative ring-transparent',
]}
>
<div
class="absolute -inset-2 -inset-x-3 sm:-inset-y-3 sm:-inset-x-4 group-first/li:rounded-t-2xl group-last/li:rounded-b-2xl rounded-md ring-2 ring-inherit"
></div>
<ProfileAvatar
profile={p}
{index}
selected={profile?.current.id == p.id}
size={32}
<CommonList animate={false}>
{#each profile.meta.profiles as p}
<li
class={['xs px-4 py-1', p.id == profile.meta.profile && 'selected']}
>
<label class="relative block">
<input
type="radio"
id={p.id.toString()}
name="profile"
value={p.id}
class="hidden peer"
bind:group={radioSelected}
/>
<div class="flex flex-col overflow-hidden">
<span class="break-words font-medium text-base">
{p.username}
{#if !p.jwt}
<Badge class="inline-grid w-6 h-6 p-0! place-items-center">
<Icon src={QuestionMarkCircle} size="16" micro />
</Badge>
{/if}
</span>
<span class="text-sm text-slate-600 dark:text-zinc-400">
<span class="capitalize">
{p.client?.name ?? DEFAULT_CLIENT_TYPE.name}
</span>
• {p.instance}
</span>
</div>
<Menu placement="bottom-end">
{#snippet target(attachment)}
<Button
{@attach attachment}
size="square-md"
color="tertiary"
class="justify-self-end ml-auto z-50"
aria-label={$t('post.actions.more.label')}
icon={EllipsisHorizontal}
></Button>
{/snippet}
<!-- svelte-ignore a11y_click_events_have_key_events -->
<!-- svelte-ignore a11y_no_static_element_interactions -->
<div
class={[
'flex flex-row items-center gap-2 transition-all duration-75',
'cursor-pointer relative ring-transparent',
]}
>
<div
class="px-4 py-2 flex items-center gap-2"
onclick={(e) => e.stopPropagation()}
>
<Button
size="square-md"
color="secondary"
title={$t('account.moveUp')}
onclick={() => profile.move(p.id, true)}
icon={ChevronUp}
></Button>
<Button
size="square-md"
color="secondary"
title={$t('account.moveDown')}
onclick={() => profile.move(p.id, false)}
icon={ChevronDown}
></Button>
class="absolute -inset-2 -inset-x-3 sm:-inset-y-3 sm:-inset-x-4 group-first/li:rounded-t-2xl group-last/li:rounded-b-2xl rounded-md ring-2 ring-inherit"
></div>
<ProfileAvatar
profile={p}
selected={profile?.current.id == p.id}
size={24}
/>
<div class="flex flex-col overflow-hidden">
<span class="break-words font-medium text-base">
{p.username}
{#if !p.jwt}
<Badge class="inline-grid w-6 h-6 p-0! place-items-center">
<Icon src={QuestionMarkCircle} size="16" micro />
</Badge>
{/if}
</span>
<span class="text-xs text-slate-600 dark:text-zinc-400">
<span class="capitalize">
{p.client?.name ?? DEFAULT_CLIENT_TYPE.name}
</span>
• {p.instance}
</span>
</div>
{#if settings.debugInfo}
<MenuButton
onclick={() => {
debugProfile = p
debugging = !debugging
}}
icon={BugAnt}
<Menu placement="bottom-end">
{#snippet target(attachment)}
<Button
{@attach attachment}
size="square-md"
color="tertiary"
class="justify-self-end ml-auto z-50"
aria-label={$t('post.actions.more.label')}
icon={EllipsisHorizontal}
></Button>
{/snippet}
<!-- svelte-ignore a11y_click_events_have_key_events -->
<!-- svelte-ignore a11y_no_static_element_interactions -->
<div
class="px-4 py-2 flex items-center gap-2"
onclick={(e) => e.stopPropagation()}
>
{$t('common.debug')}
</MenuButton>
{/if}
{#if !LINKED_INSTANCE_URL || p.user}
<MenuButton
onclick={() => {
removing.account = p
removing.shown = !removing.shown
}}
color="danger-subtle"
icon={ArrowRightOnRectangle}
>
{$t('account.logout')}
</MenuButton>
{/if}
</Menu>
</div>
</label>
{/snippet}
<Button
size="square-md"
color="secondary"
title={$t('account.moveUp')}
onclick={() => profile.move(p.id, true)}
icon={ChevronUp}
></Button>
<Button
size="square-md"
color="secondary"
title={$t('account.moveDown')}
onclick={() => profile.move(p.id, false)}
icon={ChevronDown}
></Button>
</div>
{#if settings.debugInfo}
<MenuButton
onclick={() => {
debugProfile = p
debugging = !debugging
}}
icon={BugAnt}
>
{$t('common.debug')}
</MenuButton>
{/if}
{#if !LINKED_INSTANCE_URL || p.user}
<MenuButton
onclick={() => {
removing.account = p
removing.shown = !removing.shown
}}
color="danger-subtle"
icon={ArrowRightOnRectangle}
>
{$t('account.logout')}
</MenuButton>
{/if}
</Menu>
</div>
</label>
</li>
{/each}
</CommonList>
</form>
{/if}