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