From 21bf779f244742394b9bfc99b8d5fb380f3367ad Mon Sep 17 00:00:00 2001 From: ilya-bkv Date: Sun, 27 Nov 2022 14:45:36 +0300 Subject: [PATCH] Chat list [WiP] --- src/components/Inbox/DialogCard.tsx | 19 ++++++++++--------- src/components/Views/Inbox.tsx | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/Inbox/DialogCard.tsx b/src/components/Inbox/DialogCard.tsx index 5d19919e..e921ba45 100644 --- a/src/components/Inbox/DialogCard.tsx +++ b/src/components/Inbox/DialogCard.tsx @@ -1,6 +1,6 @@ import styles from './DialogCard.module.scss' import DialogAvatar from './DialogAvatar' -import type { Author, User } from '../../graphql/types.gen' +import type { Author, Chat, User } from '../../graphql/types.gen' import { apiClient } from '../../utils/apiClient' import { t } from '../../utils/intl' import { useInbox } from '../../context/inbox' @@ -9,21 +9,22 @@ type DialogProps = { online?: boolean message?: string counter?: number - users: User[] - ownSlug: User['slug'] + users: unknown[] + ownSlug: string } const DialogCard = (props: DialogProps) => { - // @ts-ignore - const participants = props.users.filter((user) => user !== props.ownSlug) - console.log('!!! participants:', participants) - // @ts-ignore + const companions = props.users.filter((user) => user !== props.ownSlug) + console.log('!!! companions:', companions) return ( - //DialogCardView - подумать
{/**/}
- {/*
{participants[0]}
*/} + {/*{companions.length > 1 && (*/} + {/*
*/} + {/* */} + {/*
*/} + {/*)}*/}
Указать предпочтительные языки для результатов поиска можно в разделе
diff --git a/src/components/Views/Inbox.tsx b/src/components/Views/Inbox.tsx index f339cc84..92b25463 100644 --- a/src/components/Views/Inbox.tsx +++ b/src/components/Views/Inbox.tsx @@ -112,6 +112,7 @@ export const InboxView = () => { try { const response = await loadChats() setChats(response as unknown as Chat[]) + console.log('!!! response:', response) } catch (error) { console.log(error) }