design: use commonlist for accounts page
This commit is contained in:
2 files changed
+22
-17
No files matched your search
@@ -10,12 +10,12 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ul class="divide-y-3 divide-slate-25 dark:divide-zinc-925">
|
<ul class="divide-y-3 divide-slate-25 dark:divide-zinc-925">
|
||||||
{#each items as item, index}
|
{#each items as item, index (item)}
|
||||||
<li
|
<li
|
||||||
class={[
|
class={[
|
||||||
'py-2 px-3 sm:py-3 sm:px-4',
|
'py-2 px-3 sm:py-3 sm:px-4',
|
||||||
'hover:bg-slate-100 dark:hover:bg-zinc-900/25 transition-colors @container',
|
'hover:bg-slate-100 dark:hover:bg-zinc-900/25 transition-colors @container',
|
||||||
'bg-slate-50 dark:bg-zinc-950 first:rounded-t-2xl last:rounded-b-2xl',
|
'bg-slate-50 dark:bg-zinc-950 first:rounded-t-2xl last:rounded-b-2xl group/li',
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{@render itemSnippet(item, index)}
|
{@render itemSnippet(item, index)}
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile, type ProfileInfo } from '$lib/auth.svelte.js'
|
import { profile, type ProfileInfo } from '$lib/auth.svelte.js'
|
||||||
|
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import DebugObject from '$lib/components/util/debug/DebugObject.svelte'
|
import DebugObject from '$lib/components/util/debug/DebugObject.svelte'
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte.js'
|
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte.js'
|
||||||
import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte'
|
import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/settings.svelte.js'
|
||||||
import { Badge, Button, Material, Menu, MenuButton, Modal } from 'mono-svelte'
|
import { Badge, Button, Menu, MenuButton, Modal } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
ArrowLeftOnRectangle,
|
ArrowLeftOnRectangle,
|
||||||
ArrowRightOnRectangle,
|
ArrowRightOnRectangle,
|
||||||
@@ -133,8 +134,9 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
</Header>
|
</Header>
|
||||||
<form class="accounts-grid mt-4 sm:mt-6 gap-4">
|
<form class="accounts-grid mt-4 sm:mt-6 gap-4">
|
||||||
{#each profile.meta.profiles as p, index (p.id)}
|
<CommonList items={profile.meta.profiles}>
|
||||||
<label>
|
{#snippet item(p, index)}
|
||||||
|
<label class="relative">
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
id={p.id.toString()}
|
id={p.id.toString()}
|
||||||
@@ -143,21 +145,23 @@
|
|||||||
class="hidden peer"
|
class="hidden peer"
|
||||||
bind:group={radioSelected}
|
bind:group={radioSelected}
|
||||||
/>
|
/>
|
||||||
<Material
|
<div
|
||||||
rounding="2xl"
|
|
||||||
color="uniform"
|
|
||||||
padding="none"
|
|
||||||
class={[
|
class={[
|
||||||
'flex flex-row items-center px-3 py-3 gap-2 transition-all duration-75 cursor-pointer relative',
|
'flex flex-row items-center gap-2 transition-all duration-75',
|
||||||
'peer-checked:ring-2',
|
'cursor-pointer relative ring-transparent',
|
||||||
switching == p.id && 'ring-slate-400 dark:ring-zinc-600',
|
switching == p.id
|
||||||
|
? 'ring-slate-500 dark:ring-zinc-500'
|
||||||
|
: 'peer-checked:ring-primary-900 peer-checked:dark:ring-primary-100',
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
|
<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
|
<ProfileAvatar
|
||||||
profile={p}
|
profile={p}
|
||||||
{index}
|
{index}
|
||||||
selected={profile?.current.id == p.id}
|
selected={profile?.current.id == p.id}
|
||||||
size={40}
|
size={32}
|
||||||
/>
|
/>
|
||||||
<div class="flex flex-col overflow-hidden">
|
<div class="flex flex-col overflow-hidden">
|
||||||
<span class="break-words font-medium text-base">
|
<span class="break-words font-medium text-base">
|
||||||
@@ -175,9 +179,9 @@
|
|||||||
<Menu placement="bottom-end">
|
<Menu placement="bottom-end">
|
||||||
{#snippet target()}
|
{#snippet target()}
|
||||||
<Button
|
<Button
|
||||||
size="custom"
|
size="square-md"
|
||||||
class="absolute top-0 right-0 w-6 h-6 m-1"
|
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
|
class="justify-self-end ml-auto z-50"
|
||||||
aria-label={$t('post.actions.more.label')}
|
aria-label={$t('post.actions.more.label')}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
@@ -240,9 +244,10 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
</Menu>
|
</Menu>
|
||||||
</Material>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
{/each}
|
{/snippet}
|
||||||
|
</CommonList>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in new issue
Block a user