Fix: Emojis showing through spoilers.

Fix: Copy ID copies wrong ID.
Messaging: Add context menu to avatar / username.
This commit is contained in:
Paul
2021-06-24 16:43:37 +01:00
parent 363789c825
commit 3393795817
7 changed files with 34 additions and 11 deletions

View File

@@ -32,6 +32,8 @@ function Message({ attachContext, message, contrast, content: replacement, head:
const content = message.content as string;
const head = preferHead || (message.replies && message.replies.length > 0);
const userContext = attachContext ? attachContextMenu('Menu', { user: message.author, contextualChannel: message.channel }) : undefined as any; // ! FIXME: tell fatal to make this type generic
return (
<>
{ message.replies?.map((message_id, index) => <MessageReply index={index} id={message_id} channel={message.channel} />) }
@@ -44,12 +46,14 @@ function Message({ attachContext, message, contrast, content: replacement, head:
onContextMenu={attachContext ? attachContextMenu('Menu', { message, contextualChannel: message.channel, queued }) : undefined}>
<MessageInfo>
{ head ?
<UserIcon target={user} size={36} /> :
<UserIcon target={user} size={36} onContextMenu={userContext} /> :
<MessageDetail message={message} position="left" /> }
</MessageInfo>
<MessageContent>
{ head && <span className="author">
<Username user={user} />
{ head && <span className="detail">
<span className="author">
<Username user={user} onContextMenu={userContext} />
</span>
<MessageDetail message={message} position="top" />
</span> }
{ replacement ?? <Markdown content={content} /> }

View File

@@ -53,11 +53,19 @@ export default styled.div<BaseMessageProps>`
color: var(--error);
` }
.author {
.detail {
gap: 8px;
display: flex;
align-items: center;
}
.author {
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
.copy {
width: 0;
@@ -89,6 +97,10 @@ export const MessageInfo = styled.div`
color: var(--tertiary-foreground);
}
svg {
cursor: pointer;
}
time {
opacity: 0;
}