misc: redesign placeholder
This commit is contained in:
1 parent
8216901429
commit
319c896e55
3 files changed
+39
-23
No files matched your search
@@ -5,34 +5,30 @@
|
|||||||
|
|
||||||
export let title: string
|
export let title: string
|
||||||
export let description: string | undefined = undefined
|
export let description: string | undefined = undefined
|
||||||
export let center: boolean = true
|
export let center: boolean = false
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="text-slate-700 dark:text-zinc-300 flex flex-col {center
|
class="text-slate-700 dark:text-zinc-300 flex flex-col w-max mx-auto items-center gap-4 {$$props.class}"
|
||||||
? 'justify-center items-center'
|
|
||||||
: 'justify-start items-start'} gap-2 {$$props.class}"
|
|
||||||
>
|
>
|
||||||
{#if icon}
|
<div class="flex flex-row gap-4 items-center max-w-sm">
|
||||||
<div
|
{#if icon}
|
||||||
class="border border-slate-200 dark:border-zinc-700 dark:bg-zinc-800 p-3 rounded-full"
|
<div
|
||||||
>
|
class="border border-slate-200 dark:border-zinc-800 dark:bg-zinc-900 p-3 rounded-full"
|
||||||
<Icon src={icon} size="28" />
|
>
|
||||||
</div>
|
<Icon src={icon} size="28" />
|
||||||
{/if}
|
</div>
|
||||||
<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>
|
|
||||||
{/if}
|
{/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>
|
</div>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
@@ -236,6 +236,10 @@
|
|||||||
"allComments": "All Comments",
|
"allComments": "All Comments",
|
||||||
"part": "You're viewing part of a thread.",
|
"part": "You're viewing part of a thread.",
|
||||||
"context": "Show Context"
|
"context": "Show Context"
|
||||||
|
},
|
||||||
|
"emptyComments": {
|
||||||
|
"title": "No comments",
|
||||||
|
"description": "Start the conversation!"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"inbox": {
|
"inbox": {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
InformationCircle,
|
InformationCircle,
|
||||||
Home,
|
Home,
|
||||||
PlusCircle,
|
PlusCircle,
|
||||||
|
ChatBubbleLeftRight,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import PostLink from '$lib/components/lemmy/post/link/PostLink.svelte'
|
import PostLink from '$lib/components/lemmy/post/link/PostLink.svelte'
|
||||||
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||||
@@ -53,6 +54,7 @@
|
|||||||
import { createWindowVirtualizer } from '@tanstack/svelte-virtual'
|
import { createWindowVirtualizer } from '@tanstack/svelte-virtual'
|
||||||
import { resumables } from '$lib/lemmy/item.js'
|
import { resumables } from '$lib/lemmy/item.js'
|
||||||
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
|
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
|
||||||
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
@@ -423,6 +425,20 @@
|
|||||||
)}
|
)}
|
||||||
isParent={true}
|
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}
|
{/await}
|
||||||
{#if post.post_view.counts.comments > 5}
|
{#if post.post_view.counts.comments > 5}
|
||||||
<EndPlaceholder>
|
<EndPlaceholder>
|
||||||
|
|||||||
Reference in new issue
Block a user