misc: redesign placeholder

This commit is contained in:
Xylight committed 2024-08-03 19:05:06 -07:00
1 parent 8216901429
commit 319c896e55
3 files changed
+39 -23

No files matched your search

+19 -23
View File
@@ -5,34 +5,30 @@
export let title: string
export let description: string | undefined = undefined
export let center: boolean = true
export let center: boolean = false
</script>
<div
class="text-slate-700 dark:text-zinc-300 flex flex-col {center
? 'justify-center items-center'
: 'justify-start items-start'} gap-2 {$$props.class}"
class="text-slate-700 dark:text-zinc-300 flex flex-col w-max mx-auto items-center gap-4 {$$props.class}"
>
{#if icon}
<div
class="border border-slate-200 dark:border-zinc-700 dark:bg-zinc-800 p-3 rounded-full"
>
<Icon src={icon} size="28" />
</div>
{/if}
<div
class="flex flex-col gap-1 {center
? 'text-center'
: 'text-left'} {$$props.class}"
>
<h1 class="text-slate-900 dark:text-zinc-100 text-lg font-medium">
{title}
</h1>
{#if description}
<p class="text-sm {center ? 'text-center' : 'text-left'} font-normal">
{description}
</p>
<div class="flex flex-row gap-4 items-center max-w-sm">
{#if icon}
<div
class="border border-slate-200 dark:border-zinc-800 dark:bg-zinc-900 p-3 rounded-full"
>
<Icon src={icon} size="28" />
</div>
{/if}
<div class={$$props.class}>
<h1 class="text-slate-900 dark:text-zinc-100 text-lg font-medium">
{title}
</h1>
{#if description}
<p class="text-sm {center ? 'text-center' : 'text-left'} font-normal">
{description}
</p>
{/if}
</div>
</div>
<slot />
</div>
+4
View File
@@ -236,6 +236,10 @@
"allComments": "All Comments",
"part": "You're viewing part of a thread.",
"context": "Show Context"
},
"emptyComments": {
"title": "No comments",
"description": "Start the conversation!"
}
},
"inbox": {
@@ -19,6 +19,7 @@
InformationCircle,
Home,
PlusCircle,
ChatBubbleLeftRight,
} from 'svelte-hero-icons'
import PostLink from '$lib/components/lemmy/post/link/PostLink.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
@@ -53,6 +54,7 @@
import { createWindowVirtualizer } from '@tanstack/svelte-virtual'
import { resumables } from '$lib/lemmy/item.js'
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte'
export let data
@@ -423,6 +425,20 @@
)}
isParent={true}
/>
{#if comments.comments.length == 0}
<Placeholder
icon={ChatBubbleLeftRight}
title={$t('routes.post.emptyComments.title')}
description={$t('routes.post.emptyComments.description')}
>
{#if $profile.jwt}
<Button color="primary" on:click={() => (commenting = true)}>
<Icon src={PlusCircle} size="16" micro />
{$t('routes.post.addComment')}
</Button>
{/if}
</Placeholder>
{/if}
{/await}
{#if post.post_view.counts.comments > 5}
<EndPlaceholder>