reply thread fix

This commit is contained in:
Martti Malmi 2023-08-24 21:33:00 +03:00
parent c556dfe63e
commit 3f26686f23
2 changed files with 14 additions and 9 deletions

View File

@ -64,21 +64,21 @@ const Note: React.FC<NoteProps> = ({
}
const computedIsQuote = useMemo(
() => isQuote || (!standalone && showReplies && replies.length),
() => isQuote || !!(!standalone && showReplies && replies.length),
[isQuote, standalone, showReplies, replies.length],
);
const computedIsQuoting = useMemo(
() => isQuoting || (replyingTo && showRepliedMsg),
() => isQuoting || !!(replyingTo && showRepliedMsg),
[isQuoting, replyingTo, showRepliedMsg],
);
const className = useMemo(() => {
return classNames({
'cursor-pointer transition-all ease-in-out duration-200 hover:bg-neutral-999': !standalone,
'quote pb-2': computedIsQuote,
'quoting pt-0': computedIsQuoting,
'pb-2': computedIsQuote,
'pt-0': computedIsQuoting,
'pt-4': !computedIsQuoting,
'inline-quote border-2 border-neutral-900 rounded-lg my-2': asInlineQuote,
'border-2 border-neutral-900 rounded-lg my-2': asInlineQuote,
'full-width':
fullWidth || (!isReply && !computedIsQuoting && !computedIsQuote && !asInlineQuote),
});
@ -113,7 +113,7 @@ const Note: React.FC<NoteProps> = ({
) : null;
const showThreadBtn = (
<Show when={!standalone && !showRepliedMsg && !isReply && !isQuoting && threadRootId}>
<Show when={!standalone && !showRepliedMsg && !isReply && !computedIsQuoting && threadRootId}>
<Link
className="text-iris-blue text-sm block mb-2"
href={`/${Key.toNostrBech32Address(threadRootId || '', 'note')}`}
@ -134,12 +134,17 @@ const Note: React.FC<NoteProps> = ({
{showThreadBtn}
<div className="flex flex-row" onClick={(e) => messageClicked(e)}>
<Show when={!fullWidth}>
<Avatar event={event} isQuote={isQuote} standalone={standalone} fullWidth={fullWidth} />
<Avatar
event={event}
isQuote={computedIsQuote}
standalone={standalone}
fullWidth={fullWidth}
/>
</Show>
<Content
event={event}
standalone={standalone}
isQuote={isQuote}
isQuote={computedIsQuote}
asInlineQuote={asInlineQuote}
fullWidth={fullWidth}
/>

View File

@ -90,7 +90,7 @@ export default {
"save": "Save",
"save_backup_of_privkey_first": "Save a backup of your private key first!",
"save_relays_publicly": "Save relays publicly",
"secret_chat_info": "This is a secret chat: Outsiders cannot see that you are messaging with each other.",
"secret_chat_info": "This is a secret chat. Outsiders cannot see that you are messaging with each other.",
"search": "Search",
"search_posts": "Search posts",
"send_message": "Message",