@magmamath/students-features 0.9.6-rc.0 → 0.9.6-rc.2
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/model/t2s.js +3 -4
- package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +3 -10
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/EOAModal.js +4 -2
- package/dist/commonjs/features/endOfAssignment/components/EOAModal.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js +3 -5
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +1 -2
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +2 -9
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/helpers.js +3 -10
- package/dist/commonjs/features/endOfAssignment/helpers.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/model/model.js +0 -7
- package/dist/commonjs/features/endOfAssignment/model/model.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js +2 -2
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +6 -0
- package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/Keyboard.js +0 -2
- package/dist/commonjs/features/keyboard/components/Keyboard.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/KeysList/KeysList.js +1 -2
- package/dist/commonjs/features/keyboard/components/KeysList/KeysList.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/MainLayout.js +2 -1
- package/dist/commonjs/features/keyboard/components/MainLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js +1 -14
- package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.js +23 -30
- package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +0 -15
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js +18 -18
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
- package/dist/module/features/chatbot/model/t2s.js +3 -4
- package/dist/module/features/chatbot/model/t2s.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +3 -10
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/EOAModal.js +4 -2
- package/dist/module/features/endOfAssignment/components/EOAModal.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js +4 -6
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +2 -3
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +2 -9
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/module/features/endOfAssignment/helpers.js +2 -8
- package/dist/module/features/endOfAssignment/helpers.js.map +1 -1
- package/dist/module/features/endOfAssignment/model/model.js +0 -7
- package/dist/module/features/endOfAssignment/model/model.js.map +1 -1
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js +2 -2
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
- package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +6 -0
- package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/Keyboard.js +0 -2
- package/dist/module/features/keyboard/components/Keyboard.js.map +1 -1
- package/dist/module/features/keyboard/components/KeysList/KeysList.js +1 -2
- package/dist/module/features/keyboard/components/KeysList/KeysList.js.map +1 -1
- package/dist/module/features/keyboard/components/MainLayout.js +2 -1
- package/dist/module/features/keyboard/components/MainLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/Numpad/Numpad.js +1 -14
- package/dist/module/features/keyboard/components/Numpad/Numpad.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/UnitTabs.js +23 -30
- package/dist/module/features/keyboard/components/UnitsLayout/UnitTabs.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +0 -15
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/module/features/keyboard/types/MathKeysGroups/units.js +19 -19
- package/dist/module/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +1 -7
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts +3 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts +1 -3
- package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts +0 -5
- package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts +2 -2
- package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +2 -3
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/KeysList/KeysList.d.ts +0 -1
- package/dist/typescript/commonjs/features/keyboard/components/KeysList/KeysList.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/Numpad/Numpad.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +2 -26
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts +208 -208
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts +1 -7
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts +3 -1
- package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/helpers.d.ts +1 -3
- package/dist/typescript/module/features/endOfAssignment/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/model/model.d.ts +0 -5
- package/dist/typescript/module/features/endOfAssignment/model/model.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/types.d.ts +2 -2
- package/dist/typescript/module/features/endOfAssignment/types.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +2 -3
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/KeysList/KeysList.d.ts +0 -1
- package/dist/typescript/module/features/keyboard/components/KeysList/KeysList.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/Numpad/Numpad.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/UnitTabs.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/UnitsLayout.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +2 -26
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts +208 -208
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/features/chatbot/model/t2s.ts +2 -3
- package/src/features/chatbot/types/api.types.ts +1 -10
- package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +10 -20
- package/src/features/endOfAssignment/components/EOAModal.tsx +9 -2
- package/src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx +6 -6
- package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx +2 -2
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +6 -17
- package/src/features/endOfAssignment/helpers.ts +3 -10
- package/src/features/endOfAssignment/model/model.ts +1 -5
- package/src/features/endOfAssignment/types.ts +1 -2
- package/src/features/endOfAssignment/ui/PracticeButtonGroup.tsx +3 -4
- package/src/features/keyboard/components/AlgebraLayout/AlgebraLayout.tsx +11 -1
- package/src/features/keyboard/components/Keyboard.tsx +0 -2
- package/src/features/keyboard/components/KeysList/KeysList.tsx +1 -2
- package/src/features/keyboard/components/MainLayout.tsx +1 -0
- package/src/features/keyboard/components/Numpad/Numpad.tsx +1 -18
- package/src/features/keyboard/components/UnitsLayout/UnitTabs.tsx +23 -29
- package/src/features/keyboard/components/UnitsLayout/UnitsLayout.tsx +1 -0
- package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +0 -4
- package/src/features/keyboard/types/MathKeysGroups/units.tsx +14 -13
- package/dist/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js +0 -44
- package/dist/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js.map +0 -1
- package/dist/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js +0 -38
- package/dist/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js.map +0 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts +0 -10
- package/dist/typescript/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts.map +0 -1
- package/dist/typescript/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts +0 -10
- package/dist/typescript/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts.map +0 -1
- package/src/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.tsx +0 -43
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/keyboard/types/MathKeysGroups/units.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/keyboard/types/MathKeysGroups/units.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAiCzB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC9B,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0E5B,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsE1B,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmI5B,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6D5B,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkE1B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/students-features",
|
|
3
|
-
"version": "0.9.6-rc.
|
|
3
|
+
"version": "0.9.6-rc.2",
|
|
4
4
|
"description": "Magmamath features library",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"react-native-svg": "^15.10.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@magmamath/react-native-ui": "0.4.
|
|
32
|
+
"@magmamath/react-native-ui": "0.4.44",
|
|
33
33
|
"@react-native/eslint-config": "^0.73.1",
|
|
34
34
|
"@release-it/conventional-changelog": "^9.0.2",
|
|
35
35
|
"@types/jest": "^29.5.5",
|
|
@@ -86,12 +86,11 @@ export class ChatTextToSpeechModel {
|
|
|
86
86
|
input: { text },
|
|
87
87
|
voice: config?.voice ?? DEFAULT_VOICE,
|
|
88
88
|
audioConfig: config?.audioConfig ?? AUDIO_CONFIG,
|
|
89
|
-
enableTimePointing: [],
|
|
90
89
|
})
|
|
91
90
|
|
|
92
91
|
// Response might be different type based on provided AUDIO_CONFIG
|
|
93
|
-
if (typeof response
|
|
94
|
-
audioPath = `data:audio/mpeg;base64,${response
|
|
92
|
+
if (typeof response === 'string') {
|
|
93
|
+
audioPath = `data:audio/mpeg;base64,${response}`
|
|
95
94
|
} else {
|
|
96
95
|
audioPath = response?.audioContent ?? ''
|
|
97
96
|
}
|
|
@@ -77,18 +77,9 @@ export type GoogleText2SpeechPayload = {
|
|
|
77
77
|
pitch: number
|
|
78
78
|
speakingRate: number
|
|
79
79
|
}
|
|
80
|
-
enableTimePointing?: string[]
|
|
81
80
|
}
|
|
82
81
|
|
|
83
|
-
export type
|
|
84
|
-
markName: string
|
|
85
|
-
timeSeconds: number
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export type GoogleText2SpeechResponse = {
|
|
89
|
-
audioContent?: string
|
|
90
|
-
timepoints?: Timepoint[]
|
|
91
|
-
}
|
|
82
|
+
export type GoogleText2SpeechResponse = string | undefined | { audioContent?: string }
|
|
92
83
|
|
|
93
84
|
export type ChatHintPayload = {
|
|
94
85
|
problemDescription: string
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react'
|
|
2
2
|
import { View, StyleSheet } from 'react-native'
|
|
3
|
+
|
|
3
4
|
import { useUnit } from 'effector-react'
|
|
4
5
|
import { SPACING, Typography, COLORS, FONT_FAMILY } from '@magmamath/react-native-ui'
|
|
5
6
|
|
|
@@ -10,8 +11,6 @@ import { GOOD_DRAWING_CARD_APPEARENCE_DELAY } from '../../constants'
|
|
|
10
11
|
import { AnimatedCardVariant, EOAModalContentProps, EOAModalVariant } from '../../types'
|
|
11
12
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
12
13
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
13
|
-
import { getEoaButtonColor } from '../../helpers'
|
|
14
|
-
import { AssessmentScoreCard } from '../AssessmentScoreCard/AssessmentScoreCard'
|
|
15
14
|
|
|
16
15
|
export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalContentProps) => {
|
|
17
16
|
const popUpData = useUnit(model.$popUpData)
|
|
@@ -23,7 +22,6 @@ export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalC
|
|
|
23
22
|
stats,
|
|
24
23
|
hasRecommendations,
|
|
25
24
|
isExam = false,
|
|
26
|
-
isAssessment = false,
|
|
27
25
|
newerAssignmentAvailable,
|
|
28
26
|
} = popUpData ?? {}
|
|
29
27
|
|
|
@@ -74,22 +72,14 @@ export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalC
|
|
|
74
72
|
</View>
|
|
75
73
|
|
|
76
74
|
<View style={styles.animationContainer}>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
variant={AnimatedCardVariant.CORRECT_ANSWER}
|
|
86
|
-
textContent={textContent}
|
|
87
|
-
solvedAmount={stats?.solvedAmount}
|
|
88
|
-
problemsAmount={stats?.problemsAmount}
|
|
89
|
-
shouldTriggerSparkles={cardsAnimationCompleted}
|
|
90
|
-
onAnimationEnd={onCorrectAnswerAnimationEnd}
|
|
91
|
-
/>
|
|
92
|
-
)}
|
|
75
|
+
<AnimatedCard
|
|
76
|
+
variant={AnimatedCardVariant.CORRECT_ANSWER}
|
|
77
|
+
textContent={textContent}
|
|
78
|
+
solvedAmount={stats?.solvedAmount}
|
|
79
|
+
problemsAmount={stats?.problemsAmount}
|
|
80
|
+
shouldTriggerSparkles={cardsAnimationCompleted}
|
|
81
|
+
onAnimationEnd={onCorrectAnswerAnimationEnd}
|
|
82
|
+
/>
|
|
93
83
|
|
|
94
84
|
{modalVariant === EOAModalVariant.HAS_GOOD_DRAWING && (
|
|
95
85
|
<AnimatedCard
|
|
@@ -106,9 +96,9 @@ export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalC
|
|
|
106
96
|
<PracticeButtonGroup
|
|
107
97
|
textContent={textContent}
|
|
108
98
|
isPracticeButtonVisible={isPracticeButtonVisible}
|
|
99
|
+
isExam={isExam}
|
|
109
100
|
onLeftButtonPress={model.hidePopUpAndLeave}
|
|
110
101
|
onRightButtonPress={handlePracticeButtonPress}
|
|
111
|
-
buttonColor={getEoaButtonColor(popUpData)}
|
|
112
102
|
/>
|
|
113
103
|
</View>
|
|
114
104
|
)
|
|
@@ -14,6 +14,7 @@ import { ExamPaused } from './ExamPaused/ExamPaused'
|
|
|
14
14
|
import { ExamSubmit } from './ExamSubmit/ExamSubmit'
|
|
15
15
|
|
|
16
16
|
import { getModalContainerSize, shouldDisplayModalBackground } from '../helpers'
|
|
17
|
+
import { ButtonColor } from '@magmamath/react-native-ui'
|
|
17
18
|
|
|
18
19
|
const MODAL_CONTENT_VARIANTS_MAP = new Map([
|
|
19
20
|
[EOAModalVariant.NO_CORRECT_ANSWERS, NoAnswer],
|
|
@@ -32,6 +33,7 @@ type EOAModalProps = {
|
|
|
32
33
|
model: EOAModel
|
|
33
34
|
textContent: EOAModalText
|
|
34
35
|
onPracticePress: () => void
|
|
36
|
+
buttonColor?: ButtonColor
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
/**
|
|
@@ -40,7 +42,7 @@ type EOAModalProps = {
|
|
|
40
42
|
* Dynamically renders a modal UI after an assignment ends, using the current `modalVariant`
|
|
41
43
|
* to determine which specific view to display (e.g., `NoAnswer`, `CorrectAnswer`, `CheatDetected`).
|
|
42
44
|
*/
|
|
43
|
-
export const EOAModal = ({ model, textContent, onPracticePress }: EOAModalProps) => {
|
|
45
|
+
export const EOAModal = ({ model, textContent, onPracticePress, buttonColor }: EOAModalProps) => {
|
|
44
46
|
const popUpData = useUnit(model.$popUpData)
|
|
45
47
|
const modalVariant = useUnit(model.$modalVariant)
|
|
46
48
|
|
|
@@ -62,7 +64,12 @@ export const EOAModal = ({ model, textContent, onPracticePress }: EOAModalProps)
|
|
|
62
64
|
style={getModalContainerSize(modalVariant)}
|
|
63
65
|
onClose={model.hidePopUp}
|
|
64
66
|
content={
|
|
65
|
-
<ModalContent
|
|
67
|
+
<ModalContent
|
|
68
|
+
model={model}
|
|
69
|
+
textContent={textContent}
|
|
70
|
+
onPracticePress={onPracticePress}
|
|
71
|
+
buttonColor={buttonColor}
|
|
72
|
+
/>
|
|
66
73
|
}
|
|
67
74
|
withBackground={withBackground}
|
|
68
75
|
/>
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
import { EOAModalContentProps } from '../../types'
|
|
14
14
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
15
15
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
16
|
-
import { getEoaButtonColor } from '../../helpers'
|
|
17
|
-
import { useUnit } from 'effector-react'
|
|
18
|
-
|
|
19
|
-
export const ExamPaused = ({ textContent, model }: EOAModalContentProps) => {
|
|
20
|
-
const popUpData = useUnit(model.$popUpData)
|
|
21
16
|
|
|
17
|
+
export const ExamPaused = ({
|
|
18
|
+
textContent,
|
|
19
|
+
model,
|
|
20
|
+
buttonColor = ButtonColor.PURPLE,
|
|
21
|
+
}: EOAModalContentProps) => {
|
|
22
22
|
useKeyBoard({
|
|
23
23
|
callback: (event) => {
|
|
24
24
|
if (event.key === KeyboardKeys.ENTER) {
|
|
@@ -39,7 +39,7 @@ export const ExamPaused = ({ textContent, model }: EOAModalContentProps) => {
|
|
|
39
39
|
|
|
40
40
|
<Button
|
|
41
41
|
variant={ButtonVariant.PRIMARY}
|
|
42
|
-
colorScheme={
|
|
42
|
+
colorScheme={buttonColor}
|
|
43
43
|
size={ButtonSize.LARGE}
|
|
44
44
|
style={{ text: styles.buttonText }}
|
|
45
45
|
onPress={model.hidePopUpAndLeave}
|
|
@@ -4,6 +4,7 @@ import { View, StyleSheet, Platform, Image } from 'react-native'
|
|
|
4
4
|
import { useUnit } from 'effector-react'
|
|
5
5
|
import {
|
|
6
6
|
Button,
|
|
7
|
+
ButtonColor,
|
|
7
8
|
ButtonSize,
|
|
8
9
|
ButtonVariant,
|
|
9
10
|
COLORS,
|
|
@@ -17,7 +18,6 @@ import { EOAModalContentProps } from '../../types'
|
|
|
17
18
|
import { PracticeButton } from '../../ui/PracticeButton'
|
|
18
19
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
19
20
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
20
|
-
import { getEoaButtonColor } from '../../helpers'
|
|
21
21
|
|
|
22
22
|
export const ExamSubmit = ({ textContent, model, onPracticePress }: EOAModalContentProps) => {
|
|
23
23
|
const popUpData = useUnit(model.$popUpData)
|
|
@@ -60,7 +60,7 @@ export const ExamSubmit = ({ textContent, model, onPracticePress }: EOAModalCont
|
|
|
60
60
|
<Button
|
|
61
61
|
variant={isPracticeButtonVisible ? ButtonVariant.TERTIARY : ButtonVariant.PRIMARY}
|
|
62
62
|
size={ButtonSize.LARGE}
|
|
63
|
-
colorScheme={
|
|
63
|
+
colorScheme={popUpData?.isExam ? ButtonColor.PURPLE : ButtonColor.BLUE}
|
|
64
64
|
style={{ text: { textTransform: 'uppercase' } }}
|
|
65
65
|
onPress={model.hidePopUpAndLeave}
|
|
66
66
|
>
|
|
@@ -16,19 +16,17 @@ import { EOAModalContentProps } from '../../types'
|
|
|
16
16
|
import { NoAnswerContent } from './NoAnswerContent'
|
|
17
17
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
18
18
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
19
|
-
import { getEoaButtonColor } from '../../helpers'
|
|
20
|
-
import { AssessmentScoreCard } from '../AssessmentScoreCard/AssessmentScoreCard'
|
|
21
19
|
|
|
22
20
|
export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalContentProps) => {
|
|
23
21
|
const popUpData = useUnit(model.$popUpData)
|
|
24
22
|
|
|
25
|
-
const { stats, isExam,
|
|
23
|
+
const { stats, isExam, user } = popUpData ?? {}
|
|
26
24
|
|
|
27
25
|
function getButtons() {
|
|
28
26
|
const buttons = [
|
|
29
27
|
{
|
|
30
28
|
text: textContent.leftButtonText ?? '',
|
|
31
|
-
colorScheme:
|
|
29
|
+
colorScheme: isExam ? ButtonColor.PURPLE : ButtonColor.BLUE,
|
|
32
30
|
onPress: () => model.hidePopUpAndLeave(),
|
|
33
31
|
},
|
|
34
32
|
]
|
|
@@ -86,19 +84,10 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
86
84
|
</Typography>
|
|
87
85
|
)}
|
|
88
86
|
</View>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
problemsAmount={stats?.problemsAmount}
|
|
94
|
-
/>
|
|
95
|
-
) : (
|
|
96
|
-
<NoAnswerContent
|
|
97
|
-
solvedAmount={stats?.solvedAmount ?? 0}
|
|
98
|
-
problemsAmount={stats?.problemsAmount ?? 0}
|
|
99
|
-
/>
|
|
100
|
-
)}
|
|
101
|
-
|
|
87
|
+
<NoAnswerContent
|
|
88
|
+
solvedAmount={stats?.solvedAmount ?? 0}
|
|
89
|
+
problemsAmount={stats?.problemsAmount ?? 0}
|
|
90
|
+
/>
|
|
102
91
|
<View style={styles.buttonsContainer}>
|
|
103
92
|
{buttons.map((button, index) => (
|
|
104
93
|
<Button
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { MODALS_WITH_BACKGROUND } from './constants'
|
|
2
|
-
import {
|
|
3
|
-
import { ButtonColor } from '@magmamath/react-native-ui'
|
|
2
|
+
import { EOAModalVariant } from './types'
|
|
4
3
|
|
|
5
4
|
export const getModalContainerSize = (modalVariant: EOAModalVariant) => {
|
|
6
5
|
switch (modalVariant) {
|
|
7
6
|
case EOAModalVariant.EXAM_SUBMIT:
|
|
8
7
|
case EOAModalVariant.EXAM_SAFE_MODE_SUBMIT:
|
|
9
|
-
return { container: { width:
|
|
8
|
+
return { container: { width: 600, height: 384 } }
|
|
10
9
|
case EOAModalVariant.EXAM_PAUSED:
|
|
11
10
|
case EOAModalVariant.EXAM_SAFE_MODE_CHEAT_DETECTED:
|
|
12
11
|
return { container: { width: 560, height: 338 } }
|
|
13
12
|
case EOAModalVariant.EXAM_SAFE_MODE_LEAVE:
|
|
14
|
-
return { container: { width: 550, height:
|
|
13
|
+
return { container: { width: 550, height: 280 } }
|
|
15
14
|
case EOAModalVariant.HAS_GOOD_DRAWING:
|
|
16
15
|
return { container: { width: 957, height: 550 } }
|
|
17
16
|
case EOAModalVariant.HAS_CORRECT_ANSWERS:
|
|
@@ -27,9 +26,3 @@ export const shouldDisplayModalBackground = (modalVariant: EOAModalVariant | nul
|
|
|
27
26
|
|
|
28
27
|
return MODALS_WITH_BACKGROUND.includes(modalVariant)
|
|
29
28
|
}
|
|
30
|
-
|
|
31
|
-
export const getEoaButtonColor = (popupData: EOAModalData | null): ButtonColor => {
|
|
32
|
-
if (popupData?.isAssessment) return ButtonColor.SUNSET
|
|
33
|
-
if (popupData?.isExam) return ButtonColor.PURPLE
|
|
34
|
-
return ButtonColor.BLUE
|
|
35
|
-
}
|
|
@@ -9,7 +9,6 @@ export class EOAModel {
|
|
|
9
9
|
public readonly leavePressed = createEvent()
|
|
10
10
|
public readonly goToFirstProblemPressed = createEvent()
|
|
11
11
|
public readonly recommendationsUpdated = createEvent<boolean>()
|
|
12
|
-
public readonly popUpStatsUpdated = createEvent<Partial<EOAModalData['stats']>>()
|
|
13
12
|
public readonly popUpTriggered = createEvent<EOAEventType>()
|
|
14
13
|
|
|
15
14
|
public readonly $popUpData = createStore<EOAModalData | null>(null)
|
|
@@ -17,9 +16,6 @@ export class EOAModel {
|
|
|
17
16
|
.on(this.recommendationsUpdated, (state, hasRecommendations) =>
|
|
18
17
|
state ? { ...state, hasRecommendations } : state,
|
|
19
18
|
)
|
|
20
|
-
.on(this.popUpStatsUpdated, (state, payload) =>
|
|
21
|
-
state ? { ...state, stats: { ...state.stats, ...payload } } : state,
|
|
22
|
-
)
|
|
23
19
|
.reset(this.hidePopUp)
|
|
24
20
|
|
|
25
21
|
public readonly $modalVariant = createStore<EOAModalVariant | null>(null)
|
|
@@ -37,7 +33,7 @@ export class EOAModel {
|
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
if (eventType === EOAEventType.EXAM_PAUSED) return EOAModalVariant.EXAM_PAUSED
|
|
40
|
-
|
|
36
|
+
|
|
41
37
|
if (eventType === EOAEventType.CHEAT_DETECTED) {
|
|
42
38
|
return EOAModalVariant.EXAM_SAFE_MODE_CHEAT_DETECTED
|
|
43
39
|
}
|
|
@@ -34,11 +34,11 @@ export type EOAModalContentProps = {
|
|
|
34
34
|
textContent: EOAModalText
|
|
35
35
|
model: EOAModel
|
|
36
36
|
onPracticePress?: () => void
|
|
37
|
+
buttonColor?: ButtonColor
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
export type EOAModalData = {
|
|
40
41
|
isExam: boolean
|
|
41
|
-
isAssessment: boolean
|
|
42
42
|
newerAssignmentAvailable?: boolean
|
|
43
43
|
examFinished?: boolean
|
|
44
44
|
cheatDetection?: boolean
|
|
@@ -63,6 +63,5 @@ export type EOAModalText = {
|
|
|
63
63
|
correctAnswersPlural?: string
|
|
64
64
|
goodCalculations?: string
|
|
65
65
|
goodCalculationsPlural?: string
|
|
66
|
-
score?: string
|
|
67
66
|
}
|
|
68
67
|
}
|
|
@@ -11,14 +11,13 @@ import Animated, {
|
|
|
11
11
|
import { ButtonVariant, SPACING, Button, ButtonSize, ButtonColor } from '@magmamath/react-native-ui'
|
|
12
12
|
|
|
13
13
|
import { PracticeButton } from './PracticeButton'
|
|
14
|
-
import { getEoaButtonColor } from '../helpers'
|
|
15
14
|
|
|
16
15
|
type PracticeButtonGroupProps = {
|
|
17
16
|
textContent: { leftButtonText?: string; rightButtonText?: string }
|
|
18
17
|
isPracticeButtonVisible: boolean
|
|
19
18
|
onLeftButtonPress: () => void
|
|
20
19
|
onRightButtonPress: () => void
|
|
21
|
-
|
|
20
|
+
isExam: boolean
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
export const PracticeButtonGroup = ({
|
|
@@ -26,7 +25,7 @@ export const PracticeButtonGroup = ({
|
|
|
26
25
|
isPracticeButtonVisible,
|
|
27
26
|
onLeftButtonPress,
|
|
28
27
|
onRightButtonPress,
|
|
29
|
-
|
|
28
|
+
isExam,
|
|
30
29
|
}: PracticeButtonGroupProps) => {
|
|
31
30
|
const buttonsContainerOpacity = useSharedValue(0)
|
|
32
31
|
|
|
@@ -46,7 +45,7 @@ export const PracticeButtonGroup = ({
|
|
|
46
45
|
<Button
|
|
47
46
|
variant={isPracticeButtonVisible ? ButtonVariant.TERTIARY : ButtonVariant.PRIMARY}
|
|
48
47
|
size={ButtonSize.LARGE}
|
|
49
|
-
colorScheme={
|
|
48
|
+
colorScheme={isExam ? ButtonColor.PURPLE : ButtonColor.BLUE}
|
|
50
49
|
style={{ text: { textTransform: 'uppercase' } }}
|
|
51
50
|
onPress={onLeftButtonPress}
|
|
52
51
|
>
|
|
@@ -49,7 +49,14 @@ export const AlgebraLayout = ({ onLayoutChange, ...props }: KeyboardLayoutProps)
|
|
|
49
49
|
]}
|
|
50
50
|
/>
|
|
51
51
|
)}
|
|
52
|
-
<KeysList
|
|
52
|
+
<KeysList
|
|
53
|
+
keys={currentKeys}
|
|
54
|
+
numOfRows={3}
|
|
55
|
+
style={{
|
|
56
|
+
container: styles.keyListContainer,
|
|
57
|
+
}}
|
|
58
|
+
{...props}
|
|
59
|
+
/>
|
|
53
60
|
</View>
|
|
54
61
|
)
|
|
55
62
|
}
|
|
@@ -76,4 +83,7 @@ const styles = StyleSheet.create({
|
|
|
76
83
|
flexBasis: 45,
|
|
77
84
|
width: 44,
|
|
78
85
|
},
|
|
86
|
+
keyListContainer: {
|
|
87
|
+
flexShrink: 1,
|
|
88
|
+
},
|
|
79
89
|
})
|
|
@@ -66,7 +66,6 @@ export const Keyboard = ({ style, characterType, isVisible = true, ...props }: K
|
|
|
66
66
|
const styles = StyleSheet.create({
|
|
67
67
|
container: {
|
|
68
68
|
flexDirection: 'row',
|
|
69
|
-
alignItems: 'flex-start',
|
|
70
69
|
justifyContent: 'space-between',
|
|
71
70
|
backgroundColor: COLORS.NEUTRAL_2,
|
|
72
71
|
borderRadius: 12,
|
|
@@ -75,7 +74,6 @@ const styles = StyleSheet.create({
|
|
|
75
74
|
paddingBottom: 13,
|
|
76
75
|
borderColor: COLORS.NEUTRAL_5,
|
|
77
76
|
borderWidth: 1,
|
|
78
|
-
width: 'auto',
|
|
79
77
|
height: 155,
|
|
80
78
|
...SHADOWS[2],
|
|
81
79
|
},
|
|
@@ -46,7 +46,7 @@ export const KeysList = ({
|
|
|
46
46
|
return (
|
|
47
47
|
<SelectGroup
|
|
48
48
|
style={{
|
|
49
|
-
container:
|
|
49
|
+
container: styles.container,
|
|
50
50
|
row: styles.row,
|
|
51
51
|
}}
|
|
52
52
|
numOfRows={numOfRows}
|
|
@@ -60,7 +60,6 @@ export const KeysList = ({
|
|
|
60
60
|
|
|
61
61
|
export const styles = StyleSheet.create({
|
|
62
62
|
container: {
|
|
63
|
-
width: 'auto',
|
|
64
63
|
gap: 9,
|
|
65
64
|
},
|
|
66
65
|
row: {
|
|
@@ -16,14 +16,7 @@ export const Numpad = ({ style, ...props }: NumpadProps) => {
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<View style={[styles.container, style]}>
|
|
19
|
-
<KeysList
|
|
20
|
-
keys={keyboardGroup.keys}
|
|
21
|
-
numOfRows={3}
|
|
22
|
-
style={{
|
|
23
|
-
container: styles.keysContainer,
|
|
24
|
-
}}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
19
|
+
<KeysList keys={keyboardGroup.keys} numOfRows={3} {...props} />
|
|
27
20
|
</View>
|
|
28
21
|
)
|
|
29
22
|
}
|
|
@@ -31,16 +24,6 @@ export const Numpad = ({ style, ...props }: NumpadProps) => {
|
|
|
31
24
|
const styles = StyleSheet.create({
|
|
32
25
|
container: {
|
|
33
26
|
borderLeftWidth: 1,
|
|
34
|
-
borderColor: 'transparent',
|
|
35
27
|
paddingLeft: SPACING[800],
|
|
36
|
-
marginLeft: 'auto',
|
|
37
|
-
},
|
|
38
|
-
keysContainer: {
|
|
39
|
-
display: 'flex',
|
|
40
|
-
width: 'auto',
|
|
41
|
-
flexGrow: 0,
|
|
42
|
-
flexShrink: 0,
|
|
43
|
-
flexBasis: 'auto',
|
|
44
|
-
gap: 9,
|
|
45
28
|
},
|
|
46
29
|
})
|
|
@@ -24,31 +24,29 @@ export const UnitTabs = ({ activeTab, tabs, onTabChange, ...props }: UnitTabsPro
|
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
26
|
<View style={styles.container}>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
))}
|
|
51
|
-
</View>
|
|
27
|
+
<TabGroup
|
|
28
|
+
activeTab={activeTab}
|
|
29
|
+
tabs={tabs}
|
|
30
|
+
onTabChange={onTabChange}
|
|
31
|
+
style={styles.tabs}
|
|
32
|
+
variant={TabVariant.SMALL}
|
|
33
|
+
/>
|
|
34
|
+
<View style={styles.keyGroupContainer}>
|
|
35
|
+
{keyboardGroups.map((keyGroup, index) => (
|
|
36
|
+
<KeysList
|
|
37
|
+
key={index}
|
|
38
|
+
keys={keyGroup}
|
|
39
|
+
numOfRows={1}
|
|
40
|
+
{...props}
|
|
41
|
+
style={{
|
|
42
|
+
option: {
|
|
43
|
+
text: styles.keysText,
|
|
44
|
+
container: styles.keyContainer,
|
|
45
|
+
button: styles.keyButton,
|
|
46
|
+
},
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
))}
|
|
52
50
|
</View>
|
|
53
51
|
</View>
|
|
54
52
|
)
|
|
@@ -56,12 +54,8 @@ export const UnitTabs = ({ activeTab, tabs, onTabChange, ...props }: UnitTabsPro
|
|
|
56
54
|
|
|
57
55
|
const styles = StyleSheet.create({
|
|
58
56
|
container: {
|
|
59
|
-
width: 283,
|
|
60
57
|
flex: 1,
|
|
61
|
-
},
|
|
62
|
-
tabsContainer: {
|
|
63
58
|
gap: 16,
|
|
64
|
-
flex: 1,
|
|
65
59
|
},
|
|
66
60
|
tabs: {
|
|
67
61
|
borderBottomWidth: 1,
|
|
@@ -10,22 +10,18 @@ export const useUnitTabs = () => {
|
|
|
10
10
|
() => [
|
|
11
11
|
{
|
|
12
12
|
title: t('keyboard.length'),
|
|
13
|
-
style: { paddingLeft: 0, paddingRight: 32, marginRight: -16 },
|
|
14
13
|
key: KeyboardUnitsGroupType.LENGTH,
|
|
15
14
|
},
|
|
16
15
|
{
|
|
17
16
|
title: t('keyboard.area'),
|
|
18
|
-
style: { paddingHorizontal: 10 },
|
|
19
17
|
key: KeyboardUnitsGroupType.AREA,
|
|
20
18
|
},
|
|
21
19
|
{
|
|
22
20
|
title: t('keyboard.volume'),
|
|
23
|
-
style: { paddingHorizontal: 10 },
|
|
24
21
|
key: KeyboardUnitsGroupType.VOLUME,
|
|
25
22
|
},
|
|
26
23
|
{
|
|
27
24
|
title: t('keyboard.weight'),
|
|
28
|
-
style: { paddingHorizontal: 10, paddingRight: 0 },
|
|
29
25
|
key: KeyboardUnitsGroupType.WEIGHT,
|
|
30
26
|
},
|
|
31
27
|
],
|
|
@@ -7,33 +7,34 @@ import { YenIcon } from '../../../../shared/icons/keyboard/YenIcon/YenIcon'
|
|
|
7
7
|
import { CentIcon } from '../../../../shared/icons/keyboard/CentIcon/CentIcon'
|
|
8
8
|
import { DEFAULT_KEY_ICON_PROPS } from '../../constants/constants'
|
|
9
9
|
import React from 'react'
|
|
10
|
-
import { IS_MOBILE } from '@magmamath/react-native-ui'
|
|
10
|
+
import { IS_MOBILE, IS_WEB } from '@magmamath/react-native-ui'
|
|
11
11
|
import { createMathKeysGroup } from './helpers'
|
|
12
12
|
|
|
13
13
|
const BASE_TEXT_STYLE = {
|
|
14
14
|
fontSize: 14,
|
|
15
|
-
fontWeight: 700
|
|
16
|
-
}
|
|
15
|
+
fontWeight: 700,
|
|
16
|
+
} as const
|
|
17
17
|
|
|
18
18
|
const STYLE_PRESETS = {
|
|
19
19
|
SMALL: {
|
|
20
|
-
button: { width:
|
|
21
|
-
container: { flexBasis:
|
|
20
|
+
button: { width: IS_WEB ? 40 : 44 },
|
|
21
|
+
container: IS_MOBILE ? { flexBasis: 48 } : undefined,
|
|
22
22
|
text: BASE_TEXT_STYLE,
|
|
23
23
|
},
|
|
24
24
|
MEDIUM: {
|
|
25
|
-
button: { width:
|
|
26
|
-
container: { flexBasis:
|
|
25
|
+
button: { width: IS_WEB ? 45 : 51 },
|
|
26
|
+
container: IS_MOBILE ? { flexBasis: 55 } : undefined,
|
|
27
27
|
text: BASE_TEXT_STYLE,
|
|
28
28
|
},
|
|
29
29
|
LARGE: {
|
|
30
|
-
button: { width:
|
|
31
|
-
container: { flexBasis:
|
|
30
|
+
button: { width: IS_WEB ? 48 : 55 },
|
|
31
|
+
container: IS_MOBILE ? { flexBasis: 59 } : undefined,
|
|
32
|
+
|
|
32
33
|
text: BASE_TEXT_STYLE,
|
|
33
34
|
},
|
|
34
35
|
XL: {
|
|
35
|
-
button: { width:
|
|
36
|
-
container: { flexBasis:
|
|
36
|
+
button: { width: IS_WEB ? 52 : 54 },
|
|
37
|
+
container: IS_MOBILE ? { flexBasis: 60 } : undefined,
|
|
37
38
|
text: BASE_TEXT_STYLE,
|
|
38
39
|
},
|
|
39
40
|
}
|
|
@@ -208,7 +209,7 @@ export const MATH_AREA_UNITS = createMathKeysGroup({
|
|
|
208
209
|
mathliveValue: '\\mathrm{mi}^2',
|
|
209
210
|
katexValue: 'mi^2',
|
|
210
211
|
mathQuillValue: 'mi^{2}',
|
|
211
|
-
style: STYLE_PRESETS.
|
|
212
|
+
style: STYLE_PRESETS.MEDIUM,
|
|
212
213
|
},
|
|
213
214
|
SQUARE_YARD: {
|
|
214
215
|
label: 'yd²',
|
|
@@ -324,7 +325,7 @@ export const MATH_VOLUME_UNITS = createMathKeysGroup({
|
|
|
324
325
|
mathliveValue: '\\mathrm{cup}',
|
|
325
326
|
katexValue: 'cup',
|
|
326
327
|
mathQuillValue: '\\cup',
|
|
327
|
-
style: STYLE_PRESETS.
|
|
328
|
+
style: STYLE_PRESETS.LARGE,
|
|
328
329
|
},
|
|
329
330
|
GAL: {
|
|
330
331
|
label: 'gal',
|