misc: update communityitem
This commit is contained in:
1 parent
0fa82e4a47
commit
f76cf6228f
2 files changed
+19
-17
No files matched your search
@@ -13,7 +13,7 @@
|
|||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||||
import { Button, Modal } from 'mono-svelte'
|
import { Button, Modal } from 'mono-svelte'
|
||||||
import { isSubscribed } from '$lib/util.js'
|
import { fullCommunityName, isSubscribed } from '$lib/util.js'
|
||||||
import { profile } from '$lib/auth.js'
|
import { profile } from '$lib/auth.js'
|
||||||
import { addSubscription } from '$lib/lemmy/user.js'
|
import { addSubscription } from '$lib/lemmy/user.js'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||||
import PostBody from '../post/PostBody.svelte'
|
import PostBody from '../post/PostBody.svelte'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
|
import Entity from '$lib/components/ui/Entity.svelte'
|
||||||
|
|
||||||
export let community: CommunityView
|
export let community: CommunityView
|
||||||
|
|
||||||
@@ -28,22 +29,26 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if showInfo}
|
{#if showInfo}
|
||||||
<Modal title="Community" bind:open={showInfo}>
|
<Modal title={$t('routes.community.title')} bind:open={showInfo}>
|
||||||
<CommunityCard community_view={community} />
|
<CommunityCard community_view={community} />
|
||||||
</Modal>
|
</Modal>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="py-4 flex flex-col gap-2 text-sm max-w-full relative">
|
<div class="py-4 flex flex-col gap-2 text-sm max-w-full relative">
|
||||||
<div class="flex flex-row items-center">
|
<div class="flex flex-row items-center max-w-full w-full">
|
||||||
<div class="flex flex-col">
|
<a
|
||||||
<CommunityLink
|
href="/c/{fullCommunityName(
|
||||||
showInstance={true}
|
community.community.name,
|
||||||
avatar
|
community.community.actor_id,
|
||||||
community={community.community}
|
)}"
|
||||||
class="font-medium text-base"
|
class="hover:underline"
|
||||||
instanceClass="text-xs"
|
>
|
||||||
/>
|
<Entity
|
||||||
</div>
|
icon={community.community.icon}
|
||||||
|
label={new URL(community.community.actor_id).hostname}
|
||||||
|
name={community.community.title}
|
||||||
|
></Entity>
|
||||||
|
</a>
|
||||||
<div class="ml-auto flex flex-row items-center gap-2">
|
<div class="ml-auto flex flex-row items-center gap-2">
|
||||||
<Button size="square-md" on:click={() => (showInfo = !showInfo)}>
|
<Button size="square-md" on:click={() => (showInfo = !showInfo)}>
|
||||||
<Icon src={InformationCircle} size="16" mini />
|
<Icon src={InformationCircle} size="16" mini />
|
||||||
@@ -64,7 +69,7 @@
|
|||||||
community.subscribed = newSubscribed
|
community.subscribed = newSubscribed
|
||||||
addSubscription(
|
addSubscription(
|
||||||
community.community,
|
community.community,
|
||||||
newSubscribed == 'Subscribed'
|
newSubscribed == 'Subscribed',
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@@ -88,9 +93,6 @@
|
|||||||
</Subscribe>
|
</Subscribe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{#if community.community.description}
|
|
||||||
<PostBody body={community.community.description} view="list"></PostBody>
|
|
||||||
{/if}
|
|
||||||
<div class="flex flex-row gap-3 items-center">
|
<div class="flex flex-row gap-3 items-center">
|
||||||
<LabelStat
|
<LabelStat
|
||||||
content={community.counts.posts.toString()}
|
content={community.counts.posts.toString()}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<Avatar url={icon} width={32} />
|
<Avatar url={icon} width={32} />
|
||||||
</slot>
|
</slot>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<span class="font-bold text-base">{name}</span>
|
<span class="font-semibold text-base">{name}</span>
|
||||||
<span class="text-sm">{label}</span>
|
<span class="text-sm">{label}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
Reference in new issue
Block a user