design: update header button design
This commit is contained in:
7 files changed
+158
-193
No files matched your search
@@ -37,7 +37,7 @@
|
||||
{...rest}
|
||||
{href}
|
||||
class="{highlight
|
||||
? 'text-blue-500'
|
||||
? 'text-sky-500'
|
||||
: ''} hover:underline max-w-full inline-flex items-center gap-1 {clazz}"
|
||||
>
|
||||
{@render icon?.()}
|
||||
|
||||
@@ -46,17 +46,8 @@
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
<Entity name={site.site.name} label={new URL(site.site.actor_id).hostname}>
|
||||
{#snippet customIcon()}
|
||||
<Avatar
|
||||
width={32}
|
||||
url={site.site.icon}
|
||||
alt={site.site.name}
|
||||
circle={false}
|
||||
/>
|
||||
{/snippet}
|
||||
</Entity>
|
||||
|
||||
<Avatar width={32} url={site.site.icon} alt="" circle={false} />
|
||||
<h2 class="font-medium text-lg -my-2">{site.site.name}</h2>
|
||||
<div class="flex flex-col gap-1">
|
||||
{#if taglines && taglines.length > 0}
|
||||
<Markdown
|
||||
@@ -78,6 +69,15 @@
|
||||
<Markdown source={site.site.description} />
|
||||
<div class="my-4"></div>
|
||||
<Markdown source={site.site.sidebar} />
|
||||
|
||||
{#if version}
|
||||
<div class="w-max">
|
||||
<Badge label="Lemmy version">
|
||||
<Icon src={ServerStack} micro size="14" />
|
||||
{version}
|
||||
</Badge>
|
||||
</div>
|
||||
{/if}
|
||||
</Expandable>
|
||||
|
||||
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
|
||||
@@ -132,7 +132,7 @@
|
||||
</Expandable>
|
||||
{/if}
|
||||
|
||||
<div class="flex flex-row flex-wrap gap-1">
|
||||
<div class="flex flex-row flex-wrap gap-1 my-2 text-xs">
|
||||
<Link highlight href="/modlog">
|
||||
{$t('routes.modlog.title')}
|
||||
</Link>
|
||||
@@ -145,14 +145,5 @@
|
||||
{$t('routes.instances')}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{#if version}
|
||||
<div class="w-max">
|
||||
<Badge label="Lemmy version">
|
||||
<Icon src={ServerStack} micro size="14" />
|
||||
{version}
|
||||
</Badge>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</StickyCard>
|
||||
@@ -126,14 +126,14 @@
|
||||
<Button
|
||||
disabled={subscribing}
|
||||
loading={subscribing}
|
||||
size="lg"
|
||||
color={subscribed == 'NotSubscribed' ? 'primary' : 'secondary'}
|
||||
onclick={async () => {
|
||||
subscribed =
|
||||
(await subscribe())?.community_view.subscribed ??
|
||||
'NotSubscribed'
|
||||
}}
|
||||
class="relative px-8 z-[inherit]"
|
||||
class="relative z-[inherit]"
|
||||
rounding="pill"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon
|
||||
@@ -154,21 +154,21 @@
|
||||
.map(c => c.community.id)
|
||||
.includes(community.id)}
|
||||
<Button
|
||||
size="square-lg"
|
||||
color="secondary"
|
||||
rounding="xl"
|
||||
size="custom"
|
||||
rounding="pill"
|
||||
class="h-9 aspect-square"
|
||||
href="/c/{fullCommunityName(
|
||||
community.name,
|
||||
community.actor_id,
|
||||
)}/settings"
|
||||
style="height: 38px; width: 38px;"
|
||||
>
|
||||
<Icon src={Cog6Tooth} size="16" mini />
|
||||
</Button>
|
||||
{/if}
|
||||
<Menu placement="top-end">
|
||||
{#snippet target()}
|
||||
<Button rounding="xl" size="custom" style="height: 38px; width: 38px;">
|
||||
<Button size="custom" rounding="pill" class="h-8.5 aspect-square">
|
||||
{#snippet prefix()}
|
||||
<Icon src={EllipsisHorizontal} size="16" mini />
|
||||
{/snippet}
|
||||
|
||||
+127
-155
@@ -97,166 +97,138 @@
|
||||
</Modal>
|
||||
{/if}
|
||||
|
||||
{#if profileData.profiles.length == 0}
|
||||
<div class="h-max flex items-center justify-center my-auto">
|
||||
<div
|
||||
class="flex flex-col justify-center items-center py-8 gap-4
|
||||
my-auto"
|
||||
>
|
||||
<div class="flex flex-col items-center">
|
||||
<Icon src={ArrowLeftOnRectangle} size="48" solid />
|
||||
<h1 class="font-bold text-3xl">No accounts</h1>
|
||||
</div>
|
||||
<div class="flex flex-row items-center gap-2">
|
||||
<Button href="/accounts/login" size="lg">
|
||||
{#snippet prefix()}
|
||||
<Icon src={ArrowLeftOnRectangle} size="16" micro />
|
||||
{/snippet}
|
||||
Log in
|
||||
</Button>
|
||||
<Button href="/signup" size="lg">
|
||||
{#snippet prefix()}
|
||||
<Icon src={Identification} size="16" micro />
|
||||
{/snippet}
|
||||
Sign up
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="flex flex-col h-full gap-4">
|
||||
<Header pageHeader>
|
||||
{$t('routes.accounts')}
|
||||
{#snippet extended()}
|
||||
<div class="flex">
|
||||
<div class="flex gap-2 mr-auto">
|
||||
<Button
|
||||
href="/accounts/login"
|
||||
size="lg"
|
||||
class="flex-1 px-8"
|
||||
color="primary"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ArrowLeftOnRectangle} size="16" mini />
|
||||
{/snippet}
|
||||
{$t('account.login')}
|
||||
</Button>
|
||||
{#if !LINKED_INSTANCE_URL}
|
||||
<Button href="/accounts/login/guest" size="lg">
|
||||
{#snippet prefix()}
|
||||
<Icon src={Plus} size="16" micro />
|
||||
{/snippet}
|
||||
{$t('account.addGuest')}
|
||||
</Button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/snippet}
|
||||
</Header>
|
||||
<div>
|
||||
{#each profileData.profiles as profile, index (profile.id)}
|
||||
<div
|
||||
class="flex flex-row gap-2 items-center py-3"
|
||||
transition:fly={{ duration: 500, y: -12, easing: expoOut }}
|
||||
>
|
||||
<div class="flex flex-col h-full gap-4">
|
||||
<Header pageHeader>
|
||||
{$t('routes.accounts')}
|
||||
{#snippet extended()}
|
||||
<div class="flex">
|
||||
<div class="flex gap-2 mr-auto">
|
||||
<Button
|
||||
title={profile.id == currentProfile?.data.id ? 'Switch' : 'Current'}
|
||||
onclick={async () => {
|
||||
if (profile.id != currentProfile?.data.id) {
|
||||
switching = profile.id
|
||||
await setUserID(profile.id)
|
||||
switching = -69
|
||||
}
|
||||
}}
|
||||
size="square-md"
|
||||
color={profile.id == currentProfile?.data.id ? 'primary' : 'ghost'}
|
||||
loading={switching == profile.id}
|
||||
disabled={switching == profile.id}
|
||||
href="/accounts/login"
|
||||
rounding="pill"
|
||||
class="px-4"
|
||||
color="primary"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
{#if profile.id == currentProfile?.data.id}
|
||||
<Icon src={Check} mini size="16" />
|
||||
{:else}
|
||||
<Icon src={ArrowsRightLeft} size="16" mini />
|
||||
{/if}
|
||||
<Icon src={ArrowLeftOnRectangle} size="16" mini />
|
||||
{/snippet}
|
||||
{$t('account.login')}
|
||||
</Button>
|
||||
<div class="flex items-center gap-2">
|
||||
<ProfileAvatar
|
||||
{profile}
|
||||
{index}
|
||||
selected={currentProfile?.data.id == profile.id}
|
||||
size={24}
|
||||
/>
|
||||
<div class="flex flex-col">
|
||||
<span class="font-medium">{profile.username}</span>
|
||||
<span class="text-sm text-slate-600 dark:text-zinc-400">
|
||||
{profile.instance}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-auto"></div>
|
||||
<Menu placement="bottom-end">
|
||||
{#snippet target()}
|
||||
<Button size="square-md">
|
||||
{#snippet prefix()}
|
||||
<Icon src={EllipsisHorizontal} mini size="16" />
|
||||
{/snippet}
|
||||
</Button>
|
||||
{/snippet}
|
||||
<div class="px-4 py-2 flex items-center gap-2">
|
||||
<Button
|
||||
size="square-md"
|
||||
color="secondary"
|
||||
title={$t('account.moveUp')}
|
||||
onclick={() => moveProfile(profile.id, true)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ChevronUp} size="16" mini />
|
||||
{/snippet}
|
||||
</Button>
|
||||
<Button
|
||||
size="square-md"
|
||||
color="secondary"
|
||||
title={$t('account.moveDown')}
|
||||
onclick={() => moveProfile(profile.id, false)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ChevronDown} size="16" mini />
|
||||
{/snippet}
|
||||
</Button>
|
||||
</div>
|
||||
{#if settings.debugInfo}
|
||||
<MenuButton
|
||||
onclick={() => {
|
||||
debugProfile = profile
|
||||
debugging = !debugging
|
||||
}}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={BugAnt} size="16" mini />
|
||||
{/snippet}
|
||||
{$t('common.debug')}
|
||||
</MenuButton>
|
||||
{/if}
|
||||
{#if !LINKED_INSTANCE_URL || profile.user}
|
||||
<MenuButton
|
||||
onclick={() => {
|
||||
removing.account = profile
|
||||
removing.shown = !removing.shown
|
||||
}}
|
||||
color="danger-subtle"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ArrowRightOnRectangle} size="16" mini />
|
||||
{/snippet}
|
||||
{$t('account.logout')}
|
||||
</MenuButton>
|
||||
{/if}
|
||||
</Menu>
|
||||
{#if !LINKED_INSTANCE_URL}
|
||||
<Button href="/accounts/login/guest" rounding="pill">
|
||||
{#snippet prefix()}
|
||||
<Icon src={Plus} size="16" micro />
|
||||
{/snippet}
|
||||
{$t('account.addGuest')}
|
||||
</Button>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
{/snippet}
|
||||
</Header>
|
||||
<div>
|
||||
{#each profileData.profiles as profile, index (profile.id)}
|
||||
<div
|
||||
class="flex flex-row gap-2 items-center py-3"
|
||||
transition:fly={{ duration: 500, y: -12, easing: expoOut }}
|
||||
>
|
||||
<Button
|
||||
title={profile.id == currentProfile?.data.id ? 'Switch' : 'Current'}
|
||||
onclick={async () => {
|
||||
if (profile.id != currentProfile?.data.id) {
|
||||
switching = profile.id
|
||||
await setUserID(profile.id)
|
||||
switching = -69
|
||||
}
|
||||
}}
|
||||
size="square-md"
|
||||
color={profile.id == currentProfile?.data.id ? 'primary' : 'ghost'}
|
||||
loading={switching == profile.id}
|
||||
disabled={switching == profile.id}
|
||||
rounding="pill"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
{#if profile.id == currentProfile?.data.id}
|
||||
<Icon src={Check} mini size="16" />
|
||||
{:else}
|
||||
<Icon src={ArrowsRightLeft} size="16" mini />
|
||||
{/if}
|
||||
{/snippet}
|
||||
</Button>
|
||||
<div class="flex items-center gap-2">
|
||||
<ProfileAvatar
|
||||
{profile}
|
||||
{index}
|
||||
selected={currentProfile?.data.id == profile.id}
|
||||
size={24}
|
||||
/>
|
||||
<div class="flex flex-col">
|
||||
<span class="font-medium">{profile.username}</span>
|
||||
<span class="text-sm text-slate-600 dark:text-zinc-400">
|
||||
{profile.instance}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-auto"></div>
|
||||
<Menu placement="bottom-end">
|
||||
{#snippet target()}
|
||||
<Button size="square-md">
|
||||
{#snippet prefix()}
|
||||
<Icon src={EllipsisHorizontal} mini size="16" />
|
||||
{/snippet}
|
||||
</Button>
|
||||
{/snippet}
|
||||
<div class="px-4 py-2 flex items-center gap-2">
|
||||
<Button
|
||||
size="square-md"
|
||||
color="secondary"
|
||||
title={$t('account.moveUp')}
|
||||
onclick={() => moveProfile(profile.id, true)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ChevronUp} size="16" mini />
|
||||
{/snippet}
|
||||
</Button>
|
||||
<Button
|
||||
size="square-md"
|
||||
color="secondary"
|
||||
title={$t('account.moveDown')}
|
||||
onclick={() => moveProfile(profile.id, false)}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ChevronDown} size="16" mini />
|
||||
{/snippet}
|
||||
</Button>
|
||||
</div>
|
||||
{#if settings.debugInfo}
|
||||
<MenuButton
|
||||
onclick={() => {
|
||||
debugProfile = profile
|
||||
debugging = !debugging
|
||||
}}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={BugAnt} size="16" mini />
|
||||
{/snippet}
|
||||
{$t('common.debug')}
|
||||
</MenuButton>
|
||||
{/if}
|
||||
{#if !LINKED_INSTANCE_URL || profile.user}
|
||||
<MenuButton
|
||||
onclick={() => {
|
||||
removing.account = profile
|
||||
removing.shown = !removing.shown
|
||||
}}
|
||||
color="danger-subtle"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ArrowRightOnRectangle} size="16" mini />
|
||||
{/snippet}
|
||||
{$t('account.logout')}
|
||||
</MenuButton>
|
||||
{/if}
|
||||
</Menu>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -116,12 +116,13 @@ items-center px-2 w-max top-6 lg:top-22"
|
||||
<Header pageHeader class="lg:flex-row justify-between flex-col">
|
||||
{$t('routes.inbox.title')}
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="flex items-center gap-2 tracking-normal">
|
||||
<Button
|
||||
onclick={() => goto(page.url, { invalidateAll: true })}
|
||||
size="square-lg"
|
||||
rounding="xl"
|
||||
title={$t('common.refresh')}
|
||||
size="custom"
|
||||
class="rounded-2xl h-9 aspect-square"
|
||||
rounding="none"
|
||||
aria-label={$t('common.refresh')}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={ArrowPath} size="16" mini />
|
||||
@@ -130,9 +131,9 @@ items-center px-2 w-max top-6 lg:top-22"
|
||||
<Button
|
||||
onclick={markAllAsRead}
|
||||
loading={markingAsRead}
|
||||
disabled={markingAsRead}
|
||||
size="lg"
|
||||
class="h-10"
|
||||
disabled={markingAsRead || data.inbox.value.length == 0}
|
||||
rounding="pill"
|
||||
color="primary"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={Check} width={16} mini />
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
{#snippet startChat()}
|
||||
<Button
|
||||
color="primary"
|
||||
size="lg"
|
||||
rounding="pill"
|
||||
onclick={() => (searchModal.open = !searchModal.open)}
|
||||
>
|
||||
<Icon src={ChatBubbleOvalLeftEllipsis} size="18" mini />
|
||||
|
||||
@@ -91,10 +91,11 @@
|
||||
</Select>
|
||||
<Button
|
||||
loading={batch.progress >= 0}
|
||||
disabled={batch.progress >= 0}
|
||||
disabled={batch.progress >= 0 || data.items.value?.length == 0}
|
||||
onclick={markAllAsResolved}
|
||||
class="h-max ml-auto"
|
||||
rounding="xl"
|
||||
rounding="pill"
|
||||
color="primary"
|
||||
>
|
||||
<Icon src={Check} size="16" mini />
|
||||
{$t('routes.moderation.markAll')}
|
||||
|
||||
Reference in new issue
Block a user