[WiP] intermediate merge
This commit is contained in:
parent
21bf779f24
commit
737a77ae9a
|
@ -1,6 +1,6 @@
|
|||
import styles from './DialogCard.module.scss'
|
||||
import DialogAvatar from './DialogAvatar'
|
||||
import type { Author, Chat, User } from '../../graphql/types.gen'
|
||||
import type { Author, Chat, ChatMember, User } from '../../graphql/types.gen'
|
||||
import { apiClient } from '../../utils/apiClient'
|
||||
import { t } from '../../utils/intl'
|
||||
import { useInbox } from '../../context/inbox'
|
||||
|
@ -9,22 +9,19 @@ type DialogProps = {
|
|||
online?: boolean
|
||||
message?: string
|
||||
counter?: number
|
||||
users: unknown[]
|
||||
theme?: string
|
||||
ownSlug: string
|
||||
members: ChatMember[]
|
||||
}
|
||||
|
||||
const DialogCard = (props: DialogProps) => {
|
||||
const companions = props.users.filter((user) => user !== props.ownSlug)
|
||||
const companions = props.members.filter((member) => member.slug !== props.ownSlug)
|
||||
console.log('!!! companions:', companions)
|
||||
return (
|
||||
<div class={styles.DialogCard}>
|
||||
<div class={styles.avatar}>{/*<DialogAvatar name={participants[0]} online={props.online} />*/}</div>
|
||||
<div class={styles.row}>
|
||||
{/*{companions.length > 1 && (*/}
|
||||
{/* <div class={styles.name}>*/}
|
||||
{/* */}
|
||||
{/* </div>*/}
|
||||
{/*)}*/}
|
||||
{companions.length > 1 ? <div>Group</div> : <div class={styles.name}>{companions[0].name}</div>}
|
||||
<div class={styles.message}>
|
||||
Указать предпочтительные языки для результатов поиска можно в разделе
|
||||
</div>
|
||||
|
|
|
@ -112,7 +112,7 @@ export const InboxView = () => {
|
|||
try {
|
||||
const response = await loadChats()
|
||||
setChats(response as unknown as Chat[])
|
||||
console.log('!!! response:', response)
|
||||
console.log('!!! chats:', response)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ export const InboxView = () => {
|
|||
<div class="holder">
|
||||
<div class="dialogs">
|
||||
<For each={chats()}>
|
||||
{(chat) => <DialogCard users={chat.users} ownSlug={currentSlug()} />}
|
||||
{(chat) => <DialogCard theme={chat.title} members={chat.members} ownSlug={currentSlug()} />}
|
||||
</For>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -6,8 +6,13 @@ export default gql`
|
|||
error
|
||||
chats {
|
||||
id
|
||||
title
|
||||
admins
|
||||
users
|
||||
members {
|
||||
slug
|
||||
name
|
||||
userpic
|
||||
}
|
||||
unread
|
||||
description
|
||||
updatedAt
|
||||
|
|
|
@ -54,17 +54,18 @@ export type AuthorsBy = {
|
|||
}
|
||||
|
||||
export type Chat = {
|
||||
admins?: Maybe<Array<Maybe<User>>>
|
||||
admins?: Maybe<Array<Maybe<Scalars['String']>>>
|
||||
createdAt: Scalars['Int']
|
||||
createdBy: User
|
||||
createdBy: Scalars['String']
|
||||
description?: Maybe<Scalars['String']>
|
||||
id: Scalars['String']
|
||||
messages: Array<Maybe<Message>>
|
||||
members?: Maybe<Array<Maybe<ChatMember>>>
|
||||
messages?: Maybe<Array<Maybe<Message>>>
|
||||
private?: Maybe<Scalars['Boolean']>
|
||||
title?: Maybe<Scalars['String']>
|
||||
unread?: Maybe<Scalars['Int']>
|
||||
updatedAt: Scalars['Int']
|
||||
users: Array<Maybe<User>>
|
||||
users?: Maybe<Array<Maybe<Scalars['String']>>>
|
||||
}
|
||||
|
||||
export type ChatInput = {
|
||||
|
@ -75,8 +76,6 @@ export type ChatInput = {
|
|||
|
||||
export type ChatMember = {
|
||||
id: Scalars['Int']
|
||||
invitedAt?: Maybe<Scalars['DateTime']>
|
||||
invitedBy?: Maybe<Scalars['String']>
|
||||
lastSeen?: Maybe<Scalars['DateTime']>
|
||||
name: Scalars['String']
|
||||
slug: Scalars['String']
|
||||
|
@ -136,6 +135,7 @@ export type LoadShoutsOptions = {
|
|||
offset?: InputMaybe<Scalars['Int']>
|
||||
order_by?: InputMaybe<Scalars['String']>
|
||||
order_by_desc?: InputMaybe<Scalars['Boolean']>
|
||||
with_author_captions?: InputMaybe<Scalars['Boolean']>
|
||||
}
|
||||
|
||||
export type Message = {
|
||||
|
@ -178,7 +178,6 @@ export type Mutation = {
|
|||
follow: Result
|
||||
getSession: AuthResult
|
||||
inviteAuthor: Result
|
||||
inviteChat: Result
|
||||
markAsRead: Result
|
||||
rateUser: Result
|
||||
registerUser: AuthResult
|
||||
|
@ -214,7 +213,7 @@ export type MutationCreateReactionArgs = {
|
|||
}
|
||||
|
||||
export type MutationCreateShoutArgs = {
|
||||
inp: ShoutInput
|
||||
input: ShoutInput
|
||||
}
|
||||
|
||||
export type MutationCreateTopicArgs = {
|
||||
|
@ -252,11 +251,6 @@ export type MutationInviteAuthorArgs = {
|
|||
shout: Scalars['String']
|
||||
}
|
||||
|
||||
export type MutationInviteChatArgs = {
|
||||
chatId: Scalars['String']
|
||||
userslug: Scalars['String']
|
||||
}
|
||||
|
||||
export type MutationMarkAsReadArgs = {
|
||||
chatId: Scalars['String']
|
||||
ids: Array<InputMaybe<Scalars['Int']>>
|
||||
|
|
|
@ -17,7 +17,6 @@ main {
|
|||
flex: 1;
|
||||
flex-direction: column;
|
||||
position: fixed;
|
||||
z-index: 900;
|
||||
|
||||
.row {
|
||||
flex: 1;
|
||||
|
|
Loading…
Reference in New Issue
Block a user