design: improve posts
This commit is contained in:
10 files changed
+67
-28
No files matched your search
@@ -85,7 +85,7 @@
|
||||
<!--svelte-ignore a11y_no_static_element_interactions -->
|
||||
<!--svelte-ignore a11y_click_events_have_key_events-->
|
||||
<div
|
||||
class="aspect-square w-max m-1 grid place-items-center text-slate-600 dark:text-zinc-400"
|
||||
class="aspect-square w-max m-1 grid place-items-center"
|
||||
onclick={e => e.stopPropagation()}
|
||||
>
|
||||
{#if !post.post.local}
|
||||
@@ -98,7 +98,12 @@
|
||||
class="w-full h-full"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={EllipsisHorizontal} size="16" micro />
|
||||
<Icon
|
||||
src={EllipsisHorizontal}
|
||||
size="16"
|
||||
micro
|
||||
class="text-slate-600 dark:text-zinc-400"
|
||||
/>
|
||||
{/snippet}
|
||||
</Button>
|
||||
{/snippet}
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -281,8 +281,8 @@
|
||||
"createPost": "Create Post",
|
||||
"createCommunity": "Create Community",
|
||||
"post": {
|
||||
"crosspostCount": "crossposts",
|
||||
"commentCount": "comments",
|
||||
"crosspostCount": "Crossposts",
|
||||
"commentCount": "Comments",
|
||||
"addComment": "Add a comment",
|
||||
"scrollToTop": "Scroll to top",
|
||||
"instanceWarning": "This post was requested from a different server than your account's. Many actions won't work.",
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
import Label from '../forms/Label.svelte'
|
||||
import { generateID } from '../forms/helper.js'
|
||||
|
||||
const borderClass = `border border-slate-200 border-b-slate-300 dark:border-zinc-800`
|
||||
const borderClass = `border border-slate-200 border-b-slate-300 dark:border-t-zinc-800 dark:border-zinc-900`
|
||||
|
||||
let {
|
||||
label = undefined,
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
}: Props<T> = $props()
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col gap-1 {clazz} {baseClass}">
|
||||
<div class={['flex flex-col gap-1', clazz, baseClass]}>
|
||||
{#if customLabel || label}
|
||||
<Label for={id} text={label}>
|
||||
{@render customLabel?.()}
|
||||
@@ -144,7 +144,7 @@
|
||||
disabled={option.disabled}
|
||||
color="none"
|
||||
class={[
|
||||
'min-h-0! py-[5px]! hover:bg-slate-100 dark:hover:bg-zinc-800',
|
||||
'min-h-0! py-1 hover:bg-slate-100 dark:hover:bg-zinc-800',
|
||||
option.value == value &&
|
||||
'bg-slate-100 dark:bg-zinc-800 text-primary-900 dark:text-primary-100 font-medium',
|
||||
option.disabled &&
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
class="w-full max-w-sm origin-top-left max-h-128 overflow-auto list-none shadow-lg rounded-2xl"
|
||||
>
|
||||
<div
|
||||
class="flex flex-col px-0 list-none bg-white/80 dark:bg-zinc-900/90 gap-px rounded-2xl
|
||||
class="flex flex-col px-0 list-none bg-white/80 dark:bg-zinc-900/90 rounded-2xl
|
||||
border border-slate-300 dark:border-zinc-800 border-opacity-50"
|
||||
>
|
||||
{@render children?.(open)}
|
||||
|
||||
Reference in new issue
Block a user