fix: close #186
This commit is contained in:
1 parent
c60c8b8c3a
commit
a6249dba60
1 file changed
+109
-114
+109
-114
@@ -198,136 +198,131 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mx-auto max-w-sm w-full">
|
<StickyCard class="px-0">
|
||||||
<StickyCard>
|
<Avatar
|
||||||
<Avatar
|
width={64}
|
||||||
width={64}
|
url={data.person_view.person.avatar}
|
||||||
url={data.person_view.person.avatar}
|
alt={data.person_view.person.name}
|
||||||
alt={data.person_view.person.name}
|
/>
|
||||||
/>
|
<span class="flex flex-row items-center gap-1 text-sm">
|
||||||
<span class="flex flex-row items-center gap-1 text-sm">
|
<Icon src={Calendar} width={16} height={16} mini />
|
||||||
<Icon src={Calendar} width={16} height={16} mini />
|
<span class="capitalize">
|
||||||
<span class="capitalize">
|
<RelativeDate
|
||||||
<RelativeDate
|
date={publishedToDate(data.person_view.person.published)}
|
||||||
date={publishedToDate(data.person_view.person.published)}
|
/>
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</span>
|
</span>
|
||||||
<div class="text-sm flex flex-row flex-wrap gap-3">
|
</span>
|
||||||
<span class="flex flex-row items-center gap-1">
|
<div class="text-sm flex flex-row flex-wrap gap-3">
|
||||||
<Icon src={PencilSquare} width={16} height={16} mini />
|
<span class="flex flex-row items-center gap-1">
|
||||||
<FormattedNumber number={data.person_view.counts.post_count} />
|
<Icon src={PencilSquare} width={16} height={16} mini />
|
||||||
</span>
|
<FormattedNumber number={data.person_view.counts.post_count} />
|
||||||
<span class="flex flex-row items-center gap-1">
|
</span>
|
||||||
<Icon src={ChatBubbleOvalLeftEllipsis} width={16} height={16} mini />
|
<span class="flex flex-row items-center gap-1">
|
||||||
<FormattedNumber number={data.person_view.counts.comment_count} />
|
<Icon src={ChatBubbleOvalLeftEllipsis} width={16} height={16} mini />
|
||||||
</span>
|
<FormattedNumber number={data.person_view.counts.comment_count} />
|
||||||
</div>
|
</span>
|
||||||
{#if (data.moderates ?? []).length > 0}
|
</div>
|
||||||
<div class="flex flex-col gap-2 max-w-full">
|
{#if (data.moderates ?? []).length > 0}
|
||||||
<span class="font-bold">Moderates</span>
|
<div class="flex flex-col gap-2 max-w-full">
|
||||||
<div
|
<span class="font-bold">Moderates</span>
|
||||||
class="flex items-center -space-x-1 flex-wrap hover:space-x-1 transition-all
|
<div
|
||||||
|
class="flex items-center -space-x-1 flex-wrap hover:space-x-1 transition-all
|
||||||
cursor-pointer"
|
cursor-pointer"
|
||||||
>
|
>
|
||||||
{#each data.moderates as moderator}
|
{#each data.moderates as moderator}
|
||||||
<Popover openOnHover placement="top" class="transition-all">
|
<Popover openOnHover placement="top" class="transition-all">
|
||||||
<a
|
<a
|
||||||
class="block ring rounded-full ring-slate-50 dark:ring-zinc-950 transition-all"
|
class="block ring rounded-full ring-slate-50 dark:ring-zinc-950 transition-all"
|
||||||
href="/c/{moderator.community.name}@{new URL(
|
href="/c/{moderator.community.name}@{new URL(
|
||||||
moderator.community.actor_id
|
moderator.community.actor_id
|
||||||
).hostname}"
|
).hostname}"
|
||||||
slot="target"
|
slot="target"
|
||||||
>
|
>
|
||||||
<Avatar
|
<Avatar
|
||||||
width={28}
|
width={28}
|
||||||
url={moderator.community.icon}
|
url={moderator.community.icon}
|
||||||
alt={moderator.community.title}
|
alt={moderator.community.title}
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
<span class="font-bold">{moderator.community.title}</span>
|
<span class="font-bold">{moderator.community.title}</span>
|
||||||
</Popover>
|
</Popover>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
</div>
|
||||||
{#if $profile?.user && $profile.jwt && data.person_view.person.id != $profile.user.local_user_view.person.id}
|
{/if}
|
||||||
<div class="flex flex-col gap-2">
|
{#if $profile?.user && $profile.jwt && data.person_view.person.id != $profile.user.local_user_view.person.id}
|
||||||
<div class="flex items-center gap-2 w-full">
|
<div class="flex flex-col gap-2">
|
||||||
|
<div class="flex items-center gap-2 w-full">
|
||||||
|
<Button
|
||||||
|
size="lg"
|
||||||
|
color="secondary"
|
||||||
|
on:click={() => (messaging = true)}
|
||||||
|
class="flex-1"
|
||||||
|
>
|
||||||
|
<Icon slot="prefix" solid size="16" src={Envelope} />
|
||||||
|
Message
|
||||||
|
</Button>
|
||||||
|
{#if data.person_view.person.matrix_user_id}
|
||||||
<Button
|
<Button
|
||||||
size="lg"
|
size="lg"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
on:click={() => (messaging = true)}
|
href="https://matrix.to/#/{data.person_view.person
|
||||||
|
.matrix_user_id}"
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
>
|
>
|
||||||
<Icon slot="prefix" solid size="16" src={Envelope} />
|
<Icon slot="prefix" solid size="16" src={ShieldCheck} />
|
||||||
Message
|
Matrix User
|
||||||
</Button>
|
</Button>
|
||||||
{#if data.person_view.person.matrix_user_id}
|
{/if}
|
||||||
<Button
|
</div>
|
||||||
size="lg"
|
<div class="flex flex-row gap-2 ml-auto">
|
||||||
color="secondary"
|
{#if isAdmin($profile?.user)}
|
||||||
href="https://matrix.to/#/{data.person_view.person
|
<Menu class="ml-auto" placement="bottom-end">
|
||||||
.matrix_user_id}"
|
|
||||||
class="flex-1"
|
|
||||||
>
|
|
||||||
<Icon slot="prefix" solid size="16" src={ShieldCheck} />
|
|
||||||
Matrix User
|
|
||||||
</Button>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-row gap-2 ml-auto">
|
|
||||||
{#if isAdmin($profile?.user)}
|
|
||||||
<Menu class="ml-auto" placement="bottom-end">
|
|
||||||
<Button size="square-md" slot="target">
|
|
||||||
<ShieldIcon width={16} filled />
|
|
||||||
</Button>
|
|
||||||
<MenuButton
|
|
||||||
color="danger-subtle"
|
|
||||||
on:click={() =>
|
|
||||||
ban(
|
|
||||||
data.person_view.person.banned,
|
|
||||||
data.person_view.person
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<Icon slot="prefix" mini size="16" src={ShieldExclamation} />
|
|
||||||
{data.person_view.person.banned ? 'Unban' : 'Ban'}
|
|
||||||
</MenuButton>
|
|
||||||
<MenuButton
|
|
||||||
color="danger-subtle"
|
|
||||||
on:click={() => (purgingUser = !purgingUser)}
|
|
||||||
>
|
|
||||||
<Icon slot="prefix" mini size="16" src={Fire} />
|
|
||||||
Purge
|
|
||||||
</MenuButton>
|
|
||||||
</Menu>
|
|
||||||
{/if}
|
|
||||||
<Menu placement="bottom-end">
|
|
||||||
<Button size="square-md" slot="target">
|
<Button size="square-md" slot="target">
|
||||||
<Icon src={EllipsisHorizontal} slot="prefix" size="16" mini />
|
<ShieldIcon width={16} filled />
|
||||||
</Button>
|
</Button>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
on:click={() => blockUser(data.person_view.person.id)}
|
on:click={() =>
|
||||||
|
ban(data.person_view.person.banned, data.person_view.person)}
|
||||||
>
|
>
|
||||||
<Icon slot="prefix" mini size="16" src={NoSymbol} />
|
<Icon slot="prefix" mini size="16" src={ShieldExclamation} />
|
||||||
{isBlocked($profile.user, data.person_view.person.id)
|
{data.person_view.person.banned ? 'Unban' : 'Ban'}
|
||||||
? 'Unblock'
|
</MenuButton>
|
||||||
: 'Block'}
|
<MenuButton
|
||||||
|
color="danger-subtle"
|
||||||
|
on:click={() => (purgingUser = !purgingUser)}
|
||||||
|
>
|
||||||
|
<Icon slot="prefix" mini size="16" src={Fire} />
|
||||||
|
Purge
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
</Menu>
|
</Menu>
|
||||||
</div>
|
{/if}
|
||||||
|
<Menu placement="bottom-end">
|
||||||
|
<Button size="square-md" slot="target">
|
||||||
|
<Icon src={EllipsisHorizontal} slot="prefix" size="16" mini />
|
||||||
|
</Button>
|
||||||
|
<MenuButton
|
||||||
|
color="danger-subtle"
|
||||||
|
on:click={() => blockUser(data.person_view.person.id)}
|
||||||
|
>
|
||||||
|
<Icon slot="prefix" mini size="16" src={NoSymbol} />
|
||||||
|
{isBlocked($profile.user, data.person_view.person.id)
|
||||||
|
? 'Unblock'
|
||||||
|
: 'Block'}
|
||||||
|
</MenuButton>
|
||||||
|
</Menu>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
|
||||||
<div>
|
|
||||||
<h1 class="font-bold text-lg">
|
|
||||||
<UserLink badges user={data.person_view.person} />
|
|
||||||
</h1>
|
|
||||||
<span>{new URL(data.person_view.person.actor_id).hostname}</span>
|
|
||||||
</div>
|
</div>
|
||||||
{#if data.person_view.person.bio}
|
{/if}
|
||||||
<Markdown source={data.person_view.person.bio} />
|
<div>
|
||||||
{/if}
|
<h1 class="font-bold text-lg">
|
||||||
</StickyCard>
|
<UserLink badges user={data.person_view.person} />
|
||||||
</div>
|
</h1>
|
||||||
|
<span>{new URL(data.person_view.person.actor_id).hostname}</span>
|
||||||
|
</div>
|
||||||
|
{#if data.person_view.person.bio}
|
||||||
|
<Markdown source={data.person_view.person.bio} />
|
||||||
|
{/if}
|
||||||
|
</StickyCard>
|
||||||
</div>
|
</div>
|
||||||
Reference in new issue
Block a user