feat: click community id to copy it to clipboard
This commit is contained in:
1 parent
856ce6bbec
commit
699d62b5e2
1 file changed
+16
-4
@@ -8,7 +8,7 @@
|
|||||||
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/PostFeed.svelte'
|
import PostFeed from '$lib/components/lemmy/post/PostFeed.svelte'
|
||||||
import { Button, Modal } from 'mono-svelte'
|
import { Button, Modal, toast } from 'mono-svelte'
|
||||||
import { afterNavigate } from '$app/navigation'
|
import { afterNavigate } from '$app/navigation'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
@@ -54,11 +54,23 @@
|
|||||||
<h1 class="font-bold text-xl">
|
<h1 class="font-bold text-xl">
|
||||||
{data.community.community_view.community.title}
|
{data.community.community_view.community.title}
|
||||||
</h1>
|
</h1>
|
||||||
<span class="dark:text-zinc-400 text-slate-600 text-sm">
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
navigator?.clipboard?.writeText?.(
|
||||||
|
`!${data.community.community_view.community.name}@${
|
||||||
|
new URL(data.community.community_view.community.actor_id)
|
||||||
|
.hostname
|
||||||
|
}`
|
||||||
|
)
|
||||||
|
|
||||||
|
toast({ content: 'Copied to clipboard.' })
|
||||||
|
}}
|
||||||
|
class="dark:text-zinc-400 text-slate-600 text-sm"
|
||||||
|
>
|
||||||
!{data.community.community_view.community.name}@{new URL(
|
!{data.community.community_view.community.name}@{new URL(
|
||||||
data.community.community_view.community.actor_id
|
data.community.community_view.community.actor_id
|
||||||
).hostname}
|
).hostname}
|
||||||
</span>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row gap-4 max-w-full w-full items-end">
|
<div class="flex flex-row gap-4 max-w-full w-full items-end">
|
||||||
@@ -86,7 +98,7 @@
|
|||||||
<span class="text-primary-900 dark:text-primary-100">
|
<span class="text-primary-900 dark:text-primary-100">
|
||||||
{data.page * 20}
|
{data.page * 20}
|
||||||
</span>
|
</span>
|
||||||
posts
|
posts
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
</Pageination>
|
</Pageination>
|
||||||
|
|||||||
Reference in new issue
Block a user