From 336fc6726da0fdf9efd64965a7b14d6dfbeffda3 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Thu, 16 Jan 2025 16:56:56 +0100 Subject: [PATCH] fix(label): remove left padding for first visible label in array --- .../post/comment-tools/comment-tools.tsx | 24 ++++++++++++------- src/components/post/label/label.module.css | 4 ++++ src/components/post/label/label.tsx | 5 ++-- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/components/post/comment-tools/comment-tools.tsx b/src/components/post/comment-tools/comment-tools.tsx index 097ad922..00460168 100644 --- a/src/components/post/comment-tools/comment-tools.tsx +++ b/src/components/post/comment-tools/comment-tools.tsx @@ -222,16 +222,24 @@ const CommentToolsLabel = ({ cid, deleted, failed, editState, isReply, nsfw, rem const failedEdit = editState === 'failed'; const pendingEdit = editState === 'pending'; + const labels = [ + { show: nsfw, color: 'nsfw-red', text: t('nsfw') }, + { show: spoiler, color: 'black', text: t('spoiler') }, + { show: pending, color: 'yellow', text: t('pending') }, + { show: failed, color: 'red', text: t('failed') }, + { show: deleted, color: 'red', text: t('deleted') }, + { show: removed, color: 'red', text: t('removed') }, + { show: failedEdit, color: 'red', text: t('failed_edit') }, + { show: pendingEdit, color: 'yellow', text: t('pending_edit') }, + ]; + + const visibleLabels = labels.filter((label) => label.show); + return ( <> - {nsfw &&