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 class="mx-auto max-w-sm w-full">
|
||||
<StickyCard>
|
||||
<Avatar
|
||||
width={64}
|
||||
url={data.person_view.person.avatar}
|
||||
alt={data.person_view.person.name}
|
||||
/>
|
||||
<span class="flex flex-row items-center gap-1 text-sm">
|
||||
<Icon src={Calendar} width={16} height={16} mini />
|
||||
<span class="capitalize">
|
||||
<RelativeDate
|
||||
date={publishedToDate(data.person_view.person.published)}
|
||||
/>
|
||||
</span>
|
||||
<StickyCard class="px-0">
|
||||
<Avatar
|
||||
width={64}
|
||||
url={data.person_view.person.avatar}
|
||||
alt={data.person_view.person.name}
|
||||
/>
|
||||
<span class="flex flex-row items-center gap-1 text-sm">
|
||||
<Icon src={Calendar} width={16} height={16} mini />
|
||||
<span class="capitalize">
|
||||
<RelativeDate
|
||||
date={publishedToDate(data.person_view.person.published)}
|
||||
/>
|
||||
</span>
|
||||
<div class="text-sm flex flex-row flex-wrap gap-3">
|
||||
<span class="flex flex-row items-center gap-1">
|
||||
<Icon src={PencilSquare} width={16} height={16} mini />
|
||||
<FormattedNumber number={data.person_view.counts.post_count} />
|
||||
</span>
|
||||
<span class="flex flex-row items-center gap-1">
|
||||
<Icon src={ChatBubbleOvalLeftEllipsis} width={16} height={16} mini />
|
||||
<FormattedNumber number={data.person_view.counts.comment_count} />
|
||||
</span>
|
||||
</div>
|
||||
{#if (data.moderates ?? []).length > 0}
|
||||
<div class="flex flex-col gap-2 max-w-full">
|
||||
<span class="font-bold">Moderates</span>
|
||||
<div
|
||||
class="flex items-center -space-x-1 flex-wrap hover:space-x-1 transition-all
|
||||
</span>
|
||||
<div class="text-sm flex flex-row flex-wrap gap-3">
|
||||
<span class="flex flex-row items-center gap-1">
|
||||
<Icon src={PencilSquare} width={16} height={16} mini />
|
||||
<FormattedNumber number={data.person_view.counts.post_count} />
|
||||
</span>
|
||||
<span class="flex flex-row items-center gap-1">
|
||||
<Icon src={ChatBubbleOvalLeftEllipsis} width={16} height={16} mini />
|
||||
<FormattedNumber number={data.person_view.counts.comment_count} />
|
||||
</span>
|
||||
</div>
|
||||
{#if (data.moderates ?? []).length > 0}
|
||||
<div class="flex flex-col gap-2 max-w-full">
|
||||
<span class="font-bold">Moderates</span>
|
||||
<div
|
||||
class="flex items-center -space-x-1 flex-wrap hover:space-x-1 transition-all
|
||||
cursor-pointer"
|
||||
>
|
||||
{#each data.moderates as moderator}
|
||||
<Popover openOnHover placement="top" class="transition-all">
|
||||
<a
|
||||
class="block ring rounded-full ring-slate-50 dark:ring-zinc-950 transition-all"
|
||||
href="/c/{moderator.community.name}@{new URL(
|
||||
moderator.community.actor_id
|
||||
).hostname}"
|
||||
slot="target"
|
||||
>
|
||||
<Avatar
|
||||
width={28}
|
||||
url={moderator.community.icon}
|
||||
alt={moderator.community.title}
|
||||
/>
|
||||
</a>
|
||||
<span class="font-bold">{moderator.community.title}</span>
|
||||
</Popover>
|
||||
{/each}
|
||||
</div>
|
||||
>
|
||||
{#each data.moderates as moderator}
|
||||
<Popover openOnHover placement="top" class="transition-all">
|
||||
<a
|
||||
class="block ring rounded-full ring-slate-50 dark:ring-zinc-950 transition-all"
|
||||
href="/c/{moderator.community.name}@{new URL(
|
||||
moderator.community.actor_id
|
||||
).hostname}"
|
||||
slot="target"
|
||||
>
|
||||
<Avatar
|
||||
width={28}
|
||||
url={moderator.community.icon}
|
||||
alt={moderator.community.title}
|
||||
/>
|
||||
</a>
|
||||
<span class="font-bold">{moderator.community.title}</span>
|
||||
</Popover>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
{#if $profile?.user && $profile.jwt && data.person_view.person.id != $profile.user.local_user_view.person.id}
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class="flex items-center gap-2 w-full">
|
||||
</div>
|
||||
{/if}
|
||||
{#if $profile?.user && $profile.jwt && data.person_view.person.id != $profile.user.local_user_view.person.id}
|
||||
<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
|
||||
size="lg"
|
||||
color="secondary"
|
||||
on:click={() => (messaging = true)}
|
||||
href="https://matrix.to/#/{data.person_view.person
|
||||
.matrix_user_id}"
|
||||
class="flex-1"
|
||||
>
|
||||
<Icon slot="prefix" solid size="16" src={Envelope} />
|
||||
Message
|
||||
<Icon slot="prefix" solid size="16" src={ShieldCheck} />
|
||||
Matrix User
|
||||
</Button>
|
||||
{#if data.person_view.person.matrix_user_id}
|
||||
<Button
|
||||
size="lg"
|
||||
color="secondary"
|
||||
href="https://matrix.to/#/{data.person_view.person
|
||||
.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">
|
||||
{/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">
|
||||
<Icon src={EllipsisHorizontal} slot="prefix" size="16" mini />
|
||||
<ShieldIcon width={16} filled />
|
||||
</Button>
|
||||
<MenuButton
|
||||
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} />
|
||||
{isBlocked($profile.user, data.person_view.person.id)
|
||||
? 'Unblock'
|
||||
: 'Block'}
|
||||
<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>
|
||||
</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>
|
||||
{/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>
|
||||
{#if data.person_view.person.bio}
|
||||
<Markdown source={data.person_view.person.bio} />
|
||||
{/if}
|
||||
</StickyCard>
|
||||
</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>
|
||||
{#if data.person_view.person.bio}
|
||||
<Markdown source={data.person_view.person.bio} />
|
||||
{/if}
|
||||
</StickyCard>
|
||||
</div>
|
||||
Reference in new issue
Block a user