chore: formatting
This commit is contained in:
parent
0e3661afc6
commit
63950f1e6b
@ -580,13 +580,7 @@ export function NoteCreator() {
|
||||
if (!note.show) return null;
|
||||
return (
|
||||
<Modal id="note-creator" className="note-creator-modal" onClose={reset}>
|
||||
{note.sending && (
|
||||
<NoteBroadcaster
|
||||
evs={note.sending}
|
||||
onClose={reset}
|
||||
customRelays={note.selectedCustomRelays}
|
||||
/>
|
||||
)}
|
||||
{note.sending && <NoteBroadcaster evs={note.sending} onClose={reset} customRelays={note.selectedCustomRelays} />}
|
||||
{!note.sending && noteCreatorForm()}
|
||||
</Modal>
|
||||
);
|
||||
|
@ -28,13 +28,25 @@ export const NoteCreatorButton = ({ className }: { className?: string }) => {
|
||||
|
||||
const shouldHideNoteCreator = useMemo(() => {
|
||||
const isReply = replyTo && show;
|
||||
const hideOn = ["/settings", "/messages", "/new", "/login", "/donate", "/e", "/nevent", "/note1", "/naddr", "/subscribe"];
|
||||
const hideOn = [
|
||||
"/settings",
|
||||
"/messages",
|
||||
"/new",
|
||||
"/login",
|
||||
"/donate",
|
||||
"/e",
|
||||
"/nevent",
|
||||
"/note1",
|
||||
"/naddr",
|
||||
"/subscribe",
|
||||
];
|
||||
return (readonly || hideOn.some(a => location.pathname.startsWith(a))) && !isReply;
|
||||
}, [location, readonly]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{!shouldHideNoteCreator && <button
|
||||
{!shouldHideNoteCreator && (
|
||||
<button
|
||||
ref={buttonRef}
|
||||
className={classNames("primary circle", className)}
|
||||
onClick={() =>
|
||||
@ -44,7 +56,8 @@ export const NoteCreatorButton = ({ className }: { className?: string }) => {
|
||||
})
|
||||
}>
|
||||
<Icon name="plus" size={16} />
|
||||
</button>}
|
||||
</button>
|
||||
)}
|
||||
<NoteCreator key="global-note-creator" />
|
||||
</>
|
||||
);
|
||||
|
@ -38,5 +38,7 @@ export default function Modal(props: ModalProps) {
|
||||
{props.children}
|
||||
</div>
|
||||
</div>
|
||||
</div>, document.body);
|
||||
</div>,
|
||||
document.body,
|
||||
);
|
||||
}
|
||||
|
@ -51,5 +51,7 @@ export default function Toaster() {
|
||||
{a.element}
|
||||
</div>
|
||||
))}
|
||||
</div>, document.body);
|
||||
</div>,
|
||||
document.body,
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user