touchstudy-core 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/iconChatBubble.d.ts +3 -0
- package/dist/assets/iconChecked.d.ts +3 -0
- package/dist/assets/iconPersonActive.d.ts +3 -0
- package/dist/assets/iconPersonNoActive.d.ts +3 -0
- package/dist/assets/iconSendMessenger.d.ts +4 -0
- package/dist/components/Chats/ChatContainer.d.ts +0 -1
- package/dist/components/Chats/ChatHeader.d.ts +9 -6
- package/dist/components/Chats/ChatItem.d.ts +6 -21
- package/dist/components/Chats/ChatList.d.ts +1 -2
- package/dist/components/Chats/ChatRightItem.d.ts +1 -5
- package/dist/components/Chats/InputChat.d.ts +6 -3
- package/dist/components/Chats/apiClient/conversationService.d.ts +2 -0
- package/dist/components/Chats/configs/constants.d.ts +5 -0
- package/dist/components/Chats/configs/types.d.ts +79 -15
- package/dist/components/Chats/hooks/useChatContainer.d.ts +20 -25
- package/dist/components/Chats/hooks/useDialog.d.ts +6 -0
- package/dist/components/Chats/hooks/useMessageList.d.ts +3 -5
- package/dist/containers/Login/apiClient/index.d.ts +0 -1
- package/dist/containers/Login/views/Login.d.ts +3 -0
- package/dist/containers/Login/views/block/BlockLogin.d.ts +3 -0
- package/dist/index.css +349 -0
- package/dist/index.d.ts +12 -8
- package/dist/index.js +1612 -1225
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1591 -1214
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/TheAcademyDropdown.d.ts +10 -0
- package/dist/redux/commons/action.d.ts +1 -0
- package/dist/services/academyService.d.ts +3 -0
- package/dist/services/accountService.d.ts +5 -0
- package/dist/utils/constants.d.ts +11 -7
- package/dist/utils/hooks/index.d.ts +3 -0
- package/dist/utils/hooks/useAutoAcademyDomain.d.ts +2 -0
- package/dist/utils/{useGoogleSignOut.d.ts → hooks/useGoogleSignOut.d.ts} +1 -1
- package/dist/utils/{useLanguage.d.ts → hooks/useLanguage.d.ts} +1 -1
- package/dist/utils/hooks/useLogin.d.ts +7 -0
- package/dist/utils/hooks/useSwitchAcademy.d.ts +10 -0
- package/dist/utils/types/academy.d.ts +6 -0
- package/dist/utils/types/login.d.ts +33 -0
- package/package.json +2 -1
- package/dist/components/Chats/hooks/useConversationList.d.ts +0 -20
- package/dist/components/Chats/hooks/useExamList.d.ts +0 -6
@@ -1,5 +1,4 @@
|
|
1
1
|
import { FC } from "react";
|
2
|
-
import { Option } from "./configs/types";
|
3
2
|
export interface IExamOption {
|
4
3
|
id: number;
|
5
4
|
code: string;
|
@@ -8,11 +7,15 @@ export interface IExamOption {
|
|
8
7
|
startTime: string;
|
9
8
|
}
|
10
9
|
export interface IChatHeaderProps {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
fullName?: string;
|
11
|
+
examTitle?: string;
|
12
|
+
createdAt?: string;
|
13
|
+
durationExam?: string;
|
14
|
+
questionOrder?: number;
|
15
|
+
conversationId?: number;
|
16
|
+
isCompleted?: boolean;
|
17
|
+
teacherName?: string;
|
18
|
+
roles?: Array<string>;
|
16
19
|
}
|
17
20
|
declare const ChatHeader: FC<IChatHeaderProps>;
|
18
21
|
export default ChatHeader;
|
@@ -1,35 +1,20 @@
|
|
1
1
|
import { FC } from "react";
|
2
|
-
import
|
3
|
-
import { MessageStatus } from "./configs/types";
|
2
|
+
import { StudentsConversationResponse } from "./configs/types";
|
4
3
|
export interface IChatItemProps {
|
5
4
|
id?: number;
|
6
5
|
isMe?: boolean;
|
7
|
-
name: string;
|
8
6
|
avatar?: string;
|
9
|
-
isSystemLog?: boolean;
|
10
7
|
content?: string;
|
11
8
|
createdAt: string;
|
9
|
+
sender?: StudentsConversationResponse;
|
12
10
|
isRead: boolean;
|
13
|
-
|
14
|
-
examCode?: string;
|
15
|
-
examId?: number;
|
16
|
-
parentId?: number;
|
17
|
-
parentContent?: string;
|
18
|
-
showExamHeader?: boolean;
|
19
|
-
isFirst?: boolean;
|
20
|
-
isLast?: boolean;
|
21
|
-
actionLink?: string;
|
22
|
-
examTitle?: string;
|
23
|
-
selectedReplyMessageId?: number;
|
24
|
-
selectedReplyItemRef?: React.RefObject<HTMLLIElement>;
|
25
|
-
status: MessageStatus;
|
26
|
-
onToggleReply?: (id: number) => void;
|
11
|
+
contentType?: number;
|
27
12
|
}
|
28
13
|
export interface IChatItemWithActionProps extends IChatItemProps {
|
29
|
-
onAddExamMessage?: (examId: number, title: string, examCode: string) => void;
|
30
|
-
onReply?: (id: number, content: string, examId?: number) => void;
|
31
14
|
onReTrySendMessage?: () => void;
|
32
|
-
|
15
|
+
showTimestamp?: boolean;
|
16
|
+
showName?: boolean;
|
17
|
+
isStudent?: boolean;
|
33
18
|
}
|
34
19
|
export declare enum ChatItemType {
|
35
20
|
Default = 0,
|
@@ -2,9 +2,8 @@ import React, { FC } from "react";
|
|
2
2
|
import { IChatItemProps } from "./ChatItem";
|
3
3
|
export interface IChatListProps {
|
4
4
|
messages?: IChatItemProps[];
|
5
|
-
onAddExamMessage: (examId: number, examTitle: string, examCode: string) => void;
|
6
5
|
onReTrySendMessage?: () => void;
|
7
|
-
|
6
|
+
roles: Array<String>;
|
8
7
|
}
|
9
8
|
interface Props extends IChatListProps {
|
10
9
|
listItemRef: React.RefObject<HTMLUListElement>;
|
@@ -1,8 +1,4 @@
|
|
1
1
|
import { FC } from "react";
|
2
2
|
import { IChatItemWithActionProps } from "./ChatItem";
|
3
|
-
|
4
|
-
interface Props extends IChatItemWithActionProps {
|
5
|
-
onReTrySendMessage?: (req?: MessageRequest) => void;
|
6
|
-
}
|
7
|
-
declare const ChatRightItem: FC<Props>;
|
3
|
+
declare const ChatRightItem: FC<IChatItemWithActionProps>;
|
8
4
|
export default ChatRightItem;
|
@@ -1,11 +1,14 @@
|
|
1
1
|
import React, { FC } from "react";
|
2
2
|
export interface IInputChatProps {
|
3
3
|
text: string;
|
4
|
-
parentText?: string;
|
5
|
-
examTitle?: string;
|
6
4
|
onSubmit: () => void;
|
7
5
|
onChangeInput: (text: string) => void;
|
8
|
-
|
6
|
+
isCompleted?: boolean;
|
7
|
+
handleUploadImage: (file: File) => void;
|
8
|
+
selectedFile: {
|
9
|
+
content: string;
|
10
|
+
};
|
11
|
+
handleDeleteSelectedImage: () => void;
|
9
12
|
}
|
10
13
|
interface Props extends IInputChatProps {
|
11
14
|
inputRef: React.RefObject<HTMLInputElement>;
|
@@ -3,5 +3,7 @@ export declare const getListConversation: (query: ConversationFilter) => Promise
|
|
3
3
|
export declare const createConversation: (studentId: number) => Promise<import("axios").AxiosResponse<any, any>>;
|
4
4
|
export declare const apiAddMessage: (conversationId: number, message: MessageRequest) => Promise<import("axios").AxiosResponse<any, any>>;
|
5
5
|
export declare const getMessagesByConversation: (conversationId: number, filter: MessageFilter) => Promise<import("axios").AxiosResponse<any, any>>;
|
6
|
+
export declare const completeConversation: (conversationId: number) => Promise<import("axios").AxiosResponse<any, any>>;
|
6
7
|
export declare const apiMarkReadMessage: (conversationId: number, messageId: number) => Promise<import("axios").AxiosResponse<any, any>>;
|
7
8
|
export declare const apiGetConversationByUserId: (userId: number) => Promise<import("axios").AxiosResponse<any, any>>;
|
9
|
+
export declare const apiUploadFile: (file: FormData) => Promise<import("axios").AxiosResponse<any, any>>;
|
@@ -5,5 +5,10 @@ export declare enum ExamStatus {
|
|
5
5
|
Inprogress = "Inprogress",
|
6
6
|
Completed = "Completed"
|
7
7
|
}
|
8
|
+
export declare enum Roles {
|
9
|
+
Student = "Student",
|
10
|
+
Teacher = "Teacher",
|
11
|
+
Admin = "Admin"
|
12
|
+
}
|
8
13
|
export declare const CONVERSATION_DEFAULT_FILTER: ConversationFilter;
|
9
14
|
export declare const MESSAGE_DEFAULT_FILTER: MessageFilter;
|
@@ -6,15 +6,75 @@ export declare type ConversationResponse = {
|
|
6
6
|
lastMessage: MessageResponse;
|
7
7
|
totalUnReadMessage: number;
|
8
8
|
};
|
9
|
+
export declare type ConversationsResponse = {
|
10
|
+
id: number;
|
11
|
+
studentExamSessionId: number;
|
12
|
+
studentId: number;
|
13
|
+
question: ConversationQuestion;
|
14
|
+
isCompleted: boolean;
|
15
|
+
completedAt: string;
|
16
|
+
totalUnReadMessage: number;
|
17
|
+
lastMessage: string | null;
|
18
|
+
examTitle: string;
|
19
|
+
examId: number;
|
20
|
+
examSessionId: number;
|
21
|
+
duration: string;
|
22
|
+
startTime: string;
|
23
|
+
examCreatedAt: string;
|
24
|
+
createdAt: string;
|
25
|
+
teacherName: string;
|
26
|
+
};
|
27
|
+
export declare type ConversationQuestion = {
|
28
|
+
id: number;
|
29
|
+
title: string;
|
30
|
+
articleNumber: number;
|
31
|
+
questionOrder: number;
|
32
|
+
};
|
9
33
|
export declare type UserResponse = {
|
10
34
|
id: number;
|
11
|
-
|
35
|
+
fullName: string;
|
12
36
|
avatar: string;
|
13
37
|
};
|
14
38
|
export declare type ConversationFilter = {
|
15
39
|
currentPage: number;
|
16
40
|
pageSize: number;
|
17
41
|
textSearch: string;
|
42
|
+
hasConversation?: boolean;
|
43
|
+
studentId?: number;
|
44
|
+
sortColumnName?: string;
|
45
|
+
sortColumnDirection?: string;
|
46
|
+
};
|
47
|
+
export declare type ExamResponse = {
|
48
|
+
id: number;
|
49
|
+
examId: number;
|
50
|
+
title: string;
|
51
|
+
code: string;
|
52
|
+
description: string;
|
53
|
+
type: string;
|
54
|
+
createdBy: {
|
55
|
+
id: number;
|
56
|
+
phoneNumber: string;
|
57
|
+
email: string;
|
58
|
+
avatar: string;
|
59
|
+
fullName: string;
|
60
|
+
schoolName: string;
|
61
|
+
};
|
62
|
+
teacher: {
|
63
|
+
id: number;
|
64
|
+
phoneNumber?: string;
|
65
|
+
email: string;
|
66
|
+
avatar: string;
|
67
|
+
fullName: string;
|
68
|
+
schoolName: string;
|
69
|
+
};
|
70
|
+
imageUrl: string;
|
71
|
+
questionCount: number;
|
72
|
+
duration: string;
|
73
|
+
createdAt: Date;
|
74
|
+
examCreatedAt: Date;
|
75
|
+
startTime: Date;
|
76
|
+
status: number;
|
77
|
+
totalStudentsJoined: number;
|
18
78
|
};
|
19
79
|
export declare type MessageFilter = {
|
20
80
|
currentPage?: number;
|
@@ -24,6 +84,8 @@ export declare type MessageFilter = {
|
|
24
84
|
sortColumnName?: MessageSortBy;
|
25
85
|
examId?: number;
|
26
86
|
beforeDate?: string;
|
87
|
+
totalItems?: number;
|
88
|
+
totalPages?: number;
|
27
89
|
};
|
28
90
|
export declare enum MessageSortBy {
|
29
91
|
CreatedAt = "CreatedAt"
|
@@ -34,7 +96,7 @@ export declare enum OrderBy {
|
|
34
96
|
}
|
35
97
|
export declare enum StudentSortBy {
|
36
98
|
CreatedAt = "CreatedAt",
|
37
|
-
|
99
|
+
FullName = "FullName"
|
38
100
|
}
|
39
101
|
export declare enum StudentOrderBy {
|
40
102
|
ASC = "ASC",
|
@@ -42,26 +104,27 @@ export declare enum StudentOrderBy {
|
|
42
104
|
}
|
43
105
|
export declare type MessageResponse = {
|
44
106
|
id?: number;
|
45
|
-
isStudent: boolean;
|
46
107
|
conversationId?: number;
|
47
108
|
content: string;
|
48
109
|
isRead: boolean;
|
49
110
|
readAt?: string;
|
50
|
-
examId?: number;
|
51
111
|
createdAt: string;
|
52
|
-
|
53
|
-
action?: MessageAction;
|
54
|
-
isSystemLog?: boolean;
|
55
|
-
type?: MessageSourceType;
|
56
|
-
parentId?: number;
|
57
|
-
parentContent?: string;
|
112
|
+
sender?: StudentsConversationResponse;
|
58
113
|
};
|
59
|
-
export declare type
|
114
|
+
export declare type UploadFileResponse = {
|
115
|
+
fileName?: any;
|
116
|
+
uploaded: number;
|
117
|
+
url: string;
|
118
|
+
};
|
119
|
+
export declare type StudentsConversationResponse = {
|
60
120
|
id: number;
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
121
|
+
avatar: string;
|
122
|
+
grade: string;
|
123
|
+
email?: string;
|
124
|
+
major?: string;
|
125
|
+
fullName: string;
|
126
|
+
parentName?: string;
|
127
|
+
schoolName?: string;
|
65
128
|
};
|
66
129
|
export declare type MessageRequest = {
|
67
130
|
content: string;
|
@@ -70,6 +133,7 @@ export declare type MessageRequest = {
|
|
70
133
|
parentContent?: string;
|
71
134
|
examTitle?: string;
|
72
135
|
examCode?: string;
|
136
|
+
contentType?: number;
|
73
137
|
};
|
74
138
|
export declare enum MessageAction {
|
75
139
|
Default = 0,
|
@@ -1,51 +1,46 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { ConversationsResponse, MessageRequest, StudentsConversationResponse } from "../configs/types";
|
2
3
|
import { IChatItemProps } from "../ChatItem";
|
3
|
-
import { ConversationResponse, MessageResponse, MessageRequest, MessageStatus } from "../configs/types";
|
4
4
|
interface Props {
|
5
|
-
conversation?:
|
6
|
-
|
7
|
-
onUpdateLastMessage?: (message: MessageResponse) => void;
|
8
|
-
onUpdateConversation?: (conversation: ConversationResponse) => void;
|
9
|
-
onCreateConversationSuccess?: Function;
|
10
|
-
onGetMessagesSuccess?: Function;
|
11
|
-
examId?: number;
|
5
|
+
conversation?: ConversationsResponse;
|
6
|
+
student?: StudentsConversationResponse;
|
12
7
|
}
|
13
8
|
declare const useChatContainer: (props: Props) => {
|
14
9
|
chatHeaderProps: {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
10
|
+
fullName: string | undefined;
|
11
|
+
examTitle: string | undefined;
|
12
|
+
questionOrder: number | undefined;
|
13
|
+
conversationId: number | undefined;
|
14
|
+
isCompleted: boolean | undefined;
|
15
|
+
durationExam: string | undefined;
|
16
|
+
createdAt: string | undefined;
|
17
|
+
teacherName: string | undefined;
|
18
|
+
roles: any;
|
20
19
|
};
|
21
20
|
chatListProps: {
|
22
21
|
messages: IChatItemProps[];
|
23
|
-
onAddExamMessage: (examId: number, title: string, examCode: string) => void;
|
24
|
-
onReply: (parentId: number, content: string, examId?: number | undefined) => void;
|
25
22
|
onReTrySendMessage: () => Promise<void>;
|
23
|
+
roles: any;
|
26
24
|
};
|
27
25
|
inputProps: {
|
26
|
+
selectedFile: MessageRequest | null | undefined;
|
28
27
|
text: string;
|
29
|
-
parentText: string | undefined;
|
30
|
-
examTitle: string | undefined;
|
31
28
|
onChangeInput: (text: string) => void;
|
32
29
|
onSubmit: () => Promise<void>;
|
33
|
-
|
30
|
+
handleDeleteSelectedImage: () => void;
|
31
|
+
handleUploadImage: (file: File) => Promise<void>;
|
32
|
+
isCompleted: boolean | undefined;
|
34
33
|
};
|
35
34
|
isScrollToEnd: boolean;
|
36
35
|
isLoadingMessages: boolean;
|
37
|
-
exams: import("../configs/types").ExamResponse[] | undefined;
|
38
36
|
messageList: IChatItemProps[];
|
39
|
-
selectedConversation:
|
40
|
-
messageStatus: MessageStatus;
|
37
|
+
selectedConversation: ConversationsResponse | undefined;
|
41
38
|
messageFilter: import("../configs/types").MessageFilter;
|
42
39
|
handleToggleScrollToEnd: () => void;
|
43
|
-
handleLoadMoreMessages: () =>
|
44
|
-
getMessageList: (conversationId: number
|
45
|
-
handleFilterExam: (val: any) => void;
|
40
|
+
handleLoadMoreMessages: () => Promise<true | undefined>;
|
41
|
+
getMessageList: (conversationId: number) => Promise<void>;
|
46
42
|
setMessage: import("react").Dispatch<import("react").SetStateAction<MessageRequest | undefined>>;
|
47
43
|
resetMessages: () => void;
|
48
44
|
getMessageConversation: () => Promise<void>;
|
49
|
-
handleMarkRead: () => Promise<void>;
|
50
45
|
};
|
51
46
|
export default useChatContainer;
|
@@ -1,14 +1,12 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { MessageResponse, MessageFilter } from "../configs/types";
|
3
|
-
declare const useMessageList: (
|
3
|
+
declare const useMessageList: () => {
|
4
4
|
isLoading: boolean;
|
5
5
|
messageFilter: MessageFilter;
|
6
6
|
messages: MessageResponse[];
|
7
|
-
getMessageList: (conversationId: number
|
7
|
+
getMessageList: (conversationId: number) => Promise<void>;
|
8
8
|
setMessages: import("react").Dispatch<import("react").SetStateAction<MessageResponse[]>>;
|
9
9
|
resetMessages: () => void;
|
10
|
-
|
11
|
-
handleMarkReadMessage: (conversationId: number, messageId: number) => Promise<void>;
|
12
|
-
handleLoadMore: () => boolean | undefined;
|
10
|
+
handleLoadMore: (conversationId: number) => Promise<true | undefined>;
|
13
11
|
};
|
14
12
|
export default useMessageList;
|
@@ -3,6 +3,9 @@ import { INavigateProps } from "../../../utils/types";
|
|
3
3
|
import { Role } from "../configs/constants";
|
4
4
|
interface Props {
|
5
5
|
role?: Role;
|
6
|
+
homeAcademyUrl: string;
|
7
|
+
homeUrl: string;
|
8
|
+
registerUrl?: string;
|
6
9
|
}
|
7
10
|
declare const Login: FC<INavigateProps & Props>;
|
8
11
|
export default Login;
|