fix: dont auto close
This commit is contained in:
1 parent
87649204ba
commit
22335e92c1
8 files changed
+1052
-1177
No files matched your search
@@ -7,6 +7,7 @@
|
|||||||
import type {
|
import type {
|
||||||
Community,
|
Community,
|
||||||
CommunityAggregates,
|
CommunityAggregates,
|
||||||
|
CommunityModeratorView,
|
||||||
SubscribedType,
|
SubscribedType,
|
||||||
} from 'lemmy-js-client'
|
} from 'lemmy-js-client'
|
||||||
import { Button, toast } from 'mono-svelte'
|
import { Button, toast } from 'mono-svelte'
|
||||||
@@ -18,16 +19,23 @@
|
|||||||
Plus,
|
Plus,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
||||||
|
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||||
|
import { userSettings } from '$lib/settings'
|
||||||
|
import ShieldIcon from '../moderation/ShieldIcon.svelte'
|
||||||
|
import ItemList from '../generic/ItemList.svelte'
|
||||||
|
import { userLink } from '$lib/lemmy/generic'
|
||||||
|
|
||||||
export let community: Community
|
export let community: Community
|
||||||
export let subscribed: SubscribedType
|
export let subscribed: SubscribedType
|
||||||
export let counts: CommunityAggregates | undefined = undefined
|
export let counts: CommunityAggregates | undefined = undefined
|
||||||
|
export let moderators: CommunityModeratorView[] = []
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<EntityHeader
|
<EntityHeader
|
||||||
banner={community.banner}
|
banner={community.banner}
|
||||||
avatar={community.icon}
|
avatar={community.icon}
|
||||||
name={community.title}
|
name={community.title}
|
||||||
|
url="/c/{fullCommunityName(community.name, community.actor_id)}"
|
||||||
stats={counts
|
stats={counts
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
@@ -58,6 +66,26 @@
|
|||||||
>
|
>
|
||||||
!{fullCommunityName(community.name, community.actor_id)}
|
!{fullCommunityName(community.name, community.actor_id)}
|
||||||
</button>
|
</button>
|
||||||
|
{#if moderators.length > 0}
|
||||||
|
<Expandable
|
||||||
|
bind:open={$userSettings.expand.team}
|
||||||
|
class="py-2 border-y border-slate-200 dark:border-zinc-800"
|
||||||
|
>
|
||||||
|
<svelte:fragment slot="title">
|
||||||
|
<ShieldIcon width={15} filled />
|
||||||
|
{$t('cards.community.moderators')}
|
||||||
|
</svelte:fragment>
|
||||||
|
<ItemList
|
||||||
|
items={moderators.map((m) => ({
|
||||||
|
id: m.moderator.id,
|
||||||
|
name: m.moderator.name,
|
||||||
|
url: userLink(m.moderator),
|
||||||
|
avatar: m.moderator.avatar,
|
||||||
|
instance: new URL(m.moderator.actor_id).hostname,
|
||||||
|
}))}
|
||||||
|
/>
|
||||||
|
</Expandable>
|
||||||
|
{/if}
|
||||||
<div class="flex items-center gap-2 h-max">
|
<div class="flex items-center gap-2 h-max">
|
||||||
{#if $profile?.jwt}
|
{#if $profile?.jwt}
|
||||||
<Subscribe
|
<Subscribe
|
||||||
@@ -96,15 +124,6 @@
|
|||||||
</Subscribe>
|
</Subscribe>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<!-- <Button
|
|
||||||
size="lg"
|
|
||||||
color="secondary"
|
|
||||||
class="flex-1"
|
|
||||||
on:click={() => (sidebar = !sidebar)}
|
|
||||||
>
|
|
||||||
<Icon src={InformationCircle} size="16" micro />
|
|
||||||
{$t('cards.site.about')}
|
|
||||||
</Button> -->
|
|
||||||
{#if $profile?.user && $profile.user.moderates
|
{#if $profile?.user && $profile.user.moderates
|
||||||
.map((c) => c.community.id)
|
.map((c) => c.community.id)
|
||||||
.includes(community.id)}
|
.includes(community.id)}
|
||||||
|
|||||||
@@ -100,6 +100,10 @@
|
|||||||
title = result.title
|
title = result.title
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let popoverOpen = false
|
||||||
|
|
||||||
|
$: console.log(popoverOpen)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -113,8 +117,9 @@
|
|||||||
style={$$props.style ?? ''}
|
style={$$props.style ?? ''}
|
||||||
>
|
>
|
||||||
{#if showCommunity && community && subscribed}
|
{#if showCommunity && community && subscribed}
|
||||||
<Popover>
|
<Popover bind:open={popoverOpen} manual>
|
||||||
<div
|
<button
|
||||||
|
on:click={() => (popoverOpen = !popoverOpen)}
|
||||||
class="relative cursor-pointer pr-2 row-span-2 flex-shrink-0 group/community"
|
class="relative cursor-pointer pr-2 row-span-2 flex-shrink-0 group/community"
|
||||||
slot="target"
|
slot="target"
|
||||||
>
|
>
|
||||||
@@ -122,19 +127,18 @@
|
|||||||
url={community.icon}
|
url={community.icon}
|
||||||
width={32}
|
width={32}
|
||||||
alt={community.name}
|
alt={community.name}
|
||||||
class="group-hover/community:ring-1 transition-all ring-offset-1 ring-primary-900 dark:ring-primary-100"
|
class="group-hover/community:ring-2 transition-all ring-offset-1 ring-primary-900 dark:ring-primary-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</button>
|
||||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
||||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
||||||
<div
|
<div
|
||||||
slot="popover"
|
slot="popover"
|
||||||
class="max-w-md rounded-2xl bg-white dark:bg-zinc-950"
|
class="max-w-md rounded-2xl bg-white dark:bg-zinc-950"
|
||||||
on:click|stopPropagation={() => {}}
|
|
||||||
>
|
>
|
||||||
<CommunityHeader bind:community bind:subscribed />
|
<CommunityHeader bind:community bind:subscribed />
|
||||||
</div>
|
</div>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||||
{/if}
|
{/if}
|
||||||
{#if showCommunity && community}
|
{#if showCommunity && community}
|
||||||
<CommunityLink
|
<CommunityLink
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
export let name: string
|
export let name: string
|
||||||
export let bio: string | undefined = undefined
|
export let bio: string | undefined = undefined
|
||||||
export let banner: string | undefined = undefined
|
export let banner: string | undefined = undefined
|
||||||
|
export let url: string | undefined = undefined
|
||||||
export let stats: {
|
export let stats: {
|
||||||
name: string
|
name: string
|
||||||
value: string
|
value: string
|
||||||
@@ -51,9 +52,15 @@
|
|||||||
class="ring-4 ring-slate-25 dark:ring-zinc-925 bg-slate-25 dark:bg-zinc-925"
|
class="ring-4 ring-slate-25 dark:ring-zinc-925 bg-slate-25 dark:bg-zinc-925"
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<span class="text-lg font-medium">
|
<svelte:element
|
||||||
|
this={url ? 'a' : 'span'}
|
||||||
|
href={url}
|
||||||
|
class="text-lg font-medium {url
|
||||||
|
? 'hover:underline hover:text-primary-900 hover:dark:text-primary-100'
|
||||||
|
: ''}"
|
||||||
|
>
|
||||||
{name}
|
{name}
|
||||||
</span>
|
</svelte:element>
|
||||||
<span
|
<span
|
||||||
class="flex items-center gap-0 text-sm text-slate-600 dark:text-zinc-400"
|
class="flex items-center gap-0 text-sm text-slate-600 dark:text-zinc-400"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<div
|
<div
|
||||||
slot="summary"
|
slot="summary"
|
||||||
class="font-medium w-full text-left flex flex-row items-center justify-between hover:text-primary-900
|
class="font-medium w-full text-left flex flex-row items-center justify-between hover:text-primary-900
|
||||||
hover:dark:text-primary-100 transition-colors"
|
hover:dark:text-primary-100 transition-colors h-full"
|
||||||
>
|
>
|
||||||
<div class="flex flex-row gap-1 items-center w-full">
|
<div class="flex flex-row gap-1 items-center w-full">
|
||||||
<slot name="title" />
|
<slot name="title" />
|
||||||
|
|||||||
@@ -81,6 +81,7 @@
|
|||||||
<CommunityHeader
|
<CommunityHeader
|
||||||
bind:community={community.community}
|
bind:community={community.community}
|
||||||
bind:subscribed={community.subscribed}
|
bind:subscribed={community.subscribed}
|
||||||
|
moderators={data.community.moderators}
|
||||||
counts={community.counts}
|
counts={community.counts}
|
||||||
/>
|
/>
|
||||||
<Sort selected={data.sort} />
|
<Sort selected={data.sort} />
|
||||||
|
|||||||
@@ -7,4 +7,9 @@ export default defineConfig({
|
|||||||
define: {
|
define: {
|
||||||
__VERSION__: JSON.stringify(process.env.npm_package_version),
|
__VERSION__: JSON.stringify(process.env.npm_package_version),
|
||||||
},
|
},
|
||||||
|
server: {
|
||||||
|
watch: {
|
||||||
|
ignored: ['!**/node_modules/mono-svelte/**'],
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
Reference in new issue
Block a user