feat: combine crossposts in feeds
This commit is contained in:
1 parent
aeca64e895
commit
4047b43451
3 files changed
+151
-46
No files matched your search
@@ -1,20 +1,20 @@
|
||||
<script lang="ts">
|
||||
import type { PostView } from 'lemmy-js-client'
|
||||
import { isImage, isVideo } from '$lib/ui/image.js'
|
||||
import { getInstance } from '$lib/lemmy.js'
|
||||
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
|
||||
import { userSettings } from '$lib/settings.js'
|
||||
import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
|
||||
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||
import { Material, toast } from 'mono-svelte'
|
||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
|
||||
import { bestImageURL, postLink } from '$lib/components/lemmy/post/helpers.js'
|
||||
import Empty from '$lib/components/helper/Empty.svelte'
|
||||
import { publishedToDate } from '$lib/components/util/date.js'
|
||||
import { Icon, VideoCamera } from 'svelte-hero-icons'
|
||||
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
|
||||
import PostMediaCompact from '$lib/components/lemmy/post/media/PostMediaCompact.svelte'
|
||||
import type { PostView } from "lemmy-js-client"
|
||||
import { isImage, isVideo } from "$lib/ui/image.js"
|
||||
import { getInstance } from "$lib/lemmy.js"
|
||||
import PostActions from "$lib/components/lemmy/post/PostActions.svelte"
|
||||
import { userSettings } from "$lib/settings.js"
|
||||
import PostLink from "$lib/components/lemmy/post/PostLink.svelte"
|
||||
import PostMeta from "$lib/components/lemmy/post/PostMeta.svelte"
|
||||
import { Material, toast } from "mono-svelte"
|
||||
import Markdown from "$lib/components/markdown/Markdown.svelte"
|
||||
import ExpandableImage from "$lib/components/ui/ExpandableImage.svelte"
|
||||
import { bestImageURL, postLink } from "$lib/components/lemmy/post/helpers.js"
|
||||
import Empty from "$lib/components/helper/Empty.svelte"
|
||||
import { publishedToDate } from "$lib/components/util/date.js"
|
||||
import { Icon, VideoCamera } from "svelte-hero-icons"
|
||||
import PostMedia from "$lib/components/lemmy/post/media/PostMedia.svelte"
|
||||
import PostMediaCompact from "$lib/components/lemmy/post/media/PostMediaCompact.svelte"
|
||||
|
||||
export let post: PostView
|
||||
export let actions: boolean = true
|
||||
@@ -25,14 +25,14 @@
|
||||
</script>
|
||||
|
||||
<Material
|
||||
color={view != 'card' ? 'none' : 'distinct'}
|
||||
color={view != "card" ? "none" : "distinct"}
|
||||
padding="none"
|
||||
class="relative max-w-full min-w-0 w-full group
|
||||
{view != 'card' ? 'bg-transparent !border-0' : 'p-5'} {view == 'compact'
|
||||
? 'py-4'
|
||||
: view == 'list'
|
||||
? 'py-5'
|
||||
: 'py-5'}"
|
||||
: 'py-5'} {$$props.class}"
|
||||
id={post.post.id}
|
||||
>
|
||||
<div
|
||||
@@ -54,8 +54,10 @@
|
||||
featured={post.post.featured_local || post.post.featured_community}
|
||||
nsfw={post.post.nsfw}
|
||||
saved={post.saved}
|
||||
/>
|
||||
{#if post.post.embed_title != post.post.name || view == 'compact'}
|
||||
>
|
||||
<slot name="badges" slot="badges" />
|
||||
</PostMeta>
|
||||
{#if post.post.embed_title != post.post.name || view == "compact"}
|
||||
<a
|
||||
href="/post/{getInstance()}/{post.post.id}"
|
||||
class="font-medium max-w-full w-full break-words text-base"
|
||||
@@ -68,7 +70,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
<PostMedia bind:post={post.post} {view} />
|
||||
{#if post.post.body && !post.post.nsfw && view != 'compact'}
|
||||
{#if post.post.body && !post.post.nsfw && view != "compact"}
|
||||
<div
|
||||
class="text-sm relative overflow-hidden
|
||||
bg-gradient-to-b text-transparent from-slate-600 via-slate-600
|
||||
@@ -79,7 +81,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{#if view == 'list' || view == 'compact'}
|
||||
{#if view == "list" || view == "compact"}
|
||||
<PostMediaCompact {view} bind:post={post.post} />
|
||||
{/if}
|
||||
</div>
|
||||
@@ -89,8 +91,8 @@
|
||||
bind:post
|
||||
on:edit={(e) => {
|
||||
toast({
|
||||
content: 'The post was edited successfully.',
|
||||
type: 'success',
|
||||
content: "The post was edited successfully.",
|
||||
type: "success",
|
||||
})
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user