cleanup: remove editable list
This commit is contained in:
1 parent
53cb0e4f20
commit
95e2dec139
4 files changed
+93
-91
No files matched your search
@@ -9,6 +9,6 @@
|
|||||||
let { small = false, class: clazz = '', children, ...rest }: Props = $props()
|
let { small = false, class: clazz = '', children, ...rest }: Props = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<span {...rest} class="{!small ? 'text-lg' : 'text-xs'} font-semibold {clazz}">
|
<span {...rest} class="{!small ? 'text-lg' : 'text-xs'} font-medium {clazz}">
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</span>
|
</span>
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
saving = false
|
saving = false
|
||||||
}
|
}
|
||||||
|
|
||||||
let csv: FileList | null = $state()
|
let csv = $state<FileList | null>()
|
||||||
|
|
||||||
async function parseCsv(files: FileList) {
|
async function parseCsv(files: FileList) {
|
||||||
if (!(files.length > 0)) return
|
if (!(files.length > 0)) return
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
<script>
|
|
||||||
/**
|
|
||||||
* @typedef {Object} Props
|
|
||||||
* @property {import('svelte').Snippet} [children]
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @type {Props} */
|
|
||||||
let { children } = $props()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="flex flex-col divide-y divide-slate-200 dark:divide-zinc-800 [&>*]:py-3 first:p-0 last:py-0"
|
|
||||||
>
|
|
||||||
{@render children?.()}
|
|
||||||
</div>
|
|
||||||
@@ -20,6 +20,8 @@
|
|||||||
import Switch from '$lib/components/input/Switch.svelte'
|
import Switch from '$lib/components/input/Switch.svelte'
|
||||||
import UserAutocomplete from '$lib/components/lemmy/user/UserAutocomplete.svelte'
|
import UserAutocomplete from '$lib/components/lemmy/user/UserAutocomplete.svelte'
|
||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
|
import Material from 'mono-svelte/materials/Material.svelte'
|
||||||
|
import Header from '$lib/components/ui/layout/pages/Header.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,87 +87,102 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<Header pageHeader>
|
||||||
|
{$t('routes.profile.blocks.title')}
|
||||||
|
</Header>
|
||||||
|
|
||||||
{#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 || data.person_blocks?.length > 0 || (data.my_user?.instance_blocks?.length ?? 0) > 0}
|
||||||
{#if data.my_user?.instance_blocks && (data.my_user?.instance_blocks?.length ?? 0) > 0}
|
|
||||||
<div>
|
|
||||||
<SectionTitle>{$t('content.instances')}</SectionTitle>
|
|
||||||
<ul>
|
|
||||||
{#each data.my_user?.instance_blocks as block (block.instance.id)}
|
|
||||||
<div
|
|
||||||
class="flex flex-row gap-2 items-center py-4"
|
|
||||||
animate:flip={{ duration: 250 }}
|
|
||||||
out:slide|local={{ axis: 'y' }}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
title="Unblock"
|
|
||||||
size="square-md"
|
|
||||||
rounding="pill"
|
|
||||||
onclick={() => unblockInstances(block)}
|
|
||||||
>
|
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon src={XMark} mini size="16" />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
<Entity
|
|
||||||
icon={block.site?.icon}
|
|
||||||
name={block.site?.name ?? block.instance.domain}
|
|
||||||
label={block.instance.domain}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{/each}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{#if data.community_blocks?.length > 0}
|
{#if data.community_blocks?.length > 0}
|
||||||
<div>
|
<div class="space-y-1">
|
||||||
<SectionTitle>{$t('content.communities')}</SectionTitle>
|
<SectionTitle>{$t('content.communities')}</SectionTitle>
|
||||||
<ul>
|
<Material
|
||||||
{#each data.community_blocks as block (block.community.id)}
|
color="uniform"
|
||||||
<div
|
class="bg-white dark:bg-zinc-950 max-h-96 overflow-auto"
|
||||||
class="flex flex-row gap-2 items-center py-2"
|
rounding="xl"
|
||||||
animate:flip={{ duration: 250 }}
|
>
|
||||||
out:slide|global={{ axis: 'y', easing: expoOut, duration: 300 }}
|
<ul class="divide-y divide-slate-200 dark:divide-zinc-900">
|
||||||
>
|
{#each data.community_blocks as block (block.community.id)}
|
||||||
<Button
|
<div class="flex flex-row gap-2 items-center py-1 -mx-4 px-4">
|
||||||
title="Unblock"
|
<Button
|
||||||
size="square-md"
|
title="Unblock"
|
||||||
rounding="pill"
|
size="square-md"
|
||||||
onclick={() => unblockCommunity(block)}
|
rounding="pill"
|
||||||
>
|
color="danger"
|
||||||
{#snippet prefix()}
|
onclick={() => unblockCommunity(block)}
|
||||||
<Icon src={XMark} mini size="16" />
|
>
|
||||||
{/snippet}
|
{#snippet prefix()}
|
||||||
</Button>
|
<Icon src={XMark} micro size="16" />
|
||||||
<CommunityLink community={block.community} avatar />
|
{/snippet}
|
||||||
</div>
|
</Button>
|
||||||
{/each}
|
<CommunityLink community={block.community} avatar />
|
||||||
</ul>
|
</div>
|
||||||
|
{/each}
|
||||||
|
</ul>
|
||||||
|
</Material>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{#if data.person_blocks?.length > 0}
|
{#if data.person_blocks?.length > 0}
|
||||||
<div>
|
<div class="space-y-1">
|
||||||
<SectionTitle>{$t('content.users')}</SectionTitle>
|
<SectionTitle>{$t('content.users')}</SectionTitle>
|
||||||
<ul>
|
<Material
|
||||||
{#each data.person_blocks as block (block.target.id)}
|
color="uniform"
|
||||||
<div
|
class="bg-white dark:bg-zinc-950 max-h-96 overflow-auto"
|
||||||
class="flex flex-row gap-2 items-center py-2"
|
rounding="xl"
|
||||||
animate:flip={{ duration: 250 }}
|
>
|
||||||
out:slide|global={{ axis: 'y', easing: expoOut, duration: 300 }}
|
<ul class="divide-y divide-slate-200 dark:divide-zinc-900">
|
||||||
>
|
{#each data.person_blocks as block (block.target.id)}
|
||||||
<Button
|
<div class="flex flex-row gap-2 items-center py-1 -mx-4 px-4">
|
||||||
title="Unblock"
|
<Button
|
||||||
size="square-md"
|
title="Unblock"
|
||||||
rounding="pill"
|
size="square-md"
|
||||||
onclick={() => unblockUser(block)}
|
rounding="pill"
|
||||||
>
|
color="danger"
|
||||||
{#snippet prefix()}
|
onclick={() => unblockUser(block)}
|
||||||
<Icon src={XMark} mini size="16" />
|
>
|
||||||
{/snippet}
|
{#snippet prefix()}
|
||||||
</Button>
|
<Icon src={XMark} micro size="16" />
|
||||||
<UserLink user={block.target} avatar badges />
|
{/snippet}
|
||||||
</div>
|
</Button>
|
||||||
{/each}
|
<UserLink user={block.target} avatar badges />
|
||||||
</ul>
|
</div>
|
||||||
|
{/each}
|
||||||
|
</ul>
|
||||||
|
</Material>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{#if data.my_user?.instance_blocks && (data.my_user?.instance_blocks?.length ?? 0) > 0}
|
||||||
|
<div class="space-y-1">
|
||||||
|
<SectionTitle class="text-lg">
|
||||||
|
{$t('content.instances')}
|
||||||
|
</SectionTitle>
|
||||||
|
<Material
|
||||||
|
color="uniform"
|
||||||
|
class="bg-white dark:bg-zinc-950 max-h-96 overflow-auto"
|
||||||
|
rounding="xl"
|
||||||
|
>
|
||||||
|
<ul class="divide-y divide-slate-200 dark:divide-zinc-900">
|
||||||
|
{#each data.my_user?.instance_blocks as block (block.instance.id)}
|
||||||
|
<div class="flex flex-row gap-2 items-center py-1 -mx-4 px-4">
|
||||||
|
<Button
|
||||||
|
title="Unblock"
|
||||||
|
size="square-md"
|
||||||
|
rounding="pill"
|
||||||
|
color="danger"
|
||||||
|
onclick={() => unblockInstances(block)}
|
||||||
|
>
|
||||||
|
{#snippet prefix()}
|
||||||
|
<Icon src={XMark} micro size="16" />
|
||||||
|
{/snippet}
|
||||||
|
</Button>
|
||||||
|
<Entity
|
||||||
|
icon={block.site?.icon}
|
||||||
|
name={block.site?.name ?? block.instance.domain}
|
||||||
|
label={block.instance.domain}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
</ul>
|
||||||
|
</Material>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
Reference in new issue
Block a user