design: redesign blocked page
This commit is contained in:
1 file changed
+55
-50
@@ -17,6 +17,8 @@
|
|||||||
import Material from 'mono-svelte/materials/Material.svelte'
|
import Material from 'mono-svelte/materials/Material.svelte'
|
||||||
import { Check, Icon, XMark } from 'svelte-hero-icons'
|
import { Check, Icon, XMark } from 'svelte-hero-icons'
|
||||||
import type { PageData } from './$types.js'
|
import type { PageData } from './$types.js'
|
||||||
|
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||||
|
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
// sveltekit doesn't feel like making types work right now
|
// sveltekit doesn't feel like making types work right now
|
||||||
@@ -85,101 +87,103 @@
|
|||||||
{$t('routes.profile.blocks.title')}
|
{$t('routes.profile.blocks.title')}
|
||||||
</Header>
|
</Header>
|
||||||
|
|
||||||
{#if data.community_blocks?.length > 0 || data.person_blocks?.length > 0 || (data.my_user?.instance_blocks?.length ?? 0) > 0}
|
<div>
|
||||||
|
{#if data.community_blocks?.length > 0 || data.person_blocks?.length > 0 || (data.my_user?.instance_blocks?.length ?? 0) > 0}
|
||||||
{#if data.community_blocks?.length > 0}
|
{#if data.community_blocks?.length > 0}
|
||||||
<div class="space-y-1">
|
<EndPlaceholder size="md" margin="md">
|
||||||
<SectionTitle>{$t('content.communities')}</SectionTitle>
|
{$t('content.communities')}
|
||||||
<Material
|
</EndPlaceholder>
|
||||||
color="uniform"
|
<div class="max-h-96 overflow-auto rounded-2xl">
|
||||||
class="bg-white dark:bg-zinc-950 max-h-96 overflow-auto"
|
<CommonList
|
||||||
rounding="xl"
|
size="xs"
|
||||||
|
class="px-3 py-2"
|
||||||
|
animate={false}
|
||||||
|
items={data.community_blocks}
|
||||||
>
|
>
|
||||||
<ul class="divide-y divide-slate-200 dark:divide-zinc-900">
|
{#snippet item(block)}
|
||||||
{#each data.community_blocks as block (block.community.id)}
|
<div class="flex flex-row gap-2 items-center">
|
||||||
<div class="flex flex-row gap-2 items-center py-1 -mx-4 px-4">
|
<CommunityLink community={block.community} avatar />
|
||||||
|
<div class="flex-1"></div>
|
||||||
<Button
|
<Button
|
||||||
title="Unblock"
|
title="Unblock"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
color="danger"
|
|
||||||
onclick={() => unblockCommunity(block)}
|
onclick={() => unblockCommunity(block)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={XMark} micro size="16" />
|
<Icon src={XMark} micro size="16" />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
<CommunityLink community={block.community} avatar />
|
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/snippet}
|
||||||
</ul>
|
</CommonList>
|
||||||
</Material>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{#if data.person_blocks?.length > 0}
|
{#if data.person_blocks?.length > 0}
|
||||||
<div class="space-y-1">
|
<EndPlaceholder size="md" margin="md">
|
||||||
<SectionTitle>{$t('content.users')}</SectionTitle>
|
{$t('content.users')}
|
||||||
<Material
|
</EndPlaceholder>
|
||||||
color="uniform"
|
<div class="max-h-96 overflow-auto rounded-2xl">
|
||||||
class="bg-white dark:bg-zinc-950 max-h-96 overflow-auto"
|
<CommonList
|
||||||
rounding="xl"
|
size="xs"
|
||||||
|
class="px-3 py-2"
|
||||||
|
animate={false}
|
||||||
|
items={data.person_blocks}
|
||||||
>
|
>
|
||||||
<ul class="divide-y divide-slate-200 dark:divide-zinc-900">
|
{#snippet item(block)}
|
||||||
{#each data.person_blocks as block (block.target.id)}
|
<div class="flex flex-row gap-2 items-center">
|
||||||
<div class="flex flex-row gap-2 items-center py-1 -mx-4 px-4">
|
<UserLink user={block.target} avatar badges />
|
||||||
|
<div class="flex-1"></div>
|
||||||
<Button
|
<Button
|
||||||
title="Unblock"
|
title="Unblock"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
color="danger"
|
|
||||||
onclick={() => unblockUser(block)}
|
onclick={() => unblockUser(block)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={XMark} micro size="16" />
|
<Icon src={XMark} micro size="16" />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
<UserLink user={block.target} avatar badges />
|
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/snippet}
|
||||||
</ul>
|
</CommonList>
|
||||||
</Material>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{#if data.my_user?.instance_blocks && (data.my_user?.instance_blocks?.length ?? 0) > 0}
|
{#if data.my_user?.instance_blocks && (data.my_user?.instance_blocks?.length ?? 0) > 0}
|
||||||
<div class="space-y-1">
|
<EndPlaceholder size="md" margin="md" class="text-lg">
|
||||||
<SectionTitle class="text-lg">
|
|
||||||
{$t('content.instances')}
|
{$t('content.instances')}
|
||||||
</SectionTitle>
|
</EndPlaceholder>
|
||||||
<Material
|
<div class="max-h-96 overflow-auto rounded-2xl">
|
||||||
color="uniform"
|
<CommonList
|
||||||
class="bg-white dark:bg-zinc-950 max-h-96 overflow-auto"
|
size="xs"
|
||||||
rounding="xl"
|
animate={false}
|
||||||
|
items={data.my_user.instance_blocks}
|
||||||
|
class="px-3 py-2"
|
||||||
>
|
>
|
||||||
<ul class="divide-y divide-slate-200 dark:divide-zinc-900">
|
{#snippet item(block)}
|
||||||
{#each data.my_user?.instance_blocks as block (block.instance.id)}
|
<div class="flex flex-row gap-2 items-center">
|
||||||
<div class="flex flex-row gap-2 items-center py-1 -mx-4 px-4">
|
<Entity
|
||||||
|
icon={block.site?.icon}
|
||||||
|
name={block.site?.name ?? block.instance.domain}
|
||||||
|
label={block.instance.domain}
|
||||||
|
/>
|
||||||
|
<div class="flex-1"></div>
|
||||||
<Button
|
<Button
|
||||||
title="Unblock"
|
title="Unblock"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
color="danger"
|
|
||||||
onclick={() => unblockInstances(block)}
|
onclick={() => unblockInstances(block)}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={XMark} micro size="16" />
|
<Icon src={XMark} micro size="16" />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
<Entity
|
|
||||||
icon={block.site?.icon}
|
|
||||||
name={block.site?.name ?? block.instance.domain}
|
|
||||||
label={block.instance.domain}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/snippet}
|
||||||
</ul>
|
</CommonList>
|
||||||
</Material>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
<div class="h-full w-full grid place-items-center">
|
<div class="h-full w-full grid place-items-center">
|
||||||
<Placeholder
|
<Placeholder
|
||||||
icon={Check}
|
icon={Check}
|
||||||
@@ -187,4 +191,5 @@
|
|||||||
description={$t('routes.profile.blocks.empty.description')}
|
description={$t('routes.profile.blocks.empty.description')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
</div>
|
||||||
Reference in new issue
Block a user