design: improve posts
This commit is contained in:
10 files changed
+67
-28
No files matched your search
@@ -1,20 +1,52 @@
|
||||
<script lang="ts">
|
||||
import type { ClassValue } from 'svelte/elements'
|
||||
|
||||
const sizes = {
|
||||
sm: 'text-sm',
|
||||
md: 'text-base',
|
||||
lg: 'text-lg',
|
||||
}
|
||||
|
||||
const colors = {
|
||||
subtle: 'text-slate-600 dark:text-zinc-400',
|
||||
none: '',
|
||||
}
|
||||
|
||||
interface Props {
|
||||
class?: string
|
||||
class?: ClassValue
|
||||
size?: keyof typeof sizes
|
||||
color?: keyof typeof colors
|
||||
border?: boolean
|
||||
children?: import('svelte').Snippet
|
||||
action?: import('svelte').Snippet
|
||||
}
|
||||
|
||||
let { class: clazz = '', children, action }: Props = $props()
|
||||
let {
|
||||
class: clazz = '',
|
||||
children,
|
||||
action,
|
||||
border = true,
|
||||
size = 'sm',
|
||||
color = 'subtle',
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="flex flex-row items-center
|
||||
text-sm text-slate-600 dark:text-zinc-400 gap-2 flex-wrap {clazz}"
|
||||
class={[
|
||||
'flex flex-row items-center gap-2 flex-wrap',
|
||||
sizes[size],
|
||||
colors[color],
|
||||
clazz,
|
||||
]}
|
||||
>
|
||||
<span class="font-medium text-left">
|
||||
{@render children?.()}
|
||||
</span>
|
||||
<div class="flex-1"></div>
|
||||
<hr
|
||||
class={[
|
||||
'flex-1 border-slate-200 dark:border-zinc-800',
|
||||
!border && 'opacity-0',
|
||||
]}
|
||||
/>
|
||||
{@render action?.()}
|
||||
</div>
|
||||
@@ -97,7 +97,7 @@
|
||||
>
|
||||
{#snippet title()}
|
||||
<span class="px-2 py-1 w-full">
|
||||
<EndPlaceholder>
|
||||
<EndPlaceholder border={false}>
|
||||
{$t('account.accounts')}
|
||||
{#snippet action()}
|
||||
<span class="dark:text-white text-black">
|
||||
@@ -134,7 +134,7 @@
|
||||
>
|
||||
{#snippet title()}
|
||||
<span class="px-2 py-1 w-full">
|
||||
<EndPlaceholder>
|
||||
<EndPlaceholder border={false}>
|
||||
{$t('routes.profile.moderates')}
|
||||
{#snippet action()}
|
||||
<span class="dark:text-white text-black">
|
||||
@@ -185,7 +185,7 @@
|
||||
>
|
||||
{#snippet title()}
|
||||
<span class="px-2 py-1 w-full">
|
||||
<EndPlaceholder>
|
||||
<EndPlaceholder border={false}>
|
||||
{$t('profile.subscribed')}
|
||||
{#snippet action()}
|
||||
<span class="dark:text-white text-black">
|
||||
|
||||
Reference in new issue
Block a user