From 953c65021e9ec7ce3fc8b10129ab31b079a2283e Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Mon, 17 Jul 2023 11:02:05 -0700 Subject: [PATCH] feat: Add controversial badge to posts --- src/lib/components/lemmy/Post.svelte | 48 +++++++++++-------- .../components/lemmy/comment/Comments.svelte | 4 +- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/lib/components/lemmy/Post.svelte b/src/lib/components/lemmy/Post.svelte index c9e2b0af..c81e7e7b 100644 --- a/src/lib/components/lemmy/Post.svelte +++ b/src/lib/components/lemmy/Post.svelte @@ -11,6 +11,7 @@ import Badge from '$lib/components/ui/Badge.svelte' import { Bookmark, + HandThumbDown, Icon, InformationCircle, Link, @@ -44,24 +45,32 @@ - {#if postRes.post.nsfw} - NSFW - {/if} - {#if postRes.saved} - - - - {/if} - {#if postRes.post.deleted || postRes.post.removed} - - - - {/if} - {#if postRes.post.featured_community || postRes.post.featured_local} - - - - {/if} + +
+ {#if postRes.post.nsfw} + NSFW + {/if} + {#if postRes.counts.score < 0 && postRes.counts.upvotes > 3 && postRes.counts.downvotes > 3} + + + + {/if} + {#if postRes.saved} + + + + {/if} + {#if postRes.post.deleted || postRes.post.removed} + + + + {/if} + {#if postRes.post.featured_community || postRes.post.featured_local} + + + + {/if} +
{new URL(postRes.post.url).hostname} diff --git a/src/lib/components/lemmy/comment/Comments.svelte b/src/lib/components/lemmy/comment/Comments.svelte index 52934329..fdd5d4dd 100644 --- a/src/lib/components/lemmy/comment/Comments.svelte +++ b/src/lib/components/lemmy/comment/Comments.svelte @@ -10,8 +10,6 @@ import { Color } from '$lib/ui/colors.js' import { fly } from 'svelte/transition' - const maxComments = 250 - export let nodes: CommentNodeI[] export let isParent: boolean export let post: Post @@ -64,7 +62,7 @@ ? '' : 'ml-2.5 mt-2 pl-2.5 border-l-2 border-black/10 dark:border-white/10'} > - {#each nodes.slice(0, maxComments) as node (node.comment_view.comment.id)} + {#each nodes as node (node.comment_view.comment.id)}