hidden note styles
This commit is contained in:
parent
01c15c30a4
commit
152970288d
@ -181,3 +181,16 @@
|
|||||||
.light .note.active>.footer>.reaction-pill.reacted {
|
.light .note.active>.footer>.reaction-pill.reacted {
|
||||||
color: var(--highlight);
|
color: var(--highlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hidden-note .header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card.note.hidden-note {
|
||||||
|
min-height: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden-note button {
|
||||||
|
max-height: 30px;
|
||||||
|
}
|
||||||
|
@ -30,7 +30,7 @@ export interface NoteProps {
|
|||||||
const HiddenNote = ({ children }: any) => {
|
const HiddenNote = ({ children }: any) => {
|
||||||
const [show, setShow] = useState(false)
|
const [show, setShow] = useState(false)
|
||||||
return show ? children : (
|
return show ? children : (
|
||||||
<div className="card">
|
<div className="card note hidden-note">
|
||||||
<div className="header">
|
<div className="header">
|
||||||
<p>
|
<p>
|
||||||
This note was hidden because of your moderation settings
|
This note was hidden because of your moderation settings
|
||||||
|
@ -20,8 +20,6 @@ export default function NoteReaction(props: NoteReactionProps) {
|
|||||||
const { ["data-ev"]: dataEv, data } = props;
|
const { ["data-ev"]: dataEv, data } = props;
|
||||||
const ev = useMemo(() => dataEv || new NEvent(data), [data, dataEv])
|
const ev = useMemo(() => dataEv || new NEvent(data), [data, dataEv])
|
||||||
const { isMuted } = useModeration();
|
const { isMuted } = useModeration();
|
||||||
const pRef = data?.tags.find((a: any) => a[0] === "p")?.at(1);
|
|
||||||
const isRefMuted = pRef && isMuted(pRef)
|
|
||||||
|
|
||||||
const refEvent = useMemo(() => {
|
const refEvent = useMemo(() => {
|
||||||
if (ev) {
|
if (ev) {
|
||||||
@ -53,13 +51,13 @@ export default function NoteReaction(props: NoteReactionProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const root = extractRoot();
|
const root = extractRoot();
|
||||||
|
const isOpMuted = root && isMuted(root.pubkey)
|
||||||
const opt = {
|
const opt = {
|
||||||
showHeader: ev?.Kind === EventKind.Repost,
|
showHeader: ev?.Kind === EventKind.Repost,
|
||||||
showFooter: false,
|
showFooter: false,
|
||||||
};
|
};
|
||||||
const isOpMuted = root && isMuted(root.pubkey)
|
|
||||||
|
|
||||||
return isOpMuted || isRefMuted ? null : (
|
return isOpMuted ? null : (
|
||||||
<div className="reaction">
|
<div className="reaction">
|
||||||
<div className="header flex">
|
<div className="header flex">
|
||||||
<ProfileImage pubkey={ev.RootPubKey} />
|
<ProfileImage pubkey={ev.RootPubKey} />
|
||||||
|
Loading…
Reference in New Issue
Block a user