From afef6d3639c0aae996479f6b509f3eee07581cc0 Mon Sep 17 00:00:00 2001 From: ilya-bkv Date: Mon, 28 Nov 2022 07:10:13 +0300 Subject: [PATCH] [WiP] messages render --- src/components/Inbox/CreateModalContent.tsx | 3 +-- src/components/Inbox/DialogCard.tsx | 13 ++++++++++--- src/components/Views/Inbox.tsx | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/Inbox/CreateModalContent.tsx b/src/components/Inbox/CreateModalContent.tsx index c1f927c8..c34b6158 100644 --- a/src/components/Inbox/CreateModalContent.tsx +++ b/src/components/Inbox/CreateModalContent.tsx @@ -59,12 +59,11 @@ const CreateModalContent = (props: Props) => { const { chatEntities, actions } = useInbox() - console.log('!!! chatEntities:', chatEntities) - const handleCreate = async () => { try { const initChat = await actions.createChat(slugs(), theme()) console.debug('[initChat]', initChat) + hideModal() } catch (error) { console.error(error) } diff --git a/src/components/Inbox/DialogCard.tsx b/src/components/Inbox/DialogCard.tsx index 63696d21..3988966f 100644 --- a/src/components/Inbox/DialogCard.tsx +++ b/src/components/Inbox/DialogCard.tsx @@ -9,7 +9,7 @@ type DialogProps = { online?: boolean message?: string counter?: number - theme?: string + title?: string ownSlug: string members: ChatMember[] } @@ -19,9 +19,16 @@ const DialogCard = (props: DialogProps) => { console.log('!!! companions:', companions) return (
-
{/**/}
+
+ +
+
- {companions.length > 1 ?
Group
:
{companions[0].name}
} + {companions.length > 1 ? ( +
{props.title}
+ ) : ( +
{companions[0].name}
+ )}
Указать предпочтительные языки для результатов поиска можно в разделе
diff --git a/src/components/Views/Inbox.tsx b/src/components/Views/Inbox.tsx index 62ab81dd..df975df0 100644 --- a/src/components/Views/Inbox.tsx +++ b/src/components/Views/Inbox.tsx @@ -168,7 +168,7 @@ export const InboxView = () => {
- {(chat) => } + {(chat) => }