feat: re-add stats
This commit is contained in:
1 parent
9d1ce19549
commit
00a114f2bf
4 files changed
+38
-18
No files matched your search
@@ -11,14 +11,17 @@
|
||||
import {
|
||||
BuildingOffice,
|
||||
Calendar,
|
||||
ChartBar,
|
||||
ChatBubbleOvalLeftEllipsis,
|
||||
Icon,
|
||||
InformationCircle,
|
||||
Newspaper,
|
||||
PencilSquare,
|
||||
ServerStack,
|
||||
UserGroup,
|
||||
} from 'svelte-hero-icons'
|
||||
import Expandable from '../ui/Expandable.svelte'
|
||||
import LabelStat from '../ui/LabelStat.svelte'
|
||||
|
||||
export let site: SiteView
|
||||
export let taglines: Tagline[] | undefined = undefined
|
||||
@@ -59,15 +62,26 @@
|
||||
{/if}
|
||||
|
||||
<Expandable>
|
||||
<div slot="title" class="font-medium w-full text-left">About</div>
|
||||
<svelte:fragment slot="title"><Icon src={InformationCircle} size="15" mini /> About</svelte:fragment>
|
||||
<Markdown source={site.site.description} />
|
||||
<div class="my-4" />
|
||||
<Markdown source={site.site.sidebar} />
|
||||
</Expandable>
|
||||
|
||||
<Expandable>
|
||||
<svelte:fragment slot="title">
|
||||
<Icon src={ChartBar} size="15" mini /> Stats
|
||||
</svelte:fragment>
|
||||
<div class="flex flex-row gap-4 flex-wrap">
|
||||
<LabelStat label="Users" content="{site.counts.users.toString()}" formatted />
|
||||
<LabelStat label="Posts" content="{site.counts.posts.toString()}" formatted />
|
||||
<LabelStat label="Communities" content="{site.counts.communities.toString()}" formatted />
|
||||
</div>
|
||||
</Expandable>
|
||||
|
||||
{#if admins}
|
||||
<Expandable>
|
||||
<div slot="title" class="font-medium w-full text-left">Admins</div>
|
||||
<svelte:fragment slot="title"><Icon src={UserGroup} size="15" mini /> Admins</svelte:fragment>
|
||||
<div
|
||||
class="flex items-center flex-wrap group transition-all
|
||||
cursor-pointer"
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
UserGroup,
|
||||
} from 'svelte-hero-icons'
|
||||
import { publishedToDate } from '$lib/components/util/date.js'
|
||||
import CommunityLink from './CommunityLink.svelte'
|
||||
|
||||
export let community_view: CommunityView
|
||||
export let moderators: CommunityModeratorView[] = []
|
||||
@@ -183,22 +184,9 @@
|
||||
|
||||
<StickyCard class="min-w-full {$$props.class}">
|
||||
<div class="flex flex-row gap-3 items-center">
|
||||
<div class="flex-shrink-0">
|
||||
<a
|
||||
href="/c/{fullCommunityName(
|
||||
community_view.community.name,
|
||||
community_view.community.actor_id
|
||||
)}"
|
||||
>
|
||||
<Avatar
|
||||
width={42}
|
||||
url={community_view.community.icon}
|
||||
alt={community_view.community.name}
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<CommunityLink name={false} avatar avatarSize={32} community={community_view.community} />
|
||||
<div class="flex flex-col gap-0">
|
||||
<h1 class="font-bold text-xl">
|
||||
<h1 class="font-bold text-lg">
|
||||
<a
|
||||
href="/c/{fullCommunityName(
|
||||
community_view.community.name,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<Disclosure buttonClass="text-red-500" class="items-start justify-items-start gap-2">
|
||||
<div slot="summary" class="font-medium w-full text-left flex flex-row items-center justify-between">
|
||||
<slot name="title" />
|
||||
<div class="flex flex-row gap-1 items-center"><slot name="title" /></div>
|
||||
<Icon src={ChevronDown} size="20" mini />
|
||||
</div>
|
||||
<div class="pt-2">
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<script lang="ts">
|
||||
import FormattedNumber from "../util/FormattedNumber.svelte"
|
||||
|
||||
export let label: string
|
||||
export let content: string
|
||||
export let formatted: boolean = false
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col {$$props.class}">
|
||||
<span class="text-slate-600 dark:text-zinc-400 text-xs">{label}</span>
|
||||
<span class="text-base">
|
||||
{#if formatted}
|
||||
<FormattedNumber number={Number(content)} />
|
||||
{:else}
|
||||
{content}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
Reference in new issue
Block a user