Chat list [WiP]
This commit is contained in:
parent
ba7395f4b7
commit
21bf779f24
|
@ -1,6 +1,6 @@
|
||||||
import styles from './DialogCard.module.scss'
|
import styles from './DialogCard.module.scss'
|
||||||
import DialogAvatar from './DialogAvatar'
|
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 { apiClient } from '../../utils/apiClient'
|
||||||
import { t } from '../../utils/intl'
|
import { t } from '../../utils/intl'
|
||||||
import { useInbox } from '../../context/inbox'
|
import { useInbox } from '../../context/inbox'
|
||||||
|
@ -9,21 +9,22 @@ type DialogProps = {
|
||||||
online?: boolean
|
online?: boolean
|
||||||
message?: string
|
message?: string
|
||||||
counter?: number
|
counter?: number
|
||||||
users: User[]
|
users: unknown[]
|
||||||
ownSlug: User['slug']
|
ownSlug: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const DialogCard = (props: DialogProps) => {
|
const DialogCard = (props: DialogProps) => {
|
||||||
// @ts-ignore
|
const companions = props.users.filter((user) => user !== props.ownSlug)
|
||||||
const participants = props.users.filter((user) => user !== props.ownSlug)
|
console.log('!!! companions:', companions)
|
||||||
console.log('!!! participants:', participants)
|
|
||||||
// @ts-ignore
|
|
||||||
return (
|
return (
|
||||||
//DialogCardView - подумать
|
|
||||||
<div class={styles.DialogCard}>
|
<div class={styles.DialogCard}>
|
||||||
<div class={styles.avatar}>{/*<DialogAvatar name={participants[0]} online={props.online} />*/}</div>
|
<div class={styles.avatar}>{/*<DialogAvatar name={participants[0]} online={props.online} />*/}</div>
|
||||||
<div class={styles.row}>
|
<div class={styles.row}>
|
||||||
{/*<div class={styles.name}>{participants[0]}</div>*/}
|
{/*{companions.length > 1 && (*/}
|
||||||
|
{/* <div class={styles.name}>*/}
|
||||||
|
{/* */}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/*)}*/}
|
||||||
<div class={styles.message}>
|
<div class={styles.message}>
|
||||||
Указать предпочтительные языки для результатов поиска можно в разделе
|
Указать предпочтительные языки для результатов поиска можно в разделе
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -112,6 +112,7 @@ export const InboxView = () => {
|
||||||
try {
|
try {
|
||||||
const response = await loadChats()
|
const response = await loadChats()
|
||||||
setChats(response as unknown as Chat[])
|
setChats(response as unknown as Chat[])
|
||||||
|
console.log('!!! response:', response)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user