redesign: entity headers
This commit is contained in:
1 parent
c85f98cdcb
commit
fef0df76ce
9 files changed
+204
-213
No files matched your search
@@ -95,13 +95,10 @@
|
|||||||
</button>
|
</button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#if moderators.length > 0}
|
{#if moderators.length > 0}
|
||||||
<Expandable
|
<Expandable class="">
|
||||||
class="border rounded-xl bg-white/50 dark:bg-zinc-900/50 w-full p-3 px-4
|
|
||||||
dark:border-zinc-800 border-slate-300 border-opacity-50 text-slate-700 dark:text-zinc-300 transition-colors"
|
|
||||||
>
|
|
||||||
{#snippet title()}
|
{#snippet title()}
|
||||||
<ShieldIcon width={15} filled />
|
|
||||||
{$t('cards.community.moderators')}
|
{$t('cards.community.moderators')}
|
||||||
|
<hr class="flex-1 border-slate-200 dark:border-zinc-800 mx-3" />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<ItemList
|
<ItemList
|
||||||
items={moderators.map((m) => ({
|
items={moderators.map((m) => ({
|
||||||
@@ -114,7 +111,7 @@ dark:border-zinc-800 border-slate-300 border-opacity-50 text-slate-700 dark:text
|
|||||||
/>
|
/>
|
||||||
</Expandable>
|
</Expandable>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="flex items-center gap-2 h-max">
|
<div class="flex items-center gap-2 h-max w-max">
|
||||||
{#if $profile?.jwt}
|
{#if $profile?.jwt}
|
||||||
<Subscribe
|
<Subscribe
|
||||||
community={{
|
community={{
|
||||||
@@ -137,7 +134,7 @@ dark:border-zinc-800 border-slate-300 border-opacity-50 text-slate-700 dark:text
|
|||||||
(await subscribe())?.community_view.subscribed ??
|
(await subscribe())?.community_view.subscribed ??
|
||||||
'NotSubscribed'
|
'NotSubscribed'
|
||||||
}}
|
}}
|
||||||
class="flex-1 relative z-[inherit]"
|
class="relative px-8 z-[inherit]"
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon
|
<Icon
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
class="text-slate-600 dark:text-zinc-400 inline-flex items-center gap-1 text-xs"
|
class="text-slate-600 dark:text-zinc-400 inline-flex items-center gap-1 text-xs"
|
||||||
>
|
>
|
||||||
|
<Icon src={LinkIcon} size="14" micro />
|
||||||
{richURL.hostname}
|
{richURL.hostname}
|
||||||
</Link>
|
</Link>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -88,8 +88,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { run } from 'svelte/legacy'
|
|
||||||
|
|
||||||
import SvelteMarkdown from 'svelte-markdown'
|
import SvelteMarkdown from 'svelte-markdown'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -5,6 +5,11 @@
|
|||||||
import LabelStat from './LabelStat.svelte'
|
import LabelStat from './LabelStat.svelte'
|
||||||
import { optimizeImageURL } from '../lemmy/post/helpers'
|
import { optimizeImageURL } from '../lemmy/post/helpers'
|
||||||
import FormattedNumber from '../util/FormattedNumber.svelte'
|
import FormattedNumber from '../util/FormattedNumber.svelte'
|
||||||
|
import Expandable from './Expandable.svelte'
|
||||||
|
import { Icon, InformationCircle } from 'svelte-hero-icons'
|
||||||
|
import { t } from '$lib/translations'
|
||||||
|
import Markdown from '../markdown/Markdown.svelte'
|
||||||
|
import EndPlaceholder from './EndPlaceholder.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
avatar?: string | undefined
|
avatar?: string | undefined
|
||||||
@@ -41,35 +46,17 @@
|
|||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Material
|
<div {...rest} class="z-10 relative text-sm contents {clazz}">
|
||||||
color="transparent"
|
{#if banner}
|
||||||
padding="none"
|
<img
|
||||||
rounding="xl"
|
src={banner}
|
||||||
{...rest}
|
class="w-full object-cover h-48 rounded-t-xl bg-white dark:bg-zinc-900 rounded-xl"
|
||||||
class="z-10 relative border-slate-200 dark:border-zinc-700 {clazz}"
|
class:blur-3xl={!banner}
|
||||||
>
|
height="192"
|
||||||
{#if banner || avatar}
|
alt="User banner"
|
||||||
<div class="max-h-36 overflow-visible">
|
/>
|
||||||
<img
|
|
||||||
src={banner ?? avatar}
|
|
||||||
class="w-full object-cover h-48 rounded-t-xl bg-white dark:bg-zinc-900 banner-mask"
|
|
||||||
class:blur-3xl={!banner}
|
|
||||||
height="192"
|
|
||||||
alt="User banner"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="absolute top-0 left-0 -z-10 object-cover h-full w-full rounded-xl
|
|
||||||
overflow-hidden"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
src={optimizeImageURL(banner ?? avatar ?? '', 64)}
|
|
||||||
alt=""
|
|
||||||
class="opacity-10 blur-2xl h-full w-full saturate-200"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
<div class="p-4 flex flex-col gap-4">
|
<div class="py-4 flex flex-col gap-4">
|
||||||
<div class="flex-1 flex flex-row items-center text-left gap-4">
|
<div class="flex-1 flex flex-row items-center text-left gap-4">
|
||||||
<Avatar
|
<Avatar
|
||||||
width={64}
|
width={64}
|
||||||
@@ -81,7 +68,7 @@
|
|||||||
<svelte:element
|
<svelte:element
|
||||||
this={url ? 'a' : 'span'}
|
this={url ? 'a' : 'span'}
|
||||||
href={url}
|
href={url}
|
||||||
class="text-2xl font-semibold {url
|
class="text-xl font-semibold {url
|
||||||
? 'hover:underline hover:text-primary-900 hover:dark:text-primary-100'
|
? 'hover:underline hover:text-primary-900 hover:dark:text-primary-100'
|
||||||
: ''}"
|
: ''}"
|
||||||
>
|
>
|
||||||
@@ -102,27 +89,47 @@
|
|||||||
</div>
|
</div>
|
||||||
{#if bio}
|
{#if bio}
|
||||||
<div class="relative w-full {center ? 'text-center' : 'text-left'}">
|
<div class="relative w-full {center ? 'text-center' : 'text-left'}">
|
||||||
<div
|
<Expandable class="py-2">
|
||||||
class="p-4 relative bg-white/30 dark:bg-zinc-900/30 border border-slate-300
|
{#snippet title(open)}
|
||||||
dark:border-zinc-800 border-opacity-50 rounded-xl
|
{#if bio.split('\n')?.[0]?.startsWith('#') || open}
|
||||||
max-w-full w-full"
|
{$t('nav.menu.about')}
|
||||||
>
|
{:else}
|
||||||
<PostBody class="text-sm" view="list" body={bio} clickThrough />
|
<div
|
||||||
</div>
|
class={[
|
||||||
|
'overflow-hidden whitespace-nowrap',
|
||||||
|
'bg-gradient-to-r from-slate-700 via-slate-700 to-slate-700/0',
|
||||||
|
'dark:from-zinc-400 dark:via-zinc-400 dark:to-zinc-400/0',
|
||||||
|
'text-transparent bg-clip-text',
|
||||||
|
'max-w-[50%] overflow-hidden',
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{bio.split('\n')?.[0].slice(0, 75)}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
<hr class="flex-1 border-slate-200 dark:border-zinc-800 mx-2" />
|
||||||
|
<div class="mr-2 text-primary-900 dark:text-primary-100">
|
||||||
|
{$t('form.post.readMore')}
|
||||||
|
</div>
|
||||||
|
{/snippet}
|
||||||
|
<Markdown source={bio} class="font-normal" />
|
||||||
|
</Expandable>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="space-y-3 p-4 pt-0">
|
<div class="space-y-3 py-4 pt-0">
|
||||||
{#if stats.length > 0}
|
{#if stats.length > 0}
|
||||||
<div class="text-sm flex flex-row flex-wrap gap-3 mx-auto">
|
<div
|
||||||
|
class="text-sm flex flex-row flex-wrap mx-auto rounded-lg
|
||||||
|
overflow-hidden gap-4"
|
||||||
|
>
|
||||||
{#each stats as stat}
|
{#each stats as stat}
|
||||||
<div
|
<div class="">
|
||||||
class="min-w-36 p-3 px-4 rounded-xl flex-1 bg-white/30 dark:bg-zinc-900/30 border border-slate-300 dark:border-zinc-800 border-opacity-50"
|
<div
|
||||||
>
|
class="text-primary-900 dark:text-primary-100 text-xs font-medium"
|
||||||
<div class="text-primary-900 dark:text-primary-100">
|
>
|
||||||
{stat.name}
|
{stat.name}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-xl font-semibold">
|
<div class="text-lg font-semibold">
|
||||||
{#if stat.format ?? true}
|
{#if stat.format ?? true}
|
||||||
<FormattedNumber
|
<FormattedNumber
|
||||||
number={Number(stat.value)}
|
number={Number(stat.value)}
|
||||||
@@ -138,7 +145,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</div>
|
</div>
|
||||||
</Material>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.banner-mask {
|
.banner-mask {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
open?: boolean
|
open?: boolean
|
||||||
icon?: boolean
|
icon?: boolean
|
||||||
class?: string
|
class?: string
|
||||||
title?: import('svelte').Snippet
|
title?: import('svelte').Snippet<[boolean | undefined]>
|
||||||
extended?: import('svelte').Snippet
|
extended?: import('svelte').Snippet
|
||||||
content?: import('svelte').Snippet
|
content?: import('svelte').Snippet
|
||||||
children?: import('svelte').Snippet
|
children?: import('svelte').Snippet
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
hover:dark:text-primary-100 transition-colors h-full z-0 group relative"
|
hover:dark:text-primary-100 transition-colors h-full z-0 group relative"
|
||||||
>
|
>
|
||||||
<div class="flex flex-row gap-1 items-center w-full">
|
<div class="flex flex-row gap-1 items-center w-full">
|
||||||
{@render title?.()}
|
{@render title?.(open)}
|
||||||
</div>
|
</div>
|
||||||
{#if icon}
|
{#if icon}
|
||||||
<Icon
|
<Icon
|
||||||
|
|||||||
@@ -4,27 +4,14 @@
|
|||||||
import { navigating, page } from '$app/state'
|
import { navigating, page } from '$app/state'
|
||||||
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
|
||||||
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
||||||
import { fullCommunityName, searchParam } from '$lib/util.svelte.js'
|
|
||||||
import { onDestroy, onMount } from 'svelte'
|
import { onDestroy, onMount } from 'svelte'
|
||||||
import { setSessionStorage } from '$lib/session.js'
|
import { setSessionStorage } from '$lib/session.js'
|
||||||
import PostFeed from '$lib/components/lemmy/post/feed/PostFeed.svelte'
|
import PostFeed from '$lib/components/lemmy/post/feed/PostFeed.svelte'
|
||||||
import VirtualFeed from '$lib/components/lemmy/post/feed/VirtualFeed.svelte'
|
import VirtualFeed from '$lib/components/lemmy/post/feed/VirtualFeed.svelte'
|
||||||
import { Button, Modal, toast } from 'mono-svelte'
|
import { Button, Modal, toast } from 'mono-svelte'
|
||||||
import { afterNavigate } from '$app/navigation'
|
|
||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import {
|
import { ArrowRight, ChartBar, Icon, XMark } from 'svelte-hero-icons'
|
||||||
ArrowRight,
|
|
||||||
ChartBar,
|
|
||||||
Check,
|
|
||||||
Cog6Tooth,
|
|
||||||
EllipsisHorizontal,
|
|
||||||
Icon,
|
|
||||||
InformationCircle,
|
|
||||||
Plus,
|
|
||||||
XMark,
|
|
||||||
} from 'svelte-hero-icons'
|
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { t } from '$lib/translations.js'
|
import { t } from '$lib/translations.js'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/settings.svelte.js'
|
||||||
@@ -33,7 +20,11 @@
|
|||||||
import CommunityHeader from '$lib/components/lemmy/community/CommunityHeader.svelte'
|
import CommunityHeader from '$lib/components/lemmy/community/CommunityHeader.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
|
|
||||||
let { data = $bindable() } = $props()
|
let { data: pageData } = $props()
|
||||||
|
let data = $state(pageData)
|
||||||
|
$effect(() => {
|
||||||
|
data = pageData
|
||||||
|
})
|
||||||
|
|
||||||
let sidebar: boolean = $state(false)
|
let sidebar: boolean = $state(false)
|
||||||
|
|
||||||
@@ -77,14 +68,16 @@
|
|||||||
|
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
||||||
<Header pageHeader>
|
<Header pageHeader>
|
||||||
<CommunityHeader
|
<div class="flex flex-col w-full">
|
||||||
bind:community={data.community.community_view.community}
|
<CommunityHeader
|
||||||
bind:subscribed={data.community.community_view.subscribed}
|
bind:community={data.community.community_view.community}
|
||||||
blocked={data.community.community_view.blocked}
|
bind:subscribed={data.community.community_view.subscribed}
|
||||||
moderators={data.community.moderators}
|
blocked={data.community.community_view.blocked}
|
||||||
counts={data.community.community_view.counts}
|
moderators={data.community.moderators}
|
||||||
class="w-full relative"
|
counts={data.community.community_view.counts}
|
||||||
/>
|
class="w-full relative"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
{#snippet extended()}
|
{#snippet extended()}
|
||||||
<Sort selected={data.sort} />
|
<Sort selected={data.sort} />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -70,8 +70,8 @@
|
|||||||
size="square-lg"
|
size="square-lg"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
color="none"
|
color="none"
|
||||||
class="bg-[#fff]/60 dark:bg-neutral-800/60
|
class="bg-white/60 dark:bg-zinc-800/60
|
||||||
border border-gray-200/60 dark:border-neutral-800
|
border border-slate-200/60 dark:border-zinc-800
|
||||||
backdrop-blur-xl shadow-xl hover:bg-slate-100 hover:dark:bg-zinc-800
|
backdrop-blur-xl shadow-xl hover:bg-slate-100 hover:dark:bg-zinc-800
|
||||||
flex-shrink-0"
|
flex-shrink-0"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -53,25 +53,20 @@
|
|||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#if (data.moderates ?? []).length > 0}
|
{#if data.moderates && data.moderates.length > 0}
|
||||||
<Expandable
|
<Expandable class="">
|
||||||
class="border rounded-xl bg-white/50 dark:bg-zinc-900/50 w-full p-3 px-4
|
|
||||||
dark:border-zinc-800 border-slate-300 border-opacity-50 text-slate-700 dark:text-zinc-300 transition-colors"
|
|
||||||
>
|
|
||||||
{#snippet title()}
|
{#snippet title()}
|
||||||
<span class="flex items-center gap-1">
|
{$t('routes.profile.moderates')}
|
||||||
<ShieldIcon width={14} filled />
|
<hr class="flex-1 w-full border-slate-200 dark:border-zinc-800 mx-3" />
|
||||||
{$t('routes.profile.moderates')}
|
|
||||||
</span>
|
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<ItemList
|
<ItemList
|
||||||
items={data.moderates?.map((m) => ({
|
items={data.moderates.map((m) => ({
|
||||||
id: m.community.id,
|
id: m.community.id,
|
||||||
name: m.community.title,
|
name: m.community.title,
|
||||||
url: communityLink(m.community),
|
url: communityLink(m.community),
|
||||||
avatar: m.community.icon,
|
avatar: m.community.icon,
|
||||||
instance: new URL(m.community.actor_id).hostname,
|
instance: new URL(m.community.actor_id).hostname,
|
||||||
})) ?? []}
|
}))}
|
||||||
/>
|
/>
|
||||||
</Expandable>
|
</Expandable>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
+122
-122
@@ -39,6 +39,7 @@
|
|||||||
import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte'
|
import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte'
|
||||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
import Option from 'mono-svelte/forms/select/Option.svelte'
|
||||||
import type { PageData } from './$types'
|
import type { PageData } from './$types'
|
||||||
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
data: PageData
|
data: PageData
|
||||||
@@ -150,147 +151,146 @@
|
|||||||
|
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full">
|
<div class="flex flex-col gap-4 max-w-full w-full">
|
||||||
{#if !inline}
|
{#if !inline}
|
||||||
<div class="">
|
<Header pageHeader>
|
||||||
<EntityHeader
|
<div class="w-full">
|
||||||
avatar={data.person_view.person.avatar}
|
<EntityHeader
|
||||||
name={data.person_view.person.display_name ||
|
avatar={data.person_view.person.avatar}
|
||||||
data.person_view.person.name}
|
name={data.person_view.person.display_name ||
|
||||||
banner={data.person_view.person.banner}
|
data.person_view.person.name}
|
||||||
bio={data.person_view.person.bio}
|
banner={data.person_view.person.banner}
|
||||||
stats={[
|
bio={data.person_view.person.bio}
|
||||||
{
|
stats={[
|
||||||
name: $t('content.posts'),
|
{
|
||||||
value: data.person_view.counts.post_count.toString(),
|
name: $t('content.posts'),
|
||||||
},
|
value: data.person_view.counts.post_count.toString(),
|
||||||
{
|
},
|
||||||
name: $t('content.comments'),
|
{
|
||||||
value: data.person_view.counts.comment_count.toString(),
|
name: $t('content.comments'),
|
||||||
},
|
value: data.person_view.counts.comment_count.toString(),
|
||||||
{
|
},
|
||||||
name: $t('stats.joined'),
|
{
|
||||||
value: formatRelativeDate(
|
name: $t('stats.joined'),
|
||||||
publishedToDate(data.person_view.person.published),
|
value: formatRelativeDate(
|
||||||
{ style: 'short' },
|
publishedToDate(data.person_view.person.published),
|
||||||
).toString(),
|
{ style: 'short' },
|
||||||
format: false,
|
).toString(),
|
||||||
},
|
format: false,
|
||||||
]}
|
},
|
||||||
>
|
]}
|
||||||
{#snippet nameDetail()}
|
>
|
||||||
<span class="text-sm flex gap-0 items-center w-max">
|
{#snippet nameDetail()}
|
||||||
@
|
<span class="text-sm flex gap-0 items-center w-max">
|
||||||
<UserLink
|
@
|
||||||
showInstance
|
<UserLink
|
||||||
user={data.person_view.person}
|
showInstance
|
||||||
displayName={false}
|
user={data.person_view.person}
|
||||||
class="font-normal"
|
displayName={false}
|
||||||
/>
|
class="font-normal"
|
||||||
</span>
|
/>
|
||||||
{/snippet}
|
</span>
|
||||||
{#if (data.moderates ?? []).length > 0}
|
{/snippet}
|
||||||
<Expandable
|
{#if (data.moderates ?? []).length > 0}
|
||||||
class="border rounded-xl bg-white/50 dark:bg-zinc-900/50 w-full p-3 px-4
|
<Expandable class="">
|
||||||
dark:border-zinc-800 border-slate-300 border-opacity-50 text-slate-700 dark:text-zinc-300 transition-colors"
|
{#snippet title()}
|
||||||
>
|
|
||||||
{#snippet title()}
|
|
||||||
<span class="flex items-center gap-1">
|
|
||||||
<ShieldIcon width={14} filled />
|
|
||||||
{$t('routes.profile.moderates')}
|
{$t('routes.profile.moderates')}
|
||||||
</span>
|
<hr
|
||||||
{/snippet}
|
class="flex-1 w-full border-slate-200 dark:border-zinc-800 mx-3"
|
||||||
<ItemList
|
/>
|
||||||
items={data.moderates.map((m) => ({
|
{/snippet}
|
||||||
id: m.community.id,
|
<ItemList
|
||||||
name: m.community.title,
|
items={data.moderates.map((m) => ({
|
||||||
url: communityLink(m.community),
|
id: m.community.id,
|
||||||
avatar: m.community.icon,
|
name: m.community.title,
|
||||||
instance: new URL(m.community.actor_id).hostname,
|
url: communityLink(m.community),
|
||||||
}))}
|
avatar: m.community.icon,
|
||||||
/>
|
instance: new URL(m.community.actor_id).hostname,
|
||||||
</Expandable>
|
}))}
|
||||||
{/if}
|
/>
|
||||||
{#snippet actions()}
|
</Expandable>
|
||||||
{#if $profile?.user && $profile.jwt && data.person_view.person.id != $profile.user.local_user_view.person.id}
|
{/if}
|
||||||
<div class="flex items-center gap-2 w-full">
|
{#snippet actions()}
|
||||||
<Button
|
{#if $profile?.user && $profile.jwt && data.person_view.person.id != $profile.user.local_user_view.person.id}
|
||||||
size="square-md"
|
<div class="flex items-center gap-2 w-full">
|
||||||
color="secondary"
|
|
||||||
href="/inbox/messages/{data.person_view.person.id}"
|
|
||||||
title="Message"
|
|
||||||
>
|
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon solid size="16" src={Envelope} />
|
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
{#if data.person_view.person.matrix_user_id}
|
|
||||||
<Button
|
<Button
|
||||||
size="square-md"
|
size="square-md"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
href="https://matrix.to/#/{data.person_view.person
|
href="/inbox/messages/{data.person_view.person.id}"
|
||||||
.matrix_user_id}"
|
title="Message"
|
||||||
title="Matrix User"
|
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon solid size="16" src={AtSymbol} />
|
<Icon solid size="16" src={Envelope} />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{#if data.person_view.person.matrix_user_id}
|
||||||
{#if isAdmin($profile?.user)}
|
<Button
|
||||||
<Menu class="ml-auto" placement="bottom-end">
|
size="square-md"
|
||||||
|
color="secondary"
|
||||||
|
href="https://matrix.to/#/{data.person_view.person
|
||||||
|
.matrix_user_id}"
|
||||||
|
title="Matrix User"
|
||||||
|
>
|
||||||
|
{#snippet prefix()}
|
||||||
|
<Icon solid size="16" src={AtSymbol} />
|
||||||
|
{/snippet}
|
||||||
|
</Button>
|
||||||
|
{/if}
|
||||||
|
{#if isAdmin($profile?.user)}
|
||||||
|
<Menu class="ml-auto" placement="bottom-end">
|
||||||
|
{#snippet target()}
|
||||||
|
<Button size="square-md">
|
||||||
|
<ShieldIcon width={16} filled />
|
||||||
|
</Button>
|
||||||
|
{/snippet}
|
||||||
|
<MenuButton
|
||||||
|
color="danger-subtle"
|
||||||
|
onclick={() =>
|
||||||
|
ban(
|
||||||
|
data.person_view.person.banned,
|
||||||
|
data.person_view.person,
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{#snippet prefix()}
|
||||||
|
<Icon mini size="16" src={ShieldExclamation} />
|
||||||
|
{/snippet}
|
||||||
|
{data.person_view.person.banned ? 'Unban' : 'Ban'}
|
||||||
|
</MenuButton>
|
||||||
|
<MenuButton
|
||||||
|
color="danger-subtle"
|
||||||
|
onclick={() => (purgingUser = !purgingUser)}
|
||||||
|
>
|
||||||
|
{#snippet prefix()}
|
||||||
|
<Icon mini size="16" src={Fire} />
|
||||||
|
{/snippet}
|
||||||
|
Purge
|
||||||
|
</MenuButton>
|
||||||
|
</Menu>
|
||||||
|
{/if}
|
||||||
|
<Menu placement="bottom-end">
|
||||||
{#snippet target()}
|
{#snippet target()}
|
||||||
<Button size="square-md">
|
<Button size="square-md">
|
||||||
<ShieldIcon width={16} filled />
|
{#snippet prefix()}
|
||||||
|
<Icon src={EllipsisHorizontal} size="16" mini />
|
||||||
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
onclick={() =>
|
onclick={() => blockUser(data.person_view.person.id)}
|
||||||
ban(
|
|
||||||
data.person_view.person.banned,
|
|
||||||
data.person_view.person,
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon mini size="16" src={ShieldExclamation} />
|
<Icon mini size="16" src={NoSymbol} />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{data.person_view.person.banned ? 'Unban' : 'Ban'}
|
{isBlocked($profile.user, data.person_view.person.id)
|
||||||
</MenuButton>
|
? 'Unblock'
|
||||||
<MenuButton
|
: 'Block'}
|
||||||
color="danger-subtle"
|
|
||||||
onclick={() => (purgingUser = !purgingUser)}
|
|
||||||
>
|
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon mini size="16" src={Fire} />
|
|
||||||
{/snippet}
|
|
||||||
Purge
|
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
</Menu>
|
</Menu>
|
||||||
{/if}
|
</div>
|
||||||
<Menu placement="bottom-end">
|
{/if}
|
||||||
{#snippet target()}
|
{/snippet}
|
||||||
<Button size="square-md">
|
</EntityHeader>
|
||||||
{#snippet prefix()}
|
</div>
|
||||||
<Icon src={EllipsisHorizontal} size="16" mini />
|
</Header>
|
||||||
{/snippet}
|
|
||||||
</Button>
|
|
||||||
{/snippet}
|
|
||||||
<MenuButton
|
|
||||||
color="danger-subtle"
|
|
||||||
onclick={() => blockUser(data.person_view.person.id)}
|
|
||||||
>
|
|
||||||
{#snippet prefix()}
|
|
||||||
<Icon mini size="16" src={NoSymbol} />
|
|
||||||
{/snippet}
|
|
||||||
{isBlocked($profile.user, data.person_view.person.id)
|
|
||||||
? 'Unblock'
|
|
||||||
: 'Block'}
|
|
||||||
</MenuButton>
|
|
||||||
</Menu>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{/snippet}
|
|
||||||
</EntityHeader>
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
||||||
|
|||||||
Reference in new issue
Block a user