design: make placeholders more consistent
This commit is contained in:
1 parent
060040c06e
commit
c3d2ae112f
6 files changed
+45
-55
No files matched your search
@@ -1,12 +1,18 @@
|
||||
<div
|
||||
class="text-slate-600 dark:text-zinc-400 flex flex-col justify-center items-center gap-1"
|
||||
>
|
||||
<slot name="icon" />
|
||||
{#if $$slots.icon}
|
||||
<div
|
||||
class="bg-slate-100 border border-slate-200 dark:border-zinc-700 dark:bg-zinc-800 p-3 rounded-full"
|
||||
>
|
||||
<slot name="icon" />
|
||||
</div>
|
||||
{/if}
|
||||
{#if $$slots.title}
|
||||
<h1 class="font-bold text-3xl"><slot name="title" /></h1>
|
||||
<h1 class="font-bold text-lg"><slot name="title" /></h1>
|
||||
{/if}
|
||||
{#if $$slots.description}
|
||||
<p class="text-lg text-center"><slot name="description" /></p>
|
||||
<p class="text-sm text-center"><slot name="description" /></p>
|
||||
{/if}
|
||||
<slot name="action" />
|
||||
</div>
|
||||
@@ -39,8 +39,7 @@
|
||||
{/if}
|
||||
{:else}
|
||||
<Placeholder>
|
||||
<Icon src={ClipboardDocumentCheck} size="48" slot="icon" />
|
||||
<span slot="title">No applications</span>
|
||||
<span slot="description">You're all caught up for now.</span>
|
||||
<Icon src={ClipboardDocumentCheck} size="28" slot="icon" />
|
||||
<span slot="title">No new applications</span>
|
||||
</Placeholder>
|
||||
{/if}
|
||||
@@ -98,13 +98,13 @@
|
||||
|
||||
<Button size="lg" submit>
|
||||
<Icon src={Plus} size="16" mini slot="icon" />
|
||||
Add one
|
||||
Add
|
||||
</Button>
|
||||
</form>
|
||||
{:else}
|
||||
<div class="my-auto">
|
||||
<Placeholder>
|
||||
<Icon src={QuestionMarkCircle} solid size="32" slot="icon" />
|
||||
<Icon src={Plus} solid size="28" slot="icon" />
|
||||
<span slot="title">No taglines</span>
|
||||
<div slot="action" class="mt-4 max-w-xl w-full flex flex-col gap-2">
|
||||
<form
|
||||
@@ -125,7 +125,7 @@
|
||||
|
||||
<Button size="lg" submit>
|
||||
<Icon src={Plus} size="16" mini slot="icon" />
|
||||
Add one
|
||||
Add
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
<script lang="ts">
|
||||
import InboxItem from './InboxItem.svelte'
|
||||
import Button from '$lib/components/input/Button.svelte'
|
||||
import { Check, EnvelopeOpen, Icon } from 'svelte-hero-icons'
|
||||
import {
|
||||
ArchiveBox,
|
||||
Check,
|
||||
EnvelopeOpen,
|
||||
Icon,
|
||||
Inbox,
|
||||
} from 'svelte-hero-icons'
|
||||
import { getClient } from '$lib/lemmy.js'
|
||||
import { goto } from '$app/navigation'
|
||||
import { page } from '$app/stores'
|
||||
@@ -10,6 +16,7 @@
|
||||
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
||||
import { profile } from '$lib/auth.js'
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import { fly } from 'svelte/transition'
|
||||
|
||||
export let data
|
||||
|
||||
@@ -82,18 +89,19 @@
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-col gap-4 list-none my-4">
|
||||
<div class="flex flex-col gap-4 list-none my-4 flex-1">
|
||||
{#if !data.data || (data.data?.length ?? 0) == 0}
|
||||
<div>
|
||||
<div class="mt-auto">
|
||||
<Placeholder>
|
||||
<Icon src={EnvelopeOpen} size="48" slot="icon" />
|
||||
<span slot="title">Inbox empty</span>
|
||||
<span slot="description">You're all caught up!</span>
|
||||
<Icon src={Inbox} size="28" slot="icon" />
|
||||
<span slot="title">No new notifications</span>
|
||||
</Placeholder>
|
||||
</div>
|
||||
{:else}
|
||||
{#each data.data as item}
|
||||
<InboxItem {item} read={isRead(item)} />
|
||||
<div in:fly={{ duration: 500, y: -6, opacity: 0 }}>
|
||||
<InboxItem {item} read={isRead(item)} />
|
||||
</div>
|
||||
{/each}
|
||||
<Pageination
|
||||
page={data.page}
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
||||
import { page } from '$app/stores'
|
||||
import { goto } from '$app/navigation'
|
||||
import { EnvelopeOpen, Icon } from 'svelte-hero-icons'
|
||||
import { EnvelopeOpen, Icon, Inbox } from 'svelte-hero-icons'
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
|
||||
export let data
|
||||
</script>
|
||||
|
||||
<div class="mb-4 flex flex-col gap-4">
|
||||
<h1 class="font-black text-3xl">Reports</h1>
|
||||
<h1 class="font-bold text-3xl">Reports</h1>
|
||||
<MultiSelect
|
||||
selected={data.type}
|
||||
options={['all', 'unread']}
|
||||
@@ -48,13 +49,8 @@
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
<div
|
||||
class="text-slate-600 dark:text-zinc-400 flex flex-col justify-center items-center py-8 gap-2"
|
||||
>
|
||||
<Icon src={EnvelopeOpen} size="48" />
|
||||
<div>
|
||||
<h1 class="font-bold text-3xl">No reports</h1>
|
||||
<p class="mt-2 text-center">You're all caught up!</p>
|
||||
</div>
|
||||
</div>
|
||||
<Placeholder>
|
||||
<Icon src={Inbox} size="28" slot="icon" />
|
||||
<span slot="title">No new reports</span>
|
||||
</Placeholder>
|
||||
{/if}
|
||||
@@ -10,6 +10,7 @@
|
||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||
import UserItem from '$lib/components/lemmy/user/UserItem.svelte'
|
||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
|
||||
import {
|
||||
isCommentView,
|
||||
@@ -46,33 +47,16 @@
|
||||
<MultiSelect
|
||||
options={['All', 'Posts', 'Comments', 'Communities', 'Users']}
|
||||
selected={$page.url.searchParams.get('type') ?? 'All'}
|
||||
on:select={(e) => {
|
||||
const url = $page.url
|
||||
url.searchParams.set('type', e.detail)
|
||||
url.searchParams.delete('page')
|
||||
goto(url, {
|
||||
invalidateAll: true,
|
||||
})
|
||||
}}
|
||||
on:select={(e) => searchParam($page.url, 'type', e.detail, 'page')}
|
||||
/>
|
||||
<div class="flex flex-row gap-2 items-center">
|
||||
<TextInput
|
||||
bind:value={query}
|
||||
placeholder="Search for something..."
|
||||
on:change={() => {
|
||||
$page.url.searchParams.set('q', query)
|
||||
goto($page.url.toString(), {
|
||||
invalidateAll: true,
|
||||
})
|
||||
}}
|
||||
placeholder="!community@instance.com"
|
||||
on:change={() => searchParam($page.url, 'q', query, 'page')}
|
||||
/>
|
||||
<Button
|
||||
on:click={() => {
|
||||
$page.url.searchParams.set('q', query)
|
||||
goto($page.url.toString(), {
|
||||
invalidateAll: true,
|
||||
})
|
||||
}}
|
||||
on:click={() => searchParam($page.url, 'q', query, 'page')}
|
||||
size="lg"
|
||||
class="h-full"
|
||||
>
|
||||
@@ -81,13 +65,10 @@
|
||||
</div>
|
||||
</div>
|
||||
{#if !data.results}
|
||||
<div
|
||||
class="text-slate-600 dark:text-zinc-400 flex flex-col justify-center items-center py-8"
|
||||
>
|
||||
<Icon src={MagnifyingGlass} size="48" solid />
|
||||
<h1 class="font-bold text-3xl">No results</h1>
|
||||
<p class="mt-2 text-center">Search for something!</p>
|
||||
</div>
|
||||
<Placeholder>
|
||||
<Icon src={MagnifyingGlass} size="28" solid slot="icon" />
|
||||
<span slot="title">No results</span>
|
||||
</Placeholder>
|
||||
{:else}
|
||||
{#await data.streamed.object}
|
||||
<div
|
||||
|
||||
Reference in new issue
Block a user