feat: make post communtiy subscribe buttons always visible
This commit is contained in:
1 parent
88aca6991f
commit
60dfbabc60
2 files changed
+23
-10
No files matched your search
@@ -20,6 +20,7 @@
|
|||||||
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
|
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
|
||||||
import PostMediaCompact from '$lib/components/lemmy/post/media/PostMediaCompact.svelte'
|
import PostMediaCompact from '$lib/components/lemmy/post/media/PostMediaCompact.svelte'
|
||||||
import PostBody from './PostBody.svelte'
|
import PostBody from './PostBody.svelte'
|
||||||
|
import { profile } from '$lib/auth'
|
||||||
|
|
||||||
export let post: PostView
|
export let post: PostView
|
||||||
export let actions: boolean = true
|
export let actions: boolean = true
|
||||||
@@ -61,6 +62,11 @@
|
|||||||
featured={post.post.featured_local || post.post.featured_community}
|
featured={post.post.featured_local || post.post.featured_community}
|
||||||
nsfw={post.post.nsfw}
|
nsfw={post.post.nsfw}
|
||||||
saved={post.saved}
|
saved={post.saved}
|
||||||
|
subscribed={$profile?.user?.follows
|
||||||
|
.map((c) => c.community.id)
|
||||||
|
.includes(post.community.id)
|
||||||
|
? 'Subscribed'
|
||||||
|
: 'NotSubscribed'}
|
||||||
>
|
>
|
||||||
<slot name="badges" slot="badges" />
|
<slot name="badges" slot="badges" />
|
||||||
</PostMeta>
|
</PostMeta>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if embed_title && !compact}
|
{#if embed_title && !compact}
|
||||||
<Material class="flex flex-row gap-4">
|
<Material color="distinct" class="flex flex-row gap-4">
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
{#if richURL}
|
{#if richURL}
|
||||||
<Link
|
<Link
|
||||||
@@ -29,21 +29,21 @@
|
|||||||
{embed_title}
|
{embed_title}
|
||||||
</a>
|
</a>
|
||||||
{#if embed_description}
|
{#if embed_description}
|
||||||
<p
|
<p class="text-sm">
|
||||||
class="text-sm text-transparent bg-clip-text bg-gradient-to-b
|
{embed_description.slice(0, 300)}{embed_description.length > 300
|
||||||
from-slate-700 dark:from-zinc-400
|
? '...'
|
||||||
via-slate-700 dark:via-zinc-400
|
: ''}
|
||||||
to-slate-700/0 dark:to-zinc-400/0"
|
|
||||||
>
|
|
||||||
{embed_description.slice(0, 300)}
|
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if thumbnail_url}
|
{#if thumbnail_url}
|
||||||
<a href={url} class="ml-auto max-w-[150px] w-full flex-shrink">
|
<a
|
||||||
|
href={url}
|
||||||
|
class="ml-auto w-full thumbnail rounded-r-lg overflow-hidden flex-shrink -m-4"
|
||||||
|
>
|
||||||
<img
|
<img
|
||||||
src={thumbnail_url}
|
src={thumbnail_url}
|
||||||
class="rounded-lg max-w-[200px] w-full h-full max-h-24 object-cover bg-slate-200 dark:bg-zinc-800"
|
class="w-full h-full object-cover bg-slate-200 dark:bg-zinc-800"
|
||||||
width={600}
|
width={600}
|
||||||
height={400}
|
height={400}
|
||||||
alt=""
|
alt=""
|
||||||
@@ -67,3 +67,10 @@
|
|||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.thumbnail {
|
||||||
|
max-width: 240px;
|
||||||
|
height: calc(100%+16px);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in new issue
Block a user