@magmamath/students-features 0.2.10 → 0.2.12
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/commonjs/features/chatbot/components/ChatControls/ChatControls.js +2 -2
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/commonjs/features/feedback/components/EmptyComment.js +4 -5
- package/dist/commonjs/features/feedback/components/EmptyComment.js.map +1 -1
- package/dist/commonjs/features/feedback/components/ListCardCommentsCount.js +1 -1
- package/dist/commonjs/features/feedback/components/TeacherFeedback.js +5 -6
- package/dist/commonjs/features/feedback/components/TeacherFeedback.js.map +1 -1
- package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js +32 -9
- package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js.map +1 -1
- package/dist/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherComment.js +1 -3
- package/dist/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherComment.js.map +1 -1
- package/dist/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.js +1 -8
- package/dist/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.js.map +1 -1
- package/dist/commonjs/features/feedback/components/UnreadMessagesBadge.js +1 -1
- package/dist/commonjs/features/feedback/components/UnreadMessagesBadge.js.map +1 -1
- package/dist/commonjs/features/feedback/constants.js +11 -3
- package/dist/commonjs/features/feedback/constants.js.map +1 -1
- package/dist/commonjs/features/feedback/helpers.js +24 -0
- package/dist/commonjs/features/feedback/helpers.js.map +1 -1
- package/dist/commonjs/features/feedback/model/api.js.map +1 -1
- package/dist/commonjs/features/feedback/model/comments.js +17 -33
- package/dist/commonjs/features/feedback/model/comments.js.map +1 -1
- package/dist/commonjs/features/feedback/model/model.js +5 -3
- package/dist/commonjs/features/feedback/model/model.js.map +1 -1
- package/dist/commonjs/features/feedback/types.js.map +1 -1
- package/dist/commonjs/lib/helpers/helpers.js +20 -16
- package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
- package/dist/commonjs/lib/localization/en.json +12 -0
- package/dist/commonjs/lib/localization/gb.json +12 -0
- package/dist/commonjs/lib/localization/sw.json +12 -0
- package/dist/commonjs/shared/icons/MessageBubbleIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/XCloseIcon.js.map +1 -0
- package/dist/commonjs/shared/translation/constants.js +1 -42
- package/dist/commonjs/shared/translation/constants.js.map +1 -1
- package/dist/commonjs/shared/translation/helpers.js.map +1 -1
- package/dist/commonjs/shared/translation/types.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +2 -2
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/module/features/feedback/components/EmptyComment.js +5 -6
- package/dist/module/features/feedback/components/EmptyComment.js.map +1 -1
- package/dist/module/features/feedback/components/ListCardCommentsCount.js +1 -1
- package/dist/module/features/feedback/components/ListCardCommentsCount.js.map +1 -1
- package/dist/module/features/feedback/components/TeacherFeedback.js +6 -7
- package/dist/module/features/feedback/components/TeacherFeedback.js.map +1 -1
- package/dist/module/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js +32 -9
- package/dist/module/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js.map +1 -1
- package/dist/module/features/feedback/components/TeacherFeedbackComments/TeacherComment.js +1 -3
- package/dist/module/features/feedback/components/TeacherFeedbackComments/TeacherComment.js.map +1 -1
- package/dist/module/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.js +2 -9
- package/dist/module/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.js.map +1 -1
- package/dist/module/features/feedback/components/UnreadMessagesBadge.js +1 -1
- package/dist/module/features/feedback/components/UnreadMessagesBadge.js.map +1 -1
- package/dist/module/features/feedback/constants.js +10 -2
- package/dist/module/features/feedback/constants.js.map +1 -1
- package/dist/module/features/feedback/helpers.js +23 -0
- package/dist/module/features/feedback/helpers.js.map +1 -1
- package/dist/module/features/feedback/model/api.js.map +1 -1
- package/dist/module/features/feedback/model/comments.js +14 -30
- package/dist/module/features/feedback/model/comments.js.map +1 -1
- package/dist/module/features/feedback/model/model.js +6 -4
- package/dist/module/features/feedback/model/model.js.map +1 -1
- package/dist/module/features/feedback/types.js.map +1 -1
- package/dist/module/lib/helpers/helpers.js +20 -16
- package/dist/module/lib/helpers/helpers.js.map +1 -1
- package/dist/module/lib/localization/en.json +12 -0
- package/dist/module/lib/localization/gb.json +12 -0
- package/dist/module/lib/localization/sw.json +12 -0
- package/dist/module/shared/icons/MessageBubbleIcon.js.map +1 -0
- package/dist/module/shared/icons/XCloseIcon.js.map +1 -0
- package/dist/module/shared/translation/constants.js +0 -41
- package/dist/module/shared/translation/constants.js.map +1 -1
- package/dist/module/shared/translation/helpers.js.map +1 -1
- package/dist/module/shared/translation/types.js.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/components/EmptyComment.d.ts +1 -6
- package/dist/typescript/commonjs/features/feedback/components/EmptyComment.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedback.d.ts +5 -5
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedback.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherComment.d.ts +2 -4
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherComment.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.d.ts +2 -4
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/components/UnreadMessagesBadge.d.ts +1 -1
- package/dist/typescript/commonjs/features/feedback/components/UnreadMessagesBadge.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/constants.d.ts +2 -2
- package/dist/typescript/commonjs/features/feedback/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/helpers.d.ts +10 -1
- package/dist/typescript/commonjs/features/feedback/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/model/api.d.ts +6 -2
- package/dist/typescript/commonjs/features/feedback/model/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/model/comments.d.ts +10 -12
- package/dist/typescript/commonjs/features/feedback/model/comments.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/model/model.d.ts +4 -7
- package/dist/typescript/commonjs/features/feedback/model/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/types.d.ts +8 -1
- package/dist/typescript/commonjs/features/feedback/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts +1 -2
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/MessageBubbleIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/XCloseIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +38 -40
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/types.d.ts +4 -1
- package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/components/EmptyComment.d.ts +1 -6
- package/dist/typescript/module/features/feedback/components/EmptyComment.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/components/TeacherFeedback.d.ts +5 -5
- package/dist/typescript/module/features/feedback/components/TeacherFeedback.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackComments/TeacherComment.d.ts +2 -4
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackComments/TeacherComment.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.d.ts +2 -4
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/components/UnreadMessagesBadge.d.ts +1 -1
- package/dist/typescript/module/features/feedback/components/UnreadMessagesBadge.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/constants.d.ts +2 -2
- package/dist/typescript/module/features/feedback/constants.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/helpers.d.ts +10 -1
- package/dist/typescript/module/features/feedback/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/model/api.d.ts +6 -2
- package/dist/typescript/module/features/feedback/model/api.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/model/comments.d.ts +10 -12
- package/dist/typescript/module/features/feedback/model/comments.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/model/model.d.ts +4 -7
- package/dist/typescript/module/features/feedback/model/model.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/types.d.ts +8 -1
- package/dist/typescript/module/features/feedback/types.d.ts.map +1 -1
- package/dist/typescript/module/lib/helpers/helpers.d.ts +1 -2
- package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/MessageBubbleIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/XCloseIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/constants.d.ts +38 -40
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/helpers.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/types.d.ts +4 -1
- package/dist/typescript/module/shared/translation/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/chatbot/components/ChatControls/ChatControls.tsx +2 -2
- package/src/features/chatbot/components/Chatbot.tsx +1 -1
- package/src/features/feedback/components/EmptyComment.tsx +5 -8
- package/src/features/feedback/components/ListCardCommentsCount.tsx +1 -1
- package/src/features/feedback/components/TeacherFeedback.tsx +7 -8
- package/src/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.tsx +30 -16
- package/src/features/feedback/components/TeacherFeedbackComments/TeacherComment.tsx +3 -5
- package/src/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.tsx +2 -10
- package/src/features/feedback/components/UnreadMessagesBadge.tsx +10 -3
- package/src/features/feedback/constants.ts +12 -3
- package/src/features/feedback/helpers.ts +31 -0
- package/src/features/feedback/model/api.ts +6 -2
- package/src/features/feedback/model/comments.ts +17 -39
- package/src/features/feedback/model/model.ts +8 -11
- package/src/features/feedback/types.ts +7 -1
- package/src/lib/helpers/helpers.ts +24 -16
- package/src/lib/localization/en.json +12 -0
- package/src/lib/localization/gb.json +12 -0
- package/src/lib/localization/sw.json +12 -0
- package/src/shared/translation/constants.ts +0 -42
- package/src/shared/translation/helpers.ts +17 -17
- package/src/shared/translation/types.ts +12 -4
- package/dist/commonjs/features/feedback/assets/icons/MessageBubbleIcon.js.map +0 -1
- package/dist/commonjs/features/feedback/assets/icons/XCloseIcon.js.map +0 -1
- package/dist/module/features/feedback/assets/icons/MessageBubbleIcon.js.map +0 -1
- package/dist/module/features/feedback/assets/icons/XCloseIcon.js.map +0 -1
- package/dist/typescript/commonjs/features/feedback/assets/icons/MessageBubbleIcon.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/feedback/assets/icons/XCloseIcon.d.ts.map +0 -1
- package/dist/typescript/module/features/feedback/assets/icons/MessageBubbleIcon.d.ts.map +0 -1
- package/dist/typescript/module/features/feedback/assets/icons/XCloseIcon.d.ts.map +0 -1
- /package/dist/commonjs/{features/feedback/assets → shared}/icons/MessageBubbleIcon.js +0 -0
- /package/dist/commonjs/{features/feedback/assets → shared}/icons/XCloseIcon.js +0 -0
- /package/dist/module/{features/feedback/assets → shared}/icons/MessageBubbleIcon.js +0 -0
- /package/dist/module/{features/feedback/assets → shared}/icons/XCloseIcon.js +0 -0
- /package/dist/typescript/commonjs/{features/feedback/assets → shared}/icons/MessageBubbleIcon.d.ts +0 -0
- /package/dist/typescript/commonjs/{features/feedback/assets → shared}/icons/XCloseIcon.d.ts +0 -0
- /package/dist/typescript/module/{features/feedback/assets → shared}/icons/MessageBubbleIcon.d.ts +0 -0
- /package/dist/typescript/module/{features/feedback/assets → shared}/icons/XCloseIcon.d.ts +0 -0
- /package/src/{features/feedback/assets → shared}/icons/MessageBubbleIcon.tsx +0 -0
- /package/src/{features/feedback/assets → shared}/icons/XCloseIcon.tsx +0 -0
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Effect } from 'effector';
|
|
2
|
-
import { TeacherFeedbackModelProps } from './model';
|
|
3
2
|
import { GetCommentsPayload, GetCommentsResponse, UpdateCommentStatusSeenPayload } from '../types';
|
|
3
|
+
type TeacherFeedbackAPIProps = {
|
|
4
|
+
getComments: (props: GetCommentsPayload) => Promise<GetCommentsResponse>;
|
|
5
|
+
updateCommentStatusSeen: (props: UpdateCommentStatusSeenPayload) => Promise<void>;
|
|
6
|
+
};
|
|
4
7
|
export declare class TeacherFeedbackAPI {
|
|
5
8
|
readonly getCommentsFx: Effect<GetCommentsPayload, GetCommentsResponse>;
|
|
6
9
|
readonly updateCommentStatusSeenFx: Effect<UpdateCommentStatusSeenPayload, void>;
|
|
7
|
-
constructor(api:
|
|
10
|
+
constructor(api: TeacherFeedbackAPIProps);
|
|
8
11
|
}
|
|
12
|
+
export {};
|
|
9
13
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/model/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/model/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAA;AAElG,KAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACxE,uBAAuB,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAClF,CAAA;AAED,qBAAa,kBAAkB;IAC7B,SAAgB,aAAa,EAAE,MAAM,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAA;IAC9E,SAAgB,yBAAyB,EAAE,MAAM,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAA;gBAE3E,GAAG,EAAE,uBAAuB;CAIzC"}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { Store } from 'effector';
|
|
2
|
-
import { CommentsMap, Credits,
|
|
2
|
+
import { AddCommentProps, CommentsMap, Credits, DeleteCommentProps } from '../types';
|
|
3
3
|
import { TeacherFeedbackAPI } from './api';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type TeacherCommentsModelProps = {
|
|
5
|
+
api: TeacherFeedbackAPI;
|
|
6
|
+
$isOpen: Store<boolean>;
|
|
7
|
+
};
|
|
8
|
+
export declare class TeacherCommentsModel {
|
|
6
9
|
private readonly setNoCommentsMessage;
|
|
7
10
|
readonly setAllCommentsRead: import("effector").EventCallable<Credits>;
|
|
8
|
-
readonly add: import("effector").EventCallable<
|
|
9
|
-
|
|
10
|
-
isRead: boolean;
|
|
11
|
-
}>;
|
|
12
|
-
readonly delete: import("effector").EventCallable<Credits & {
|
|
13
|
-
commentId: string;
|
|
14
|
-
}>;
|
|
11
|
+
readonly add: import("effector").EventCallable<AddCommentProps>;
|
|
12
|
+
readonly delete: import("effector").EventCallable<DeleteCommentProps>;
|
|
15
13
|
readonly setData: import("effector").EventCallable<CommentsMap>;
|
|
16
14
|
readonly $data: import("effector").StoreWritable<CommentsMap | null>;
|
|
17
|
-
constructor(api
|
|
18
|
-
private update;
|
|
15
|
+
constructor({ api, $isOpen }: TeacherCommentsModelProps);
|
|
19
16
|
}
|
|
17
|
+
export {};
|
|
20
18
|
//# sourceMappingURL=comments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/model/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/model/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAkB,MAAM,UAAU,CAAA;AACpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAK1C,KAAK,yBAAyB,GAAG;IAC/B,GAAG,EAAE,kBAAkB,CAAA;IACvB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;CACxB,CAAA;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAgC;IACrE,SAAgB,kBAAkB,4CAAyB;IAC3D,SAAgB,GAAG,oDAAiC;IACpD,SAAgB,MAAM,uDAAoC;IAE1D,SAAgB,OAAO,gDAA6B;IACpD,SAAgB,KAAK,uDAsDlB;gBAES,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,yBAAyB;CA6BxD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Store } from 'effector';
|
|
2
2
|
import { TeacherFeedbackAPI } from './api';
|
|
3
3
|
import { TeacherFeedbackSockets } from './sockets';
|
|
4
|
-
import {
|
|
5
|
-
import { GetCommentsPayload, GetCommentsResponse,
|
|
4
|
+
import { TeacherCommentsModel } from './comments';
|
|
5
|
+
import { GetCommentsPayload, GetCommentsResponse, UpdateCommentStatusSeenPayload } from '../types';
|
|
6
6
|
export type TeacherFeedbackModelProps = {
|
|
7
7
|
api: {
|
|
8
8
|
getComments: (props: GetCommentsPayload) => Promise<GetCommentsResponse>;
|
|
@@ -13,18 +13,15 @@ export type TeacherFeedbackModelProps = {
|
|
|
13
13
|
$assignmentId: Store<string>;
|
|
14
14
|
$problemId: Store<string>;
|
|
15
15
|
};
|
|
16
|
-
defaults: {
|
|
17
|
-
EMPTY_COMMENT: NoCommentsMessage;
|
|
18
|
-
};
|
|
19
16
|
};
|
|
20
17
|
export declare class TeacherFeedbackModel {
|
|
21
18
|
readonly sockets: TeacherFeedbackSockets;
|
|
22
19
|
readonly api: TeacherFeedbackAPI;
|
|
23
|
-
readonly comments:
|
|
20
|
+
readonly comments: TeacherCommentsModel;
|
|
24
21
|
readonly setIsOpen: import("effector").EventCallable<boolean>;
|
|
25
22
|
readonly $isOpen: import("effector").StoreWritable<boolean>;
|
|
26
23
|
readonly setIsFeedbackIconDisplayed: import("effector").EventCallable<boolean>;
|
|
27
24
|
readonly $isFeedbackIconDisplayed: import("effector").StoreWritable<boolean>;
|
|
28
|
-
constructor({ api, socket, credits
|
|
25
|
+
constructor({ api, socket, credits }: TeacherFeedbackModelProps);
|
|
29
26
|
}
|
|
30
27
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/model/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/model/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAA;AAGlG,MAAM,MAAM,yBAAyB,GAAG;IACtC,GAAG,EAAE;QACH,WAAW,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;QACxE,uBAAuB,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAClF,CAAA;IACD,MAAM,EAAE,GAAG,CAAA;IACX,OAAO,EAAE;QACP,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;QAC5B,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAC1B,CAAA;CACF,CAAA;AAED,qBAAa,oBAAoB;IAC/B,SAAgB,OAAO,EAAE,sBAAsB,CAAA;IAC/C,SAAgB,GAAG,EAAE,kBAAkB,CAAA;IACvC,SAAgB,QAAQ,EAAE,oBAAoB,CAAA;IAC9C,SAAgB,SAAS,4CAAyB;IAClD,SAAgB,OAAO,4CAAiC;IAExD,SAAgB,0BAA0B,4CAAyB;IACnE,SAAgB,wBAAwB,4CAAiD;gBAE7E,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,yBAAyB;CA8FhE"}
|
|
@@ -23,7 +23,7 @@ export type TeacherComment = {
|
|
|
23
23
|
updatedAt: Date;
|
|
24
24
|
__v: number;
|
|
25
25
|
};
|
|
26
|
-
export type NoCommentsMessage = Omit<TeacherComment, '_id' | 'problemId' | 'exerciseId'> & {
|
|
26
|
+
export type NoCommentsMessage = Omit<TeacherComment, '_id' | 'problemId' | 'exerciseId' | 'content'> & {
|
|
27
27
|
_id: typeof EMPTY_COMMENT_ID;
|
|
28
28
|
};
|
|
29
29
|
export type FeedbackEntity = {
|
|
@@ -41,4 +41,11 @@ export declare enum FeedbackSocketEvents {
|
|
|
41
41
|
COMMENT_ADDED = "exerciseCommentCreated",
|
|
42
42
|
COMMENT_DELETED = "exerciseCommentDeleted"
|
|
43
43
|
}
|
|
44
|
+
export type AddCommentProps = Credits & {
|
|
45
|
+
comment: TeacherComment;
|
|
46
|
+
isRead: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type DeleteCommentProps = Credits & {
|
|
49
|
+
commentId: string;
|
|
50
|
+
};
|
|
44
51
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/feedback/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,CAAC,SAAS,EAAE,MAAM,GAAG;QAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;KAAE,CAAA;CACpD,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,GAAG,EAAE,MAAM,EAAE,CAAA;CACd,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/feedback/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,CAAC,SAAS,EAAE,MAAM,GAAG;QAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;KAAE,CAAA;CACpD,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,GAAG,EAAE,MAAM,EAAE,CAAA;CACd,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,cAAc,EACd,KAAK,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,CAC/C,GAAG;IACF,GAAG,EAAE,OAAO,gBAAgB,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE,CAAC,CAAA;AAE9E,MAAM,MAAM,OAAO,GAAG;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,oBAAY,oBAAoB;IAC9B,aAAa,2BAA2B;IACxC,eAAe,2BAA2B;CAC3C;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAA;AACpF,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Locale } from '@magmamath/students-features';
|
|
2
1
|
export declare const generateRandomId: () => string;
|
|
3
|
-
export declare const getRelativeTimeText: (date: Date
|
|
2
|
+
export declare const getRelativeTimeText: (date: Date) => string;
|
|
4
3
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/lib/helpers/helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/lib/helpers/helpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,cACsC,CAAA;AASnE,eAAO,MAAM,mBAAmB,SAAU,IAAI,WAuB7C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageBubbleIcon.d.ts","sourceRoot":"","sources":["../../../../../src/shared/icons/MessageBubbleIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,SAAS,EAAU,MAAM,4BAA4B,CAAA;AAE9D,eAAO,MAAM,iBAAiB,oBAA6C,SAAS,sBAWnF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XCloseIcon.d.ts","sourceRoot":"","sources":["../../../../../src/shared/icons/XCloseIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,SAAS,EAAU,MAAM,4BAA4B,CAAA;AAE9D,eAAO,MAAM,UAAU,oBAA6C,SAAS,sBAS5E,CAAA"}
|
|
@@ -1,47 +1,45 @@
|
|
|
1
1
|
export declare const LOCALIZATION_CONFIGS: {
|
|
2
|
-
"en-SE": {};
|
|
3
|
-
"en-GB": {};
|
|
4
|
-
"sv-SE": {};
|
|
5
|
-
};
|
|
6
|
-
export declare const RELATIVE_TIME_LABELS: {
|
|
7
2
|
"en-SE": {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"sv-SE": {
|
|
21
|
-
justNow: string;
|
|
22
|
-
minuteAgo: string;
|
|
23
|
-
minutesAgo: string;
|
|
24
|
-
hourAgo: string;
|
|
25
|
-
hoursAgo: string;
|
|
26
|
-
dayAgo: string;
|
|
27
|
-
daysAgo: string;
|
|
28
|
-
monthAgo: string;
|
|
29
|
-
monthsAgo: string;
|
|
30
|
-
yearAgo: string;
|
|
31
|
-
yearsAgo: string;
|
|
3
|
+
"teacherFeedback.noComments": string;
|
|
4
|
+
"time.justNow": string;
|
|
5
|
+
"time.minuteAgo": string;
|
|
6
|
+
"time.minutesAgo": string;
|
|
7
|
+
"time.hourAgo": string;
|
|
8
|
+
"time.hoursAgo": string;
|
|
9
|
+
"time.dayAgo": string;
|
|
10
|
+
"time.daysAgo": string;
|
|
11
|
+
"time.monthAgo": string;
|
|
12
|
+
"time.monthsAgo": string;
|
|
13
|
+
"time.yearAgo": string;
|
|
14
|
+
"time.yearsAgo": string;
|
|
32
15
|
};
|
|
33
16
|
"en-GB": {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
17
|
+
"teacherFeedback.noComments": string;
|
|
18
|
+
"time.justNow": string;
|
|
19
|
+
"time.minuteAgo": string;
|
|
20
|
+
"time.minutesAgo": string;
|
|
21
|
+
"time.hourAgo": string;
|
|
22
|
+
"time.hoursAgo": string;
|
|
23
|
+
"time.dayAgo": string;
|
|
24
|
+
"time.daysAgo": string;
|
|
25
|
+
"time.monthAgo": string;
|
|
26
|
+
"time.monthsAgo": string;
|
|
27
|
+
"time.yearAgo": string;
|
|
28
|
+
"time.yearsAgo": string;
|
|
29
|
+
};
|
|
30
|
+
"sv-SE": {
|
|
31
|
+
"teacherFeedback.noComments": string;
|
|
32
|
+
"time.justNow": string;
|
|
33
|
+
"time.minuteAgo": string;
|
|
34
|
+
"time.minutesAgo": string;
|
|
35
|
+
"time.hourAgo": string;
|
|
36
|
+
"time.hoursAgo": string;
|
|
37
|
+
"time.dayAgo": string;
|
|
38
|
+
"time.daysAgo": string;
|
|
39
|
+
"time.monthAgo": string;
|
|
40
|
+
"time.monthsAgo": string;
|
|
41
|
+
"time.yearAgo": string;
|
|
42
|
+
"time.yearsAgo": string;
|
|
45
43
|
};
|
|
46
44
|
};
|
|
47
45
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIhC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAmB,MAAM,SAAS,CAAA;AAEtE,eAAO,MAAM,oBAAoB,QAAS,MAAM,kBAAiB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAWtF,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,OAUrB,CAAA;AAED,eAAO,MAAM,uBAAuB,cACvB,CAAC,CAAC,MAAM,EAAE,OAAO,oBAAoB,KAAK,kBAAkB,CAAC,GAAG,kBAAkB,SAG9F,CAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import enTranslations from '../../lib/localization/en.json';
|
|
2
|
+
export type Translations = typeof enTranslations;
|
|
3
|
+
export type TranslationKeys = keyof Translations;
|
|
4
|
+
export type GetText = <T extends TranslationKeys>(key: T, args?: Record<string, string> | null) => Translations[T];
|
|
2
5
|
export declare enum Locale {
|
|
3
6
|
EN = "en-SE",
|
|
4
7
|
SW = "sv-SE",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,gCAAgC,CAAA;AAE3D,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,CAAA;AAChD,MAAM,MAAM,eAAe,GAAG,MAAM,YAAY,CAAA;AAEhD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,SAAS,eAAe,EAC9C,GAAG,EAAE,CAAC,EACN,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KACjC,YAAY,CAAC,CAAC,CAAC,CAAA;AAEpB,oBAAY,MAAM;IAChB,EAAE,UAAU;IACZ,EAAE,UAAU;IACZ,EAAE,UAAU;CACb;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -61,7 +61,7 @@ export const ChatControls = ({
|
|
|
61
61
|
variant={ButtonVariant.PRIMARY}
|
|
62
62
|
size={ButtonSize.LARGE}
|
|
63
63
|
colorScheme={ButtonColor.GRAY}
|
|
64
|
-
raiseLevel={
|
|
64
|
+
raiseLevel={5}
|
|
65
65
|
customColorScheme={{
|
|
66
66
|
[ButtonStates.DEFAULT]: {
|
|
67
67
|
backgroundColor: '#FFF',
|
|
@@ -94,10 +94,10 @@ export const ChatControls = ({
|
|
|
94
94
|
|
|
95
95
|
const styles = StyleSheet.create({
|
|
96
96
|
container: {
|
|
97
|
-
// borderWidth: 1,
|
|
98
97
|
alignItems: 'center',
|
|
99
98
|
justifyContent: 'flex-end',
|
|
100
99
|
flexDirection: 'row',
|
|
100
|
+
height: 60,
|
|
101
101
|
gap: 8,
|
|
102
102
|
},
|
|
103
103
|
buttonClose: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType, PropsWithChildren, ReactNode } from 'react'
|
|
1
|
+
import { ComponentType, PropsWithChildren, ReactNode, useEffect } from 'react'
|
|
2
2
|
import { useStoreMap, useUnit } from 'effector-react'
|
|
3
3
|
import { ChatbotModel } from '../model/model'
|
|
4
4
|
import { ChatbotMessages } from './ChatMessages/ChatbotMessages'
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { StyleSheet, Text, View } from 'react-native'
|
|
3
3
|
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
-
import { BUENOS_AIRES_FONT
|
|
5
|
-
import {
|
|
4
|
+
import { BUENOS_AIRES_FONT } from '../constants'
|
|
5
|
+
import { useText } from '../../../shared/translation'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const EmptyComment = ({ locale }: EmptyCommentProps) => {
|
|
7
|
+
export const EmptyComment = () => {
|
|
8
|
+
const t = useText()
|
|
12
9
|
return (
|
|
13
10
|
<View style={styles.container}>
|
|
14
|
-
<Text style={styles.text}>{
|
|
11
|
+
<Text style={styles.text}>{t('teacherFeedback.noComments')}</Text>
|
|
15
12
|
</View>
|
|
16
13
|
)
|
|
17
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Text, View, StyleSheet } from 'react-native'
|
|
3
|
-
import { MessageBubbleIcon } from '
|
|
3
|
+
import { MessageBubbleIcon } from '../../../shared/icons/MessageBubbleIcon'
|
|
4
4
|
import { COLORS } from '@magmamath/react-native-ui'
|
|
5
5
|
import { BUENOS_AIRES_FONT } from '../constants'
|
|
6
6
|
|
|
@@ -5,15 +5,15 @@ import { TeacherFeedbackButton } from './TeacherFeedbackButton/TeacherFeedbackBu
|
|
|
5
5
|
import { TeacherFeedbackComments } from './TeacherFeedbackComments/TeacherFeedbackComments'
|
|
6
6
|
import { FeedbackButtonColors, FeedbackButtonSize, FeedbackMode } from '../constants'
|
|
7
7
|
import { TeacherFeedbackModel } from '../model/model'
|
|
8
|
-
import { Locale } from '../../../shared/translation'
|
|
9
8
|
|
|
10
9
|
type TeacherFeedbackProps = {
|
|
11
10
|
model: TeacherFeedbackModel
|
|
12
11
|
mode: FeedbackMode
|
|
13
|
-
locale: Locale
|
|
14
12
|
assignmentId: string
|
|
15
13
|
problemId: string
|
|
16
|
-
color
|
|
14
|
+
color?: FeedbackButtonColors
|
|
15
|
+
size?: FeedbackButtonSize
|
|
16
|
+
heightOffset?: number
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export const TeacherFeedback = ({
|
|
@@ -21,8 +21,9 @@ export const TeacherFeedback = ({
|
|
|
21
21
|
mode,
|
|
22
22
|
assignmentId,
|
|
23
23
|
problemId,
|
|
24
|
-
locale,
|
|
25
24
|
color = FeedbackButtonColors.BLUE,
|
|
25
|
+
size = FeedbackButtonSize.SMALL,
|
|
26
|
+
heightOffset = 0,
|
|
26
27
|
}: TeacherFeedbackProps) => {
|
|
27
28
|
const isOpen = useUnit(model.$isOpen)
|
|
28
29
|
const isLoading = useUnit(model.api.getCommentsFx.pending)
|
|
@@ -31,7 +32,6 @@ export const TeacherFeedback = ({
|
|
|
31
32
|
fn: (feedback, [assignmentId, problemId]) => feedback?.get(assignmentId)?.[problemId] ?? null,
|
|
32
33
|
keys: [assignmentId, problemId],
|
|
33
34
|
})
|
|
34
|
-
const isSimpleMode = mode === FeedbackMode.SIMPLE
|
|
35
35
|
|
|
36
36
|
if (!problemId || !teacherFeedback) return null
|
|
37
37
|
|
|
@@ -40,9 +40,8 @@ export const TeacherFeedback = ({
|
|
|
40
40
|
{isOpen && (
|
|
41
41
|
<TeacherFeedbackComments
|
|
42
42
|
comments={teacherFeedback.comments}
|
|
43
|
-
locale={locale}
|
|
44
43
|
mode={mode}
|
|
45
|
-
maxHeightOffset={
|
|
44
|
+
maxHeightOffset={heightOffset}
|
|
46
45
|
/>
|
|
47
46
|
)}
|
|
48
47
|
<TeacherFeedbackButton
|
|
@@ -50,7 +49,7 @@ export const TeacherFeedback = ({
|
|
|
50
49
|
unreadCommentsCount={teacherFeedback.unreadMessagesCount}
|
|
51
50
|
isOpen={isOpen}
|
|
52
51
|
isLoading={isLoading}
|
|
53
|
-
size={
|
|
52
|
+
size={size}
|
|
54
53
|
color={color}
|
|
55
54
|
/>
|
|
56
55
|
</View>
|
|
@@ -2,8 +2,8 @@ import React from 'react'
|
|
|
2
2
|
import { StyleSheet, View } from 'react-native'
|
|
3
3
|
import { Button, COLORS } from '@magmamath/react-native-ui'
|
|
4
4
|
import { UnreadMessagesBadge } from '../UnreadMessagesBadge'
|
|
5
|
-
import { MessageBubbleIcon } from '
|
|
6
|
-
import { XCloseIcon } from '
|
|
5
|
+
import { MessageBubbleIcon } from '../../../../shared/icons/MessageBubbleIcon'
|
|
6
|
+
import { XCloseIcon } from '../../../../shared/icons/XCloseIcon'
|
|
7
7
|
import { COLOR_SCHEMES } from './colorSchemes'
|
|
8
8
|
import {
|
|
9
9
|
FeedbackButtonColors,
|
|
@@ -16,6 +16,26 @@ const ICON_SIZES = {
|
|
|
16
16
|
[FeedbackButtonSize.SMALL]: 26,
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
const COLOR_PRESETS = {
|
|
20
|
+
[FeedbackButtonColors.PURPLE]: {
|
|
21
|
+
borderColor: COLORS.PURPLE_6,
|
|
22
|
+
schemeColor: COLOR_SCHEMES.PURPLE,
|
|
23
|
+
},
|
|
24
|
+
[FeedbackButtonColors.BLUE]: {
|
|
25
|
+
borderColor: COLORS.BLUE_6,
|
|
26
|
+
schemeColor: COLOR_SCHEMES.BLUE,
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const getVariantStyles = (isUnread: boolean, color: FeedbackButtonColors) => {
|
|
31
|
+
const { borderColor, schemeColor } = COLOR_PRESETS[color]
|
|
32
|
+
return {
|
|
33
|
+
iconColor: isUnread ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_9,
|
|
34
|
+
customColorScheme: isUnread ? schemeColor : COLOR_SCHEMES.GREY,
|
|
35
|
+
borderColor: isUnread ? borderColor : COLORS.NEUTRAL_5,
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
19
39
|
type TeacherFeedbackButtonProps = {
|
|
20
40
|
isOpen: boolean
|
|
21
41
|
isLoading: boolean
|
|
@@ -34,9 +54,10 @@ export const TeacherFeedbackButton = ({
|
|
|
34
54
|
color = FeedbackButtonColors.BLUE,
|
|
35
55
|
}: TeacherFeedbackButtonProps) => {
|
|
36
56
|
const isLarge = size === FeedbackButtonSize.LARGE
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
57
|
+
const { borderColor, iconColor, customColorScheme } = getVariantStyles(
|
|
58
|
+
!!unreadCommentsCount,
|
|
59
|
+
color,
|
|
60
|
+
)
|
|
40
61
|
|
|
41
62
|
if (isOpen) {
|
|
42
63
|
return (
|
|
@@ -67,20 +88,13 @@ export const TeacherFeedbackButton = ({
|
|
|
67
88
|
isLoading={isLoading}
|
|
68
89
|
style={{
|
|
69
90
|
container: isLarge ? styles.containerLarge : styles.container,
|
|
70
|
-
button: [
|
|
71
|
-
styles.button,
|
|
72
|
-
{ borderColor: !!unreadCommentsCount ? borderColor : COLORS.NEUTRAL_5 },
|
|
73
|
-
styles[size],
|
|
74
|
-
],
|
|
91
|
+
button: [styles.button, { borderColor }, styles[size]],
|
|
75
92
|
}}
|
|
76
|
-
customColorScheme={
|
|
93
|
+
customColorScheme={customColorScheme}
|
|
77
94
|
icon={
|
|
78
95
|
<View style={styles.iconContainer}>
|
|
79
|
-
<MessageBubbleIcon
|
|
80
|
-
|
|
81
|
-
size={ICON_SIZES[size]}
|
|
82
|
-
/>
|
|
83
|
-
{!!unreadCommentsCount && (
|
|
96
|
+
<MessageBubbleIcon color={iconColor} size={ICON_SIZES[size]} />
|
|
97
|
+
{unreadCommentsCount !== undefined && (
|
|
84
98
|
<View style={isLarge ? styles.badgeContainerLarge : styles.badgeContainer}>
|
|
85
99
|
<UnreadMessagesBadge
|
|
86
100
|
badgeContent={unreadCommentsCount}
|
|
@@ -4,15 +4,13 @@ import { COLORS } from '@magmamath/react-native-ui'
|
|
|
4
4
|
import { BUENOS_AIRES_FONT } from '../../constants'
|
|
5
5
|
import { getRelativeTimeText } from '../../../../lib/helpers/helpers'
|
|
6
6
|
import { TeacherComment as TeacherCommentEntity } from '../../types'
|
|
7
|
-
import { Locale } from '../../../../shared/translation/types'
|
|
8
7
|
|
|
9
8
|
type TeacherCommentProps = {
|
|
10
9
|
comment: TeacherCommentEntity
|
|
11
|
-
|
|
12
|
-
style: StyleProp<ViewStyle>
|
|
10
|
+
style?: StyleProp<ViewStyle>
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
export const TeacherComment = ({ comment,
|
|
13
|
+
export const TeacherComment = ({ comment, style }: TeacherCommentProps) => {
|
|
16
14
|
return (
|
|
17
15
|
<View style={style}>
|
|
18
16
|
<View style={styles.authorInfo}>
|
|
@@ -21,7 +19,7 @@ export const TeacherComment = ({ comment, locale, style }: TeacherCommentProps)
|
|
|
21
19
|
</Text>
|
|
22
20
|
<View style={styles.spacer} />
|
|
23
21
|
<Text style={styles.dateAdded} numberOfLines={1}>
|
|
24
|
-
{getRelativeTimeText(comment.createdAt
|
|
22
|
+
{getRelativeTimeText(comment.createdAt)}
|
|
25
23
|
</Text>
|
|
26
24
|
</View>
|
|
27
25
|
|
package/src/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.tsx
CHANGED
|
@@ -4,7 +4,6 @@ import { TeacherComment } from './TeacherComment'
|
|
|
4
4
|
import { EmptyComment } from '../EmptyComment'
|
|
5
5
|
import { EMPTY_COMMENT_ID, FeedbackMode } from '../../constants'
|
|
6
6
|
import { COLORS } from '@magmamath/react-native-ui'
|
|
7
|
-
import { Locale } from '../../../../shared/translation'
|
|
8
7
|
import { TeacherComment as TeacherCommentEntity } from '../../types'
|
|
9
8
|
|
|
10
9
|
const TOOLBAR_HEIGHT = 140
|
|
@@ -14,29 +13,23 @@ const BOTTOM_OFFSET = Platform.select({
|
|
|
14
13
|
})
|
|
15
14
|
|
|
16
15
|
type TeacherFeedbackCommentsProps = {
|
|
17
|
-
comments: TeacherCommentEntity[]
|
|
18
|
-
locale: Locale | null
|
|
16
|
+
comments: TeacherCommentEntity[]
|
|
19
17
|
mode: FeedbackMode
|
|
20
18
|
maxHeightOffset: number
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
export const TeacherFeedbackComments = ({
|
|
24
22
|
comments,
|
|
25
|
-
locale,
|
|
26
|
-
mode,
|
|
27
23
|
maxHeightOffset,
|
|
28
24
|
}: TeacherFeedbackCommentsProps) => {
|
|
29
25
|
const ref = useRef<ScrollView | null>(null)
|
|
30
26
|
const dimensions = useWindowDimensions()
|
|
31
27
|
const MAX_HEIGHT = dimensions.height - TOOLBAR_HEIGHT - BOTTOM_OFFSET
|
|
32
|
-
const isSimpleMode = mode === FeedbackMode.SIMPLE
|
|
33
28
|
|
|
34
29
|
useEffect(() => {
|
|
35
30
|
ref.current?.scrollToEnd({ animated: false })
|
|
36
31
|
}, [])
|
|
37
32
|
|
|
38
|
-
if (!comments) return null
|
|
39
|
-
|
|
40
33
|
return (
|
|
41
34
|
<View style={[styles.container, { maxHeight: MAX_HEIGHT - maxHeightOffset }]}>
|
|
42
35
|
<ScrollView
|
|
@@ -45,13 +38,12 @@ export const TeacherFeedbackComments = ({
|
|
|
45
38
|
onContentSizeChange={() => ref.current?.scrollToEnd()}
|
|
46
39
|
>
|
|
47
40
|
{comments.length === 1 && comments[0]._id === EMPTY_COMMENT_ID ? (
|
|
48
|
-
<EmptyComment
|
|
41
|
+
<EmptyComment />
|
|
49
42
|
) : (
|
|
50
43
|
comments.map((comment, index) => (
|
|
51
44
|
<TeacherComment
|
|
52
45
|
key={comment._id}
|
|
53
46
|
comment={comment}
|
|
54
|
-
locale={locale}
|
|
55
47
|
style={{ marginBottom: index === comments.length - 1 ? 8 : 0 }}
|
|
56
48
|
/>
|
|
57
49
|
))
|
|
@@ -9,18 +9,25 @@ type UnreadMessagesBadgeProps = {
|
|
|
9
9
|
textStyle?: StyleProp<TextStyle>
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export const UnreadMessagesBadge = ({
|
|
12
|
+
export const UnreadMessagesBadge = ({
|
|
13
|
+
badgeContent,
|
|
14
|
+
withBorder = false,
|
|
15
|
+
style,
|
|
16
|
+
textStyle,
|
|
17
|
+
}: UnreadMessagesBadgeProps) => {
|
|
13
18
|
return (
|
|
14
19
|
<View
|
|
15
20
|
style={[
|
|
16
21
|
styles.container,
|
|
17
22
|
style,
|
|
18
|
-
|
|
23
|
+
badgeContent === undefined && styles.emptyBadge,
|
|
19
24
|
withBorder && styles.border,
|
|
20
25
|
withBorder && (badgeContent ? styles.withBorderSize : styles.withBorderSizeEmpty),
|
|
21
26
|
]}
|
|
22
27
|
>
|
|
23
|
-
<Text style={[styles.text, textStyle]}>
|
|
28
|
+
<Text style={[styles.text, textStyle]}>
|
|
29
|
+
{badgeContent && badgeContent > 99 ? '99+' : badgeContent}
|
|
30
|
+
</Text>
|
|
24
31
|
</View>
|
|
25
32
|
)
|
|
26
33
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Platform } from 'react-native'
|
|
2
|
+
import { NoCommentsMessage } from './types'
|
|
2
3
|
|
|
3
4
|
export const BUENOS_AIRES_FONT =
|
|
4
5
|
Platform.OS === 'web' ? 'Buenos Aires, sans-serif' : 'BuenosAires-Regular'
|
|
5
6
|
|
|
6
|
-
export const NO_COMMENTS_ENG = 'No comments yet'
|
|
7
|
-
export const NO_COMMENTS_SWE = 'Inga kommentarer än'
|
|
8
7
|
export const EMPTY_COMMENT_ID = 'empty-comment'
|
|
9
|
-
|
|
10
8
|
export const TEACHER_FEEDBACK_BUTTON_ID = 'teacherFeedbackButton'
|
|
11
9
|
|
|
12
10
|
export enum FeedbackButtonColors {
|
|
@@ -23,3 +21,14 @@ export enum FeedbackMode {
|
|
|
23
21
|
SIMPLE = 'SIMPLE',
|
|
24
22
|
NORMAL = 'NORMAL',
|
|
25
23
|
}
|
|
24
|
+
|
|
25
|
+
export const EMPTY_COMMENT: NoCommentsMessage = {
|
|
26
|
+
__v: 0,
|
|
27
|
+
_id: EMPTY_COMMENT_ID,
|
|
28
|
+
createdAt: new Date(),
|
|
29
|
+
isRead: true,
|
|
30
|
+
studentId: '',
|
|
31
|
+
teacherId: '',
|
|
32
|
+
teacherName: '',
|
|
33
|
+
updatedAt: new Date(),
|
|
34
|
+
} as const
|