@magmamath/students-features 0.1.3 → 0.2.0-fix-teacher-feedback-button2
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 +5 -21
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/api.js +1 -26
- package/dist/commonjs/features/chatbot/model/api.js.map +1 -1
- package/dist/commonjs/features/feedback/components/EmptyComment/EmptyComment.js +54 -0
- package/dist/commonjs/features/feedback/components/EmptyComment/EmptyComment.js.map +1 -0
- package/dist/commonjs/features/feedback/components/ListCardCommentsCount/ListCardCommentsCount.js +43 -0
- package/dist/commonjs/features/feedback/components/ListCardCommentsCount/ListCardCommentsCount.js.map +1 -0
- package/dist/commonjs/features/feedback/components/TeacherFeedback.js +51 -0
- package/dist/commonjs/features/feedback/components/TeacherFeedback.js.map +1 -0
- package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js +110 -0
- package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js.map +1 -0
- package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/colorSchemes.js +44 -0
- package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/colorSchemes.js.map +1 -0
- package/dist/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherComment.js +97 -0
- package/dist/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherComment.js.map +1 -0
- package/dist/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.js +68 -0
- package/dist/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.js.map +1 -0
- package/dist/commonjs/features/feedback/components/UnreadMessagesBadge.js +61 -0
- package/dist/commonjs/features/feedback/components/UnreadMessagesBadge.js.map +1 -0
- package/dist/commonjs/features/feedback/components/icons/MessageBubbleIcon.js +32 -0
- package/dist/commonjs/features/feedback/components/icons/MessageBubbleIcon.js.map +1 -0
- package/dist/commonjs/features/feedback/components/icons/XCloseIcon.js +30 -0
- package/dist/commonjs/features/feedback/components/icons/XCloseIcon.js.map +1 -0
- package/dist/commonjs/features/feedback/components/index.js +41 -0
- package/dist/commonjs/features/feedback/components/index.js.map +1 -0
- package/dist/commonjs/features/feedback/constants.js +30 -0
- package/dist/commonjs/features/feedback/constants.js.map +1 -0
- package/dist/commonjs/features/feedback/helpers.js +70 -0
- package/dist/commonjs/features/feedback/helpers.js.map +1 -0
- package/dist/commonjs/features/feedback/index.js +50 -0
- package/dist/commonjs/features/feedback/index.js.map +1 -0
- package/dist/commonjs/features/feedback/model/teacherFeedback.model.js +215 -0
- package/dist/commonjs/features/feedback/model/teacherFeedback.model.js.map +1 -0
- package/dist/commonjs/features/feedback/types/teacherFeedback.types.js +18 -0
- package/dist/commonjs/features/feedback/types/teacherFeedback.types.js.map +1 -0
- package/dist/commonjs/index.js +12 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +6 -22
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/module/features/chatbot/model/api.js +1 -26
- package/dist/module/features/chatbot/model/api.js.map +1 -1
- package/dist/module/features/feedback/components/EmptyComment/EmptyComment.js +48 -0
- package/dist/module/features/feedback/components/EmptyComment/EmptyComment.js.map +1 -0
- package/dist/module/features/feedback/components/ListCardCommentsCount/ListCardCommentsCount.js +37 -0
- package/dist/module/features/feedback/components/ListCardCommentsCount/ListCardCommentsCount.js.map +1 -0
- package/dist/module/features/feedback/components/TeacherFeedback.js +45 -0
- package/dist/module/features/feedback/components/TeacherFeedback.js.map +1 -0
- package/dist/module/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js +104 -0
- package/dist/module/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js.map +1 -0
- package/dist/module/features/feedback/components/TeacherFeedbackButton/colorSchemes.js +40 -0
- package/dist/module/features/feedback/components/TeacherFeedbackButton/colorSchemes.js.map +1 -0
- package/dist/module/features/feedback/components/TeacherFeedbackComments/TeacherComment.js +91 -0
- package/dist/module/features/feedback/components/TeacherFeedbackComments/TeacherComment.js.map +1 -0
- package/dist/module/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.js +61 -0
- package/dist/module/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.js.map +1 -0
- package/dist/module/features/feedback/components/UnreadMessagesBadge.js +55 -0
- package/dist/module/features/feedback/components/UnreadMessagesBadge.js.map +1 -0
- package/dist/module/features/feedback/components/icons/MessageBubbleIcon.js +24 -0
- package/dist/module/features/feedback/components/icons/MessageBubbleIcon.js.map +1 -0
- package/dist/module/features/feedback/components/icons/XCloseIcon.js +22 -0
- package/dist/module/features/feedback/components/icons/XCloseIcon.js.map +1 -0
- package/dist/module/features/feedback/components/index.js +8 -0
- package/dist/module/features/feedback/components/index.js.map +1 -0
- package/dist/module/features/feedback/constants.js +25 -0
- package/dist/module/features/feedback/constants.js.map +1 -0
- package/dist/module/features/feedback/helpers.js +65 -0
- package/dist/module/features/feedback/helpers.js.map +1 -0
- package/dist/module/features/feedback/index.js +7 -0
- package/dist/module/features/feedback/index.js.map +1 -0
- package/dist/module/features/feedback/model/teacherFeedback.model.js +210 -0
- package/dist/module/features/feedback/model/teacherFeedback.model.js.map +1 -0
- package/dist/module/features/feedback/types/teacherFeedback.types.js +14 -0
- package/dist/module/features/feedback/types/teacherFeedback.types.js.map +1 -0
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/api.d.ts +0 -3
- package/dist/typescript/commonjs/features/chatbot/model/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/components/EmptyComment/EmptyComment.d.ts +8 -0
- package/dist/typescript/commonjs/features/feedback/components/EmptyComment/EmptyComment.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/components/ListCardCommentsCount/ListCardCommentsCount.d.ts +7 -0
- package/dist/typescript/commonjs/features/feedback/components/ListCardCommentsCount/ListCardCommentsCount.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedback.d.ts +9 -0
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedback.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.d.ts +11 -0
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackButton/colorSchemes.d.ts +37 -0
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackButton/colorSchemes.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherComment.d.ts +12 -0
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherComment.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.d.ts +10 -0
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/components/UnreadMessagesBadge.d.ts +10 -0
- package/dist/typescript/commonjs/features/feedback/components/UnreadMessagesBadge.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/components/icons/MessageBubbleIcon.d.ts +4 -0
- package/dist/typescript/commonjs/features/feedback/components/icons/MessageBubbleIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/components/icons/XCloseIcon.d.ts +4 -0
- package/dist/typescript/commonjs/features/feedback/components/icons/XCloseIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/components/index.d.ts +6 -0
- package/dist/typescript/commonjs/features/feedback/components/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/constants.d.ts +20 -0
- package/dist/typescript/commonjs/features/feedback/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/helpers.d.ts +3 -0
- package/dist/typescript/commonjs/features/feedback/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/index.d.ts +5 -0
- package/dist/typescript/commonjs/features/feedback/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/model/teacherFeedback.model.d.ts +45 -0
- package/dist/typescript/commonjs/features/feedback/model/teacherFeedback.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/types/teacherFeedback.types.d.ts +33 -0
- package/dist/typescript/commonjs/features/feedback/types/teacherFeedback.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +1 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/api.d.ts +0 -3
- package/dist/typescript/module/features/chatbot/model/api.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/components/EmptyComment/EmptyComment.d.ts +8 -0
- package/dist/typescript/module/features/feedback/components/EmptyComment/EmptyComment.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/components/ListCardCommentsCount/ListCardCommentsCount.d.ts +7 -0
- package/dist/typescript/module/features/feedback/components/ListCardCommentsCount/ListCardCommentsCount.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/components/TeacherFeedback.d.ts +9 -0
- package/dist/typescript/module/features/feedback/components/TeacherFeedback.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.d.ts +11 -0
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackButton/colorSchemes.d.ts +37 -0
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackButton/colorSchemes.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackComments/TeacherComment.d.ts +12 -0
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackComments/TeacherComment.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.d.ts +10 -0
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/components/UnreadMessagesBadge.d.ts +10 -0
- package/dist/typescript/module/features/feedback/components/UnreadMessagesBadge.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/components/icons/MessageBubbleIcon.d.ts +4 -0
- package/dist/typescript/module/features/feedback/components/icons/MessageBubbleIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/components/icons/XCloseIcon.d.ts +4 -0
- package/dist/typescript/module/features/feedback/components/icons/XCloseIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/components/index.d.ts +6 -0
- package/dist/typescript/module/features/feedback/components/index.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/constants.d.ts +20 -0
- package/dist/typescript/module/features/feedback/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/helpers.d.ts +3 -0
- package/dist/typescript/module/features/feedback/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/index.d.ts +5 -0
- package/dist/typescript/module/features/feedback/index.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/model/teacherFeedback.model.d.ts +45 -0
- package/dist/typescript/module/features/feedback/model/teacherFeedback.model.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/types/teacherFeedback.types.d.ts +33 -0
- package/dist/typescript/module/features/feedback/types/teacherFeedback.types.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +1 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/features/chatbot/components/ChatControls/ChatControls.tsx +4 -27
- package/src/features/chatbot/model/api.ts +18 -55
- package/src/features/feedback/components/EmptyComment/EmptyComment.tsx +43 -0
- package/src/features/feedback/components/ListCardCommentsCount/ListCardCommentsCount.tsx +33 -0
- package/src/features/feedback/components/TeacherFeedback.tsx +46 -0
- package/src/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.tsx +117 -0
- package/src/features/feedback/components/TeacherFeedbackButton/colorSchemes.ts +38 -0
- package/src/features/feedback/components/TeacherFeedbackComments/TeacherComment.tsx +80 -0
- package/src/features/feedback/components/TeacherFeedbackComments/TeacherFeedbackComments.tsx +69 -0
- package/src/features/feedback/components/UnreadMessagesBadge.tsx +61 -0
- package/src/features/feedback/components/icons/MessageBubbleIcon.tsx +16 -0
- package/src/features/feedback/components/icons/XCloseIcon.tsx +14 -0
- package/src/features/feedback/components/index.ts +5 -0
- package/src/features/feedback/constants.ts +26 -0
- package/src/features/feedback/helpers.ts +66 -0
- package/src/features/feedback/index.ts +4 -0
- package/src/features/feedback/model/teacherFeedback.model.ts +255 -0
- package/src/features/feedback/types/teacherFeedback.types.ts +32 -0
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/students-features",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-fix-teacher-feedback-button2",
|
|
4
4
|
"description": "Magmamath features library",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/commonjs/index.js",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"release": "release-it"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
+
"@magmamath/react-native-ui": "0.2.15",
|
|
20
21
|
"effector": "^23.2.3",
|
|
21
22
|
"effector-react": "^23.2.1"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
24
25
|
"react": "*",
|
|
25
26
|
"react-native": "*",
|
|
26
|
-
"react-native-svg": "^15.10.0"
|
|
27
|
-
"@magmamath/react-native-ui": "*"
|
|
27
|
+
"react-native-svg": "^15.10.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@magmamath/react-native-ui": "0.
|
|
30
|
+
"@magmamath/react-native-ui": "0.2.15",
|
|
31
31
|
"@react-native/eslint-config": "^0.73.1",
|
|
32
32
|
"@release-it/conventional-changelog": "^9.0.2",
|
|
33
33
|
"@types/jest": "^29.5.5",
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { ComponentType, PropsWithChildren } from 'react'
|
|
3
3
|
import { ActivityIndicator, Pressable, StyleSheet, View } from 'react-native'
|
|
4
|
-
import {
|
|
5
|
-
Button,
|
|
6
|
-
ButtonColor,
|
|
7
|
-
ButtonSize,
|
|
8
|
-
ButtonStates,
|
|
9
|
-
ButtonVariant,
|
|
10
|
-
COLORS,
|
|
11
|
-
} from '@magmamath/react-native-ui'
|
|
4
|
+
import { Button } from '@magmamath/react-native-ui'
|
|
12
5
|
import { useUnit } from 'effector-react'
|
|
13
6
|
import { ChatbotModel } from '../../model/model'
|
|
14
7
|
import { ChatbotIcon } from '../../../../shared/icons/ChatbotIcon'
|
|
@@ -56,24 +49,12 @@ export const ChatControls = ({
|
|
|
56
49
|
<Button
|
|
57
50
|
onPress={onPressClose}
|
|
58
51
|
style={{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
variant={ButtonVariant.PRIMARY}
|
|
62
|
-
size={ButtonSize.LARGE}
|
|
63
|
-
colorScheme={ButtonColor.GRAY}
|
|
64
|
-
raiseLevel={5}
|
|
65
|
-
customColorScheme={{
|
|
66
|
-
[ButtonStates.DEFAULT]: {
|
|
52
|
+
container: styles.buttonClose,
|
|
53
|
+
button: {
|
|
67
54
|
backgroundColor: '#FFF',
|
|
68
|
-
borderColor: COLORS.NEUTRAL_5,
|
|
69
|
-
raiseColor: COLORS.NEUTRAL_5,
|
|
70
|
-
},
|
|
71
|
-
[ButtonStates.PRESSED]: {
|
|
72
|
-
backgroundColor: COLORS.NEUTRAL_4,
|
|
73
|
-
borderColor: COLORS.NEUTRAL_5,
|
|
74
|
-
raiseColor: COLORS.NEUTRAL_5,
|
|
75
55
|
},
|
|
76
56
|
}}
|
|
57
|
+
raiseLevel={5}
|
|
77
58
|
>
|
|
78
59
|
<CloseIcon />
|
|
79
60
|
</Button>
|
|
@@ -103,10 +84,6 @@ const styles = StyleSheet.create({
|
|
|
103
84
|
buttonClose: {
|
|
104
85
|
width: 50,
|
|
105
86
|
height: 50,
|
|
106
|
-
borderRadius: 50,
|
|
107
|
-
paddingHorizontal: 0,
|
|
108
|
-
borderWidth: 1.5,
|
|
109
|
-
borderColor: COLORS.NEUTRAL_5,
|
|
110
87
|
},
|
|
111
88
|
buttonTranslate: {
|
|
112
89
|
alignItems: 'center',
|
|
@@ -4,62 +4,25 @@ import { createControllerEffect } from '../../../lib/effector'
|
|
|
4
4
|
import { ControlledEffect } from '../../../lib/effector/createControllerEffect'
|
|
5
5
|
import { ChatbotModelProps } from '../types/model.types'
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
GetAlternativesResponse,
|
|
8
|
+
PostMessagePayload,
|
|
9
|
+
PostMessageResponse,
|
|
10
|
+
GoogleTranslatePayload,
|
|
11
|
+
GoogleTranslateResponse,
|
|
12
|
+
GoogleText2SpeechPayload,
|
|
13
|
+
GoogleText2SpeechResponse,
|
|
14
14
|
} from '../types/api.types'
|
|
15
15
|
|
|
16
16
|
export class ChatbotAPI {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} as const
|
|
29
|
-
|
|
30
|
-
private replaceKatexSyntax(texts: string[], reverse = false) {
|
|
31
|
-
const replacements = reverse
|
|
32
|
-
? Object.entries(this.KATEX_REPLACEMENTS_REVERSE)
|
|
33
|
-
: Object.entries(this.KATEX_REPLACEMENTS)
|
|
34
|
-
|
|
35
|
-
return texts.map(text =>
|
|
36
|
-
replacements.reduce(
|
|
37
|
-
(newText, [pattern, placeholder]) => newText.replace(new RegExp(pattern, 'g'), placeholder),
|
|
38
|
-
text,
|
|
39
|
-
),
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
constructor(api: ChatbotModelProps['api']) {
|
|
44
|
-
this.postMessageFx = createControllerEffect(api.postMessage)
|
|
45
|
-
this.getAlternativesFx = createEffect(api.getAlternatives)
|
|
46
|
-
this.translateTextFx = createEffect(async (payload: GoogleTranslatePayload) => {
|
|
47
|
-
const response = await api.postTranslateText({
|
|
48
|
-
...payload,
|
|
49
|
-
text: this.replaceKatexSyntax(payload.text),
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
...response,
|
|
54
|
-
data: {
|
|
55
|
-
...response.data,
|
|
56
|
-
translations: response.data.translations.map(translation => ({
|
|
57
|
-
...translation,
|
|
58
|
-
translatedText: this.replaceKatexSyntax([translation.translatedText], true)[0],
|
|
59
|
-
})),
|
|
60
|
-
},
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
this.textToSpeechTextFx = createEffect(api.postTextToSpeech)
|
|
64
|
-
}
|
|
17
|
+
postMessageFx: ControlledEffect<PostMessagePayload, PostMessageResponse>
|
|
18
|
+
getAlternativesFx: Effect<void, GetAlternativesResponse>
|
|
19
|
+
translateTextFx: Effect<GoogleTranslatePayload, GoogleTranslateResponse>
|
|
20
|
+
textToSpeechTextFx: Effect<GoogleText2SpeechPayload, GoogleText2SpeechResponse>
|
|
21
|
+
|
|
22
|
+
constructor(api: ChatbotModelProps['api']) {
|
|
23
|
+
this.postMessageFx = createControllerEffect(api.postMessage)
|
|
24
|
+
this.getAlternativesFx = createEffect(api.getAlternatives)
|
|
25
|
+
this.translateTextFx = createEffect(api.postTranslateText)
|
|
26
|
+
this.textToSpeechTextFx = createEffect(api.postTextToSpeech)
|
|
27
|
+
}
|
|
65
28
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { StyleSheet, Text, View } from 'react-native'
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
import { BUENOS_AIRES_FONT, NO_COMMENTS_SWE, NO_COMMENTS_ENG } from '../../constants'
|
|
5
|
+
import { Locale } from '../../types/teacherFeedback.types'
|
|
6
|
+
|
|
7
|
+
type EmptyCommentProps = {
|
|
8
|
+
locale: Locale | null
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const EmptyComment = ({ locale }: EmptyCommentProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<View style={styles.container}>
|
|
14
|
+
<Text style={styles.text}>{locale === Locale.SV ? NO_COMMENTS_SWE : NO_COMMENTS_ENG}</Text>
|
|
15
|
+
</View>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const styles = StyleSheet.create({
|
|
20
|
+
container: {
|
|
21
|
+
padding: 8,
|
|
22
|
+
gap: 10,
|
|
23
|
+
borderTopLeftRadius: 8,
|
|
24
|
+
borderTopRightRadius: 8,
|
|
25
|
+
borderBottomRightRadius: 8,
|
|
26
|
+
shadowColor: COLORS.PRIMARY_SHADOW,
|
|
27
|
+
shadowOffset: { width: 0, height: 1 },
|
|
28
|
+
shadowOpacity: 0.25,
|
|
29
|
+
shadowRadius: 3,
|
|
30
|
+
elevation: 3,
|
|
31
|
+
backgroundColor: COLORS.NEUTRAL_3,
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
},
|
|
35
|
+
text: {
|
|
36
|
+
fontSize: 24,
|
|
37
|
+
fontFamily: BUENOS_AIRES_FONT,
|
|
38
|
+
fontWeight: '600',
|
|
39
|
+
color: COLORS.NEUTRAL_7,
|
|
40
|
+
padding: 8,
|
|
41
|
+
lineHeight: 20,
|
|
42
|
+
},
|
|
43
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Text, View, StyleSheet } from 'react-native'
|
|
3
|
+
import { MessageBubbleIcon } from '../icons/MessageBubbleIcon'
|
|
4
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
5
|
+
import { BUENOS_AIRES_FONT } from '../../constants'
|
|
6
|
+
|
|
7
|
+
type ListCardCommentsCountProps = {
|
|
8
|
+
count: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const ListCardCommentsCount = ({ count }: ListCardCommentsCountProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<View style={styles.container}>
|
|
14
|
+
<MessageBubbleIcon size={23} color={COLORS.NEUTRAL_7} />
|
|
15
|
+
<Text style={styles.text}>{count}</Text>
|
|
16
|
+
</View>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const styles = StyleSheet.create({
|
|
21
|
+
container: {
|
|
22
|
+
width: 64,
|
|
23
|
+
flexDirection: 'row',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
gap: 8,
|
|
26
|
+
},
|
|
27
|
+
text: {
|
|
28
|
+
fontSize: 14,
|
|
29
|
+
fontFamily: BUENOS_AIRES_FONT,
|
|
30
|
+
color: COLORS.NEUTRAL_7,
|
|
31
|
+
fontWeight: 400,
|
|
32
|
+
},
|
|
33
|
+
})
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useStoreMap, useUnit } from 'effector-react'
|
|
3
|
+
import { View, StyleSheet } from 'react-native'
|
|
4
|
+
import { TeacherFeedbackButton } from './TeacherFeedbackButton/TeacherFeedbackButton'
|
|
5
|
+
import { TeacherFeedbackComments } from './TeacherFeedbackComments/TeacherFeedbackComments'
|
|
6
|
+
import { TeacherFeedbackModel } from '../model/teacherFeedback.model'
|
|
7
|
+
|
|
8
|
+
type TeacherFeedbackProps = {
|
|
9
|
+
model: TeacherFeedbackModel
|
|
10
|
+
mode: 'regular' | 'simple'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const TeacherFeedback = ({ model, mode }: TeacherFeedbackProps) => {
|
|
14
|
+
const isOpen = useUnit(model.$isOpened)
|
|
15
|
+
const assignmentId = useUnit(model.$assignmentId)
|
|
16
|
+
const problemId = useUnit(model.$currentProblemId)
|
|
17
|
+
const locale = useUnit(model.$locale)
|
|
18
|
+
const isLoading = useUnit(model.getCommentsByAssignmentIdFx.pending)
|
|
19
|
+
const teacherFeedback = useStoreMap({
|
|
20
|
+
store: model.$comments,
|
|
21
|
+
fn: (feedback, [assignmentId, problemId]) => feedback.get(assignmentId)?.[problemId] ?? null,
|
|
22
|
+
keys: [assignmentId, problemId],
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
if (!problemId || !teacherFeedback) return null
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<View style={styles.container}>
|
|
29
|
+
{isOpen && <TeacherFeedbackComments comments={teacherFeedback.comments} locale={locale} mode={mode} />}
|
|
30
|
+
<TeacherFeedbackButton
|
|
31
|
+
onPress={() => model.setIsOpened(!isOpen)}
|
|
32
|
+
unreadCommentsCount={teacherFeedback.unreadMessagesCount}
|
|
33
|
+
isOpen={isOpen}
|
|
34
|
+
isLoading={isLoading}
|
|
35
|
+
size={mode === 'regular' ? 'small' : 'large'}
|
|
36
|
+
/>
|
|
37
|
+
</View>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const styles = StyleSheet.create({
|
|
42
|
+
container: {
|
|
43
|
+
alignItems: 'flex-end',
|
|
44
|
+
gap: 11,
|
|
45
|
+
},
|
|
46
|
+
})
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { GestureResponderEvent, StyleSheet, View } from 'react-native'
|
|
3
|
+
import { Button, COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
import { UnreadMessagesBadge } from '../UnreadMessagesBadge'
|
|
5
|
+
import { MessageBubbleIcon } from '../icons/MessageBubbleIcon'
|
|
6
|
+
import { XCloseIcon } from '../icons/XCloseIcon'
|
|
7
|
+
import { COLOR_SCHEMES } from './colorSchemes'
|
|
8
|
+
import { TEACHER_FEEDBACK_BUTTON_ID } from '../../constants'
|
|
9
|
+
|
|
10
|
+
type TeacherFeedbackButtonProps = {
|
|
11
|
+
isOpen: boolean
|
|
12
|
+
isLoading: boolean
|
|
13
|
+
onPress?: () => void
|
|
14
|
+
unreadCommentsCount?: number
|
|
15
|
+
size?: 'small' | 'large'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const TeacherFeedbackButton = ({
|
|
19
|
+
isOpen,
|
|
20
|
+
onPress,
|
|
21
|
+
unreadCommentsCount,
|
|
22
|
+
isLoading,
|
|
23
|
+
size = 'large',
|
|
24
|
+
}: TeacherFeedbackButtonProps) => {
|
|
25
|
+
const handlePress = (event: GestureResponderEvent) => {
|
|
26
|
+
event.stopPropagation()
|
|
27
|
+
onPress?.()
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
event.isFromFeedbackButton = true
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (isOpen) {
|
|
33
|
+
return (
|
|
34
|
+
<Button
|
|
35
|
+
key='open'
|
|
36
|
+
id={TEACHER_FEEDBACK_BUTTON_ID}
|
|
37
|
+
onPress={handlePress}
|
|
38
|
+
size='large'
|
|
39
|
+
variant='primary'
|
|
40
|
+
disabled={isLoading}
|
|
41
|
+
isLoading={isLoading}
|
|
42
|
+
style={{
|
|
43
|
+
container: styles.container,
|
|
44
|
+
button: [styles.button, { borderColor: COLORS.NEUTRAL_5 }, styles[size]],
|
|
45
|
+
}}
|
|
46
|
+
data-skip-confetti='true'
|
|
47
|
+
customColorScheme={COLOR_SCHEMES.GREY}
|
|
48
|
+
icon={<XCloseIcon size={size === 'large' ? 37 : 26} />}
|
|
49
|
+
/>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Button
|
|
55
|
+
key='closed'
|
|
56
|
+
id={TEACHER_FEEDBACK_BUTTON_ID}
|
|
57
|
+
onPress={handlePress}
|
|
58
|
+
size='large'
|
|
59
|
+
variant='primary'
|
|
60
|
+
disabled={isLoading}
|
|
61
|
+
isLoading={isLoading}
|
|
62
|
+
style={{
|
|
63
|
+
container: styles.container,
|
|
64
|
+
button: [
|
|
65
|
+
styles.button,
|
|
66
|
+
{ borderColor: !!unreadCommentsCount ? COLORS.BLUE_6 : COLORS.NEUTRAL_5 },
|
|
67
|
+
styles[size],
|
|
68
|
+
],
|
|
69
|
+
}}
|
|
70
|
+
customColorScheme={!!unreadCommentsCount ? COLOR_SCHEMES.BLUE : COLOR_SCHEMES.GREY}
|
|
71
|
+
icon={
|
|
72
|
+
<View style={styles.iconContainer}>
|
|
73
|
+
<MessageBubbleIcon
|
|
74
|
+
color={!!unreadCommentsCount ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_9}
|
|
75
|
+
size={size === 'large' ? 37 : 26}
|
|
76
|
+
/>
|
|
77
|
+
{!!unreadCommentsCount && (
|
|
78
|
+
<View style={styles.badgeContainer}>
|
|
79
|
+
<UnreadMessagesBadge badgeContent={unreadCommentsCount} />
|
|
80
|
+
</View>
|
|
81
|
+
)}
|
|
82
|
+
</View>
|
|
83
|
+
}
|
|
84
|
+
/>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const styles = StyleSheet.create({
|
|
89
|
+
container: {
|
|
90
|
+
width: 54,
|
|
91
|
+
height: 54,
|
|
92
|
+
},
|
|
93
|
+
small: {
|
|
94
|
+
width: 50,
|
|
95
|
+
height: 50,
|
|
96
|
+
},
|
|
97
|
+
large: {
|
|
98
|
+
width: 75,
|
|
99
|
+
height: 75,
|
|
100
|
+
},
|
|
101
|
+
button: {
|
|
102
|
+
borderWidth: 2,
|
|
103
|
+
},
|
|
104
|
+
buttonLarge: {
|
|
105
|
+
width: 75,
|
|
106
|
+
height: 75,
|
|
107
|
+
borderWidth: 2,
|
|
108
|
+
},
|
|
109
|
+
iconContainer: {
|
|
110
|
+
position: 'relative',
|
|
111
|
+
},
|
|
112
|
+
badgeContainer: {
|
|
113
|
+
position: 'absolute',
|
|
114
|
+
top: -17,
|
|
115
|
+
right: -17,
|
|
116
|
+
},
|
|
117
|
+
})
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ButtonStates, COLORS } from '@magmamath/react-native-ui'
|
|
2
|
+
|
|
3
|
+
export const COLOR_SCHEMES = {
|
|
4
|
+
BLUE: {
|
|
5
|
+
[ButtonStates.DEFAULT]: {
|
|
6
|
+
borderColor: COLORS.BLUE_6,
|
|
7
|
+
raiseColor: COLORS.BLUE_6,
|
|
8
|
+
backgroundColor: COLORS.PRIMARY_BLUE,
|
|
9
|
+
},
|
|
10
|
+
[ButtonStates.PRESSED]: {
|
|
11
|
+
borderColor: COLORS.BLUE_6,
|
|
12
|
+
raiseColor: COLORS.BLUE_6,
|
|
13
|
+
backgroundColor: COLORS.PRIMARY_BLUE,
|
|
14
|
+
},
|
|
15
|
+
[ButtonStates.HOVER]: {
|
|
16
|
+
borderColor: COLORS.BLUE_6,
|
|
17
|
+
raiseColor: COLORS.BLUE_6,
|
|
18
|
+
backgroundColor: COLORS.PRIMARY_BLUE,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
GREY: {
|
|
22
|
+
[ButtonStates.DEFAULT]: {
|
|
23
|
+
borderColor: COLORS.NEUTRAL_5,
|
|
24
|
+
raiseColor: COLORS.NEUTRAL_5,
|
|
25
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
26
|
+
},
|
|
27
|
+
[ButtonStates.PRESSED]: {
|
|
28
|
+
borderColor: COLORS.NEUTRAL_5,
|
|
29
|
+
raiseColor: COLORS.NEUTRAL_5,
|
|
30
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
31
|
+
},
|
|
32
|
+
[ButtonStates.HOVER]: {
|
|
33
|
+
borderColor: COLORS.NEUTRAL_5,
|
|
34
|
+
raiseColor: COLORS.NEUTRAL_5,
|
|
35
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View, Text, StyleSheet } from 'react-native'
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
import { getRelativeTime } from '../../helpers'
|
|
5
|
+
import { BUENOS_AIRES_FONT } from '../../constants'
|
|
6
|
+
import { Locale } from '../../types/teacherFeedback.types'
|
|
7
|
+
|
|
8
|
+
type TeacherCommentProps = {
|
|
9
|
+
content: string
|
|
10
|
+
teacherName: string
|
|
11
|
+
createdAt: Date
|
|
12
|
+
locale: Locale | null
|
|
13
|
+
isLastComment: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const TeacherComment = ({ content, teacherName, createdAt, locale, isLastComment }: TeacherCommentProps) => {
|
|
17
|
+
return (
|
|
18
|
+
<View style={{ marginBottom: isLastComment ? 8 : 0 }}>
|
|
19
|
+
<View style={styles.authorInfo}>
|
|
20
|
+
<Text style={styles.teacherName} numberOfLines={1}>
|
|
21
|
+
{teacherName}
|
|
22
|
+
</Text>
|
|
23
|
+
<View style={styles.spacer} />
|
|
24
|
+
<Text style={styles.dateAdded} numberOfLines={1}>
|
|
25
|
+
{getRelativeTime(createdAt, locale ?? Locale.US)}
|
|
26
|
+
</Text>
|
|
27
|
+
</View>
|
|
28
|
+
|
|
29
|
+
<View style={styles.container}>
|
|
30
|
+
<Text style={styles.text}>{content}</Text>
|
|
31
|
+
</View>
|
|
32
|
+
</View>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const styles = StyleSheet.create({
|
|
37
|
+
container: {
|
|
38
|
+
padding: 8,
|
|
39
|
+
gap: 8,
|
|
40
|
+
borderTopLeftRadius: 8,
|
|
41
|
+
borderTopRightRadius: 8,
|
|
42
|
+
borderBottomRightRadius: 8,
|
|
43
|
+
shadowColor: COLORS.PRIMARY_SHADOW,
|
|
44
|
+
shadowOffset: { width: 0, height: 1 },
|
|
45
|
+
shadowOpacity: 0.25,
|
|
46
|
+
shadowRadius: 3,
|
|
47
|
+
elevation: 3,
|
|
48
|
+
backgroundColor: COLORS.NEUTRAL_3,
|
|
49
|
+
},
|
|
50
|
+
text: {
|
|
51
|
+
fontSize: 20,
|
|
52
|
+
fontFamily: BUENOS_AIRES_FONT,
|
|
53
|
+
color: COLORS.NEUTRAL_10,
|
|
54
|
+
lineHeight: 20,
|
|
55
|
+
},
|
|
56
|
+
authorInfo: {
|
|
57
|
+
flexDirection: 'row',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
gap: 8,
|
|
60
|
+
},
|
|
61
|
+
teacherName: {
|
|
62
|
+
maxWidth: 200,
|
|
63
|
+
fontSize: 16,
|
|
64
|
+
fontWeight: '600',
|
|
65
|
+
fontFamily: BUENOS_AIRES_FONT,
|
|
66
|
+
color: COLORS.NEUTRAL_9,
|
|
67
|
+
},
|
|
68
|
+
dateAdded: {
|
|
69
|
+
maxWidth: 140,
|
|
70
|
+
fontSize: 16,
|
|
71
|
+
fontFamily: BUENOS_AIRES_FONT,
|
|
72
|
+
fontWeight: '400',
|
|
73
|
+
color: COLORS.NEUTRAL_7,
|
|
74
|
+
},
|
|
75
|
+
spacer: {
|
|
76
|
+
height: 14,
|
|
77
|
+
width: 2,
|
|
78
|
+
backgroundColor: COLORS.NEUTRAL_6,
|
|
79
|
+
},
|
|
80
|
+
})
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react'
|
|
2
|
+
import { Platform, ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native'
|
|
3
|
+
import { Locale, TeacherComment as FeedbackComment } from '../../types/teacherFeedback.types'
|
|
4
|
+
import { TeacherComment } from './TeacherComment'
|
|
5
|
+
import { EmptyComment } from '../EmptyComment/EmptyComment'
|
|
6
|
+
import { EMPTY_COMMENT_ID } from '../../constants'
|
|
7
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
8
|
+
|
|
9
|
+
const TOOLBAR_HEIGHT = 140
|
|
10
|
+
const BOTTOM_OFFSET = Platform.OS === 'web' ? 270 : 304
|
|
11
|
+
const SIMPLE_MODE_OFFSET = 70
|
|
12
|
+
|
|
13
|
+
type TeacherFeedbackCommentsProps = {
|
|
14
|
+
comments: FeedbackComment[] | null
|
|
15
|
+
locale: Locale | null
|
|
16
|
+
mode: 'regular' | 'simple'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const TeacherFeedbackComments = ({ comments, locale, mode }: TeacherFeedbackCommentsProps) => {
|
|
20
|
+
const ref = useRef<ScrollView | null>(null)
|
|
21
|
+
const dimensions = useWindowDimensions()
|
|
22
|
+
const MAX_HEIGHT = dimensions.height - TOOLBAR_HEIGHT - BOTTOM_OFFSET
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
ref.current?.scrollToEnd({ animated: false })
|
|
26
|
+
}, [])
|
|
27
|
+
|
|
28
|
+
if (!comments) return null
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<View style={[styles.container, { maxHeight: MAX_HEIGHT - (mode === 'simple' ? SIMPLE_MODE_OFFSET : 0) }]}>
|
|
32
|
+
<ScrollView
|
|
33
|
+
ref={ref}
|
|
34
|
+
contentContainerStyle={styles.commentsList}
|
|
35
|
+
onContentSizeChange={() => ref.current?.scrollToEnd()}
|
|
36
|
+
>
|
|
37
|
+
{comments.length === 1 && comments[0]._id === EMPTY_COMMENT_ID ? (
|
|
38
|
+
<EmptyComment locale={locale} />
|
|
39
|
+
) : (
|
|
40
|
+
comments.map((comment, index) => (
|
|
41
|
+
<TeacherComment
|
|
42
|
+
key={comment._id}
|
|
43
|
+
teacherName={comment.teacherName}
|
|
44
|
+
content={comment.content}
|
|
45
|
+
createdAt={comment.createdAt}
|
|
46
|
+
locale={locale}
|
|
47
|
+
isLastComment={index === comments.length - 1}
|
|
48
|
+
/>
|
|
49
|
+
))
|
|
50
|
+
)}
|
|
51
|
+
</ScrollView>
|
|
52
|
+
</View>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const styles = StyleSheet.create({
|
|
57
|
+
container: {
|
|
58
|
+
width: 368,
|
|
59
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
60
|
+
paddingTop: 8,
|
|
61
|
+
paddingLeft: 8,
|
|
62
|
+
paddingRight: 8,
|
|
63
|
+
paddingBottom: 0,
|
|
64
|
+
borderRadius: 8,
|
|
65
|
+
},
|
|
66
|
+
commentsList: {
|
|
67
|
+
gap: 8,
|
|
68
|
+
},
|
|
69
|
+
})
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Text, View, StyleSheet, Platform, StyleProp, ViewStyle } from 'react-native'
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
|
|
5
|
+
type UnreadMessagesBadgeProps = {
|
|
6
|
+
badgeContent?: number
|
|
7
|
+
withBorder?: boolean
|
|
8
|
+
style?: StyleProp<ViewStyle>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const UnreadMessagesBadge = ({ badgeContent, withBorder = false, style }: UnreadMessagesBadgeProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<View
|
|
14
|
+
style={[
|
|
15
|
+
styles.container,
|
|
16
|
+
style,
|
|
17
|
+
!badgeContent && styles.emptyBadge,
|
|
18
|
+
withBorder && styles.border,
|
|
19
|
+
withBorder && (badgeContent ? styles.withBorderSize : styles.withBorderSizeEmpty),
|
|
20
|
+
]}
|
|
21
|
+
>
|
|
22
|
+
<Text style={styles.text}>{badgeContent && badgeContent > 99 ? '99+' : badgeContent}</Text>
|
|
23
|
+
</View>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const styles = StyleSheet.create({
|
|
28
|
+
container: {
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
width: 20,
|
|
32
|
+
height: 20,
|
|
33
|
+
borderRadius: 10,
|
|
34
|
+
backgroundColor: COLORS.PRIMARY_RED,
|
|
35
|
+
},
|
|
36
|
+
emptyBadge: {
|
|
37
|
+
width: 10,
|
|
38
|
+
height: 10,
|
|
39
|
+
},
|
|
40
|
+
border: {
|
|
41
|
+
borderWidth: 1.5,
|
|
42
|
+
borderColor: COLORS.NEUTRAL_1,
|
|
43
|
+
},
|
|
44
|
+
withBorderSize: {
|
|
45
|
+
width: 20,
|
|
46
|
+
height: 20,
|
|
47
|
+
borderRadius: 10,
|
|
48
|
+
},
|
|
49
|
+
withBorderSizeEmpty: {
|
|
50
|
+
width: 11.5,
|
|
51
|
+
height: 11.5,
|
|
52
|
+
borderRadius: 5.75,
|
|
53
|
+
},
|
|
54
|
+
text: {
|
|
55
|
+
fontSize: 12,
|
|
56
|
+
lineHeight: 16,
|
|
57
|
+
fontWeight: '600',
|
|
58
|
+
fontFamily: Platform.OS === 'web' ? 'Open Sans, sans-serif' : 'OpenSans-SemiBold',
|
|
59
|
+
color: COLORS.NEUTRAL_1,
|
|
60
|
+
},
|
|
61
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Svg, { Path } from 'react-native-svg'
|
|
3
|
+
import { IconProps, COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
|
|
5
|
+
export const MessageBubbleIcon = ({ size = 26, color = COLORS.NEUTRAL_1 }: IconProps) => {
|
|
6
|
+
return (
|
|
7
|
+
<Svg width={size} height={size} viewBox='0 0 26 26' fill='none'>
|
|
8
|
+
<Path
|
|
9
|
+
d='M1.46731 10.0594C0.934026 14.231 2.94959 17.0124 4.72827 18.403C5.15473 20.0717 4.90596 21.8796 4.72827 22.5749C6.86227 22.1577 8.40099 20.946 8.93496 20.2507C12.6702 21.2937 23.0923 21.063 24.4129 14.7527C25.5097 9.51166 22.2158 5.12788 15.3416 3.80165C7.2255 2.23582 2.01279 5.79234 1.46731 10.0594Z'
|
|
10
|
+
stroke={color}
|
|
11
|
+
strokeWidth='2'
|
|
12
|
+
strokeLinejoin='round'
|
|
13
|
+
/>
|
|
14
|
+
</Svg>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Svg, { Path } from 'react-native-svg'
|
|
3
|
+
import { IconProps, COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
|
|
5
|
+
export const XCloseIcon = ({ size = 26, color = COLORS.NEUTRAL_9 }: IconProps) => {
|
|
6
|
+
return (
|
|
7
|
+
<Svg width={size} height={size} viewBox='0 0 26 26' fill='none'>
|
|
8
|
+
<Path
|
|
9
|
+
d='M4.38388 2.61612C3.89573 2.12796 3.10427 2.12796 2.61612 2.61612C2.12796 3.10427 2.12796 3.89573 2.61612 4.38388L11.2322 13L2.61612 21.6161C2.12796 22.1043 2.12796 22.8957 2.61612 23.3839C3.10427 23.872 3.89573 23.872 4.38388 23.3839L13 14.7678L21.6161 23.3839C22.1043 23.872 22.8957 23.872 23.3839 23.3839C23.872 22.8957 23.872 22.1043 23.3839 21.6161L14.7678 13L23.3839 4.38388C23.872 3.89573 23.872 3.10427 23.3839 2.61612C22.8957 2.12796 22.1043 2.12796 21.6161 2.61612L13 11.2322L4.38388 2.61612Z'
|
|
10
|
+
fill={color}
|
|
11
|
+
/>
|
|
12
|
+
</Svg>
|
|
13
|
+
)
|
|
14
|
+
}
|