diff --git a/src/graphql/types.gen.ts b/src/graphql/types.gen.ts index 7f93f85e..81c1ac59 100644 --- a/src/graphql/types.gen.ts +++ b/src/graphql/types.gen.ts @@ -24,18 +24,30 @@ export type AuthResult = { export type Author = { bio?: Maybe caption?: Maybe + id: Scalars['Int'] + lastSeen?: Maybe links?: Maybe>> name: Scalars['String'] + roles?: Maybe>> slug: Scalars['String'] + stat?: Maybe userpic?: Maybe } +export type AuthorStat = { + followers?: Maybe + followings?: Maybe + rating?: Maybe +} + export type Chat = { + admins?: Maybe>> createdAt: Scalars['Int'] createdBy: User description?: Maybe - id: Scalars['Int'] + id: Scalars['String'] messages: Array> + private?: Maybe title?: Maybe unread?: Maybe updatedAt: Scalars['Int'] @@ -52,8 +64,8 @@ export type ChatMember = { invitedAt?: Maybe invitedBy?: Maybe name: Scalars['String'] - pic?: Maybe slug: Scalars['String'] + userpic?: Maybe } export type Collab = { @@ -69,6 +81,7 @@ export type Collection = { createdAt: Scalars['DateTime'] createdBy: User desc?: Maybe + id: Scalars['Int'] publishedAt?: Maybe slug: Scalars['String'] title: Scalars['String'] @@ -84,6 +97,7 @@ export type Community = { createdAt: Scalars['DateTime'] createdBy: User desc?: Maybe + id: Scalars['Int'] name: Scalars['String'] pic: Scalars['String'] slug: Scalars['String'] @@ -108,7 +122,7 @@ export type Message = { chatId: Scalars['String'] createdAt: Scalars['Int'] id: Scalars['Int'] - replyTo?: Maybe + replyTo?: Maybe updatedAt?: Maybe } @@ -127,6 +141,7 @@ export type Mutation = { createReaction: Result createShout: Result createTopic: Result + deleteChat: Result deleteCollection: Result deleteCommunity: Result deleteMessage: Result @@ -175,7 +190,7 @@ export type MutationCreateCommunityArgs = { export type MutationCreateMessageArgs = { body: Scalars['String'] chatId: Scalars['String'] - replyTo?: InputMaybe + replyTo?: InputMaybe } export type MutationCreateReactionArgs = { @@ -190,6 +205,10 @@ export type MutationCreateTopicArgs = { input: TopicInput } +export type MutationDeleteChatArgs = { + chatId: Scalars['String'] +} + export type MutationDeleteCollectionArgs = { slug: Scalars['String'] } @@ -327,19 +346,21 @@ export type ProfileInput = { } export type Query = { - authorsAll: Array> + authorsAll: Array> collectionsAll: Array> + getAuthor: User getCollabs: Array> getCommunities: Array> getCommunity: Community getShoutBySlug: Shout + getTopic: Topic getUserCollections: Array> getUserRoles: Array> - getUsersBySlugs: Array> + getUsersBySlugs: Array> isEmailUsed: Scalars['Boolean'] - loadChat: Array> + loadChats: Result + loadMessages: Result markdownBody: Scalars['String'] - myChats: Array> reactionsByAuthor: Array> reactionsForShouts: Array> recentAll: Array> @@ -347,10 +368,14 @@ export type Query = { recentCommented: Array> recentPublished: Array> recentReacted: Array> + searchChats: Result + searchMessages: Result searchQuery?: Maybe>> + searchUsers: Result shoutsByAuthors: Array> shoutsByCollection: Array> shoutsByCommunities: Array> + shoutsByLayout: Array> shoutsByTopics: Array> shoutsForFeed: Array> signIn: AuthResult @@ -364,13 +389,17 @@ export type Query = { topicsByAuthor: Array> topicsByCommunity: Array> topicsRandom: Array> - userFollowedAuthors: Array> + userFollowedAuthors: Array> userFollowedCommunities: Array> userFollowedTopics: Array> - userFollowers: Array> + userFollowers: Array> userReactedShouts: Array> } +export type QueryGetAuthorArgs = { + slug: Scalars['String'] +} + export type QueryGetCommunityArgs = { slug?: InputMaybe } @@ -379,6 +408,10 @@ export type QueryGetShoutBySlugArgs = { slug: Scalars['String'] } +export type QueryGetTopicArgs = { + slug: Scalars['String'] +} + export type QueryGetUserCollectionsArgs = { author: Scalars['String'] } @@ -395,7 +428,12 @@ export type QueryIsEmailUsedArgs = { email: Scalars['String'] } -export type QueryLoadChatArgs = { +export type QueryLoadChatsArgs = { + amount?: InputMaybe + offset?: InputMaybe +} + +export type QueryLoadMessagesArgs = { amount?: InputMaybe chatId: Scalars['String'] offset?: InputMaybe @@ -442,12 +480,30 @@ export type QueryRecentReactedArgs = { offset: Scalars['Int'] } +export type QuerySearchChatsArgs = { + amount?: InputMaybe + offset?: InputMaybe + q: Scalars['String'] +} + +export type QuerySearchMessagesArgs = { + amount?: InputMaybe + offset?: InputMaybe + q: Scalars['String'] +} + export type QuerySearchQueryArgs = { limit: Scalars['Int'] offset: Scalars['Int'] q?: InputMaybe } +export type QuerySearchUsersArgs = { + amount?: InputMaybe + offset?: InputMaybe + q: Scalars['String'] +} + export type QueryShoutsByAuthorsArgs = { limit: Scalars['Int'] offset: Scalars['Int'] @@ -466,6 +522,12 @@ export type QueryShoutsByCommunitiesArgs = { slugs: Array> } +export type QueryShoutsByLayoutArgs = { + amount: Scalars['Int'] + layout?: InputMaybe + offset: Scalars['Int'] +} + export type QueryShoutsByTopicsArgs = { limit: Scalars['Int'] offset: Scalars['Int'] @@ -606,8 +668,8 @@ export type Resource = { } export type Result = { - author?: Maybe - authors?: Maybe>> + author?: Maybe + authors?: Maybe>> chat?: Maybe chats?: Maybe>> communities?: Maybe>> @@ -620,8 +682,10 @@ export type Result = { reactions?: Maybe>> shout?: Maybe shouts?: Maybe>> + slugs?: Maybe>> topic?: Maybe topics?: Maybe>> + uids?: Maybe>> } export type Role = { @@ -640,7 +704,6 @@ export type Shout = { createdAt: Scalars['DateTime'] deletedAt?: Maybe deletedBy?: Maybe - draft?: Maybe id: Scalars['Int'] lang?: Maybe layout?: Maybe @@ -654,8 +717,8 @@ export type Shout = { topics?: Maybe>> updatedAt?: Maybe updatedBy?: Maybe - versionOf?: Maybe - visibleFor?: Maybe>> + versionOf?: Maybe + visibility?: Maybe } export type ShoutInput = { diff --git a/src/stores/inbox.ts b/src/stores/inbox.ts index 7223b188..bbf7c471 100644 --- a/src/stores/inbox.ts +++ b/src/stores/inbox.ts @@ -1,4 +1,4 @@ import { atom } from 'nanostores' -import type { ChatResult } from '../graphql/types.gen' +import type { Chat } from '../graphql/types.gen' -export const chats = atom([]) +export const chats = atom([]) diff --git a/src/styles/Inbox.scss b/src/styles/Inbox.scss index fab4cbfb..581f29db 100644 --- a/src/styles/Inbox.scss +++ b/src/styles/Inbox.scss @@ -4,6 +4,10 @@ main { flex-direction: column; position: relative; } +// TODO: добавлять когда открыт чат +body { + overflow: hidden; +} .messages { top: 74px; @@ -17,7 +21,7 @@ main { flex: 1; flex-direction: column; position: fixed; - z-index: 1; + z-index: 9; > .row { flex: 1; diff --git a/src/utils/config.ts b/src/utils/config.ts index ab0ab70b..8501f5bd 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -1,4 +1,6 @@ export const isDev = import.meta.env.MODE === 'development' -export const apiBaseUrl = 'https://newapi.discours.io' +export const apiBaseUrl = 'https://testapi.discours.io' +// export const apiBaseUrl = 'https://newapi.discours.io' +// testapi.discours.io // export const apiBaseUrl = 'http://localhost:8080'