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