From 17f68088d1b8080b8f4579852e728a7ce562b768 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 8 Aug 2021 10:16:48 +0100 Subject: [PATCH] Show server identity in message replies and typing indicator. Revert reply connector temporarily. --- .../messaging/attachments/MessageReply.tsx | 14 +++++- .../common/messaging/bars/ReplyBar.tsx | 8 +++- .../common/messaging/bars/TypingIndicator.tsx | 43 ++++++++++--------- src/components/common/user/UserShort.tsx | 10 ++++- 4 files changed, 49 insertions(+), 26 deletions(-) diff --git a/src/components/common/messaging/attachments/MessageReply.tsx b/src/components/common/messaging/attachments/MessageReply.tsx index d966fecf..68f50d7b 100644 --- a/src/components/common/messaging/attachments/MessageReply.tsx +++ b/src/components/common/messaging/attachments/MessageReply.tsx @@ -1,3 +1,4 @@ +import { Reply } from "@styled-icons/boxicons-regular"; import { File } from "@styled-icons/boxicons-solid"; import { observer } from "mobx-react-lite"; import { useHistory } from "react-router-dom"; @@ -38,6 +39,9 @@ export const ReplyBase = styled.div<{ align-items: center; color: var(--secondary-foreground); + /* nizune's Discord replies, + does not scale properly with messages, + reverted temporarily &::before { content: ""; height: 10px; @@ -48,7 +52,7 @@ export const ReplyBase = styled.div<{ border-top: 2.2px solid var(--tertiary-foreground); border-inline-start: 2.2px solid var(--tertiary-foreground); border-start-start-radius: 6px; - } + }*/ * { overflow: hidden; @@ -153,6 +157,7 @@ export const MessageReply = observer(({ index, channel, id }: Props) => { if (!message) { return ( + @@ -164,6 +169,7 @@ export const MessageReply = observer(({ index, channel, id }: Props) => { return ( + {message.author?.relationship === RelationshipStatus.Blocked ? ( ) : ( @@ -173,7 +179,11 @@ export const MessageReply = observer(({ index, channel, id }: Props) => { ) : ( <>
- +
{
- +
{message.attachments && ( @@ -130,7 +134,7 @@ export default observer(({ channel, replies, setReplies }: Props) => { )} {message.author_id === SYSTEM_USER_ID ? ( - + ) : ( { if (users.length >= 5) { text = ; } else if (users.length > 1) { - const userlist = [...users].map((x) => x!.username); + const userlist = [...users].map((x) => ( + + )); const user = userlist.pop(); - /*for (let i = 0; i < userlist.length - 1; i++) { - userlist.splice(i * 2 + 1, 0, ", "); - }*/ + for (let i = 0; i < userlist.length - 1; i++) { + userlist.splice(i * 2 + 1, 0, , ); + } text = ( - ); } else { text = ( - , + }} /> ); } @@ -99,10 +101,11 @@ export default observer(({ channel }: Props) => {
{users.map((user) => ( - ))}
diff --git a/src/components/common/user/UserShort.tsx b/src/components/common/user/UserShort.tsx index 331796f7..61e7eeb2 100644 --- a/src/components/common/user/UserShort.tsx +++ b/src/components/common/user/UserShort.tsx @@ -61,14 +61,20 @@ export const Username = observer( export default function UserShort({ user, size, + showServerIdentity, }: { user?: User; size?: number; + showServerIdentity?: boolean; }) { return ( <> - - + + ); }