From 152970288d0cec9b1b91f83e9578478d0e98948e Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Sat, 28 Jan 2023 19:51:08 +0100 Subject: [PATCH] hidden note styles --- src/Element/Note.css | 13 +++++++++++++ src/Element/Note.tsx | 2 +- src/Element/NoteReaction.tsx | 6 ++---- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/Element/Note.css b/src/Element/Note.css index e58114dd..0d1c87ee 100644 --- a/src/Element/Note.css +++ b/src/Element/Note.css @@ -181,3 +181,16 @@ .light .note.active>.footer>.reaction-pill.reacted { color: var(--highlight); } + +.hidden-note .header { + display: flex; + align-items: center; +} + +.card.note.hidden-note { + min-height: unset; +} + +.hidden-note button { + max-height: 30px; +} diff --git a/src/Element/Note.tsx b/src/Element/Note.tsx index 2094424c..e6ff52eb 100644 --- a/src/Element/Note.tsx +++ b/src/Element/Note.tsx @@ -30,7 +30,7 @@ export interface NoteProps { const HiddenNote = ({ children }: any) => { const [show, setShow] = useState(false) return show ? children : ( -
+

This note was hidden because of your moderation settings diff --git a/src/Element/NoteReaction.tsx b/src/Element/NoteReaction.tsx index 771b72a8..2f7db624 100644 --- a/src/Element/NoteReaction.tsx +++ b/src/Element/NoteReaction.tsx @@ -20,8 +20,6 @@ export default function NoteReaction(props: NoteReactionProps) { const { ["data-ev"]: dataEv, data } = props; const ev = useMemo(() => dataEv || new NEvent(data), [data, dataEv]) const { isMuted } = useModeration(); - const pRef = data?.tags.find((a: any) => a[0] === "p")?.at(1); - const isRefMuted = pRef && isMuted(pRef) const refEvent = useMemo(() => { if (ev) { @@ -53,13 +51,13 @@ export default function NoteReaction(props: NoteReactionProps) { } const root = extractRoot(); + const isOpMuted = root && isMuted(root.pubkey) const opt = { showHeader: ev?.Kind === EventKind.Repost, showFooter: false, }; - const isOpMuted = root && isMuted(root.pubkey) - return isOpMuted || isRefMuted ? null : ( + return isOpMuted ? null : (