misc: make account page more compact

This commit is contained in:
James Xylight committed 2025-07-08 14:49:38 -07:00
1 parent 47418e735c
commit b58ddcc1c4
3 files changed
+24 -8

No files matched your search

+7
View File
@@ -86,3 +86,10 @@
}).toString()} }).toString()}
</div> </div>
{/if} {/if}
<style>
img,
div {
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><line x1="30" y1="30" x2="70" y2="70" stroke="#aa0000" stroke-width="4" stroke-linecap="round"/><line x1="70" y1="30" x2="30" y2="70" stroke="#aa0000" stroke-width="4" stroke-linecap="round"/></svg>');
}
</style>
@@ -2,6 +2,7 @@
const wrapClass = { const wrapClass = {
wrap: '', wrap: '',
'no-wrap': 'overflow-hidden text-ellipsis whitespace-nowrap', 'no-wrap': 'overflow-hidden text-ellipsis whitespace-nowrap',
force: 'break-words',
} }
</script> </script>
+16 -8
View File
@@ -9,6 +9,7 @@
setUserID, setUserID,
} from '$lib/auth.svelte.js' } from '$lib/auth.svelte.js'
import Header from '$lib/components/ui/layout/pages/Header.svelte' import Header from '$lib/components/ui/layout/pages/Header.svelte'
import TextProps from '$lib/components/ui/text/TextProps.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'
@@ -24,6 +25,7 @@
EllipsisHorizontal, EllipsisHorizontal,
Icon, Icon,
Plus, Plus,
QuestionMarkCircle,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
let debugging = $state(false) let debugging = $state(false)
@@ -53,7 +55,7 @@
{#if debugging} {#if debugging}
<DebugObject <DebugObject
object={debugProfile?.id == profile.data?.id ? profile : debugProfile} object={debugProfile?.id == profile.data?.id ? profile.data : debugProfile}
bind:open={debugging} bind:open={debugging}
> >
{#snippet title()} {#snippet title()}
@@ -144,8 +146,9 @@
<Material <Material
rounding="2xl" rounding="2xl"
color="uniform" color="uniform"
padding="none"
class={[ class={[
'flex flex-col gap-2 py-3 transition-all duration-75 cursor-pointer', 'flex flex-row items-center px-3 py-3 gap-2 transition-all duration-75 cursor-pointer relative',
'peer-checked:ring-2', 'peer-checked:ring-2',
switching == profile.id && 'ring-slate-400 dark:ring-zinc-600', switching == profile.id && 'ring-slate-400 dark:ring-zinc-600',
]} ]}
@@ -156,12 +159,13 @@
selected={currentProfile?.data.id == profile.id} selected={currentProfile?.data.id == profile.id}
size={40} size={40}
/> />
<div class="flex flex-row justify-between"> <div class="flex flex-col overflow-hidden">
<div class="flex flex-col"> <span class="break-words font-medium text-base">
<span class="font-medium text-base">
{profile.username} {profile.username}
{#if !profile.jwt} {#if !profile.jwt}
<Badge class="inline">{$t('account.guest')}</Badge> <Badge class="inline-grid w-6 h-6 p-0! place-items-center">
<Icon src={QuestionMarkCircle} size="16" micro />
</Badge>
{/if} {/if}
</span> </span>
<span class="text-sm text-slate-600 dark:text-zinc-400"> <span class="text-sm text-slate-600 dark:text-zinc-400">
@@ -170,7 +174,12 @@
</div> </div>
<Menu placement="bottom-end"> <Menu placement="bottom-end">
{#snippet target()} {#snippet target()}
<Button rounding="pill" size="custom" class="self-end h-8 w-8"> <Button
size="custom"
class="absolute top-0 right-0 w-6 h-6 m-1"
color="tertiary"
aria-label={$t('post.actions.more')}
>
{#snippet prefix()} {#snippet prefix()}
<Icon src={EllipsisHorizontal} mini size="16" /> <Icon src={EllipsisHorizontal} mini size="16" />
{/snippet} {/snippet}
@@ -231,7 +240,6 @@
</MenuButton> </MenuButton>
{/if} {/if}
</Menu> </Menu>
</div>
</Material> </Material>
</label> </label>
{/each} {/each}