@magmamath/students-features 1.8.4-rc.8 → 1.8.4
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/pmProgress/shared/TreeNormalizer.js +5 -1
- package/dist/commonjs/features/pmProgress/shared/TreeNormalizer.js.map +1 -1
- package/dist/commonjs/features/uiMode/index.js +7 -0
- package/dist/commonjs/features/uiMode/index.js.map +1 -1
- package/dist/commonjs/features/uiMode/uiMode.helpers.js +7 -2
- package/dist/commonjs/features/uiMode/uiMode.helpers.js.map +1 -1
- package/dist/commonjs/index.js +0 -12
- package/dist/commonjs/index.js.map +1 -1
- package/dist/module/features/pmProgress/shared/TreeNormalizer.js +5 -1
- package/dist/module/features/pmProgress/shared/TreeNormalizer.js.map +1 -1
- package/dist/module/features/uiMode/index.js +1 -0
- package/dist/module/features/uiMode/index.js.map +1 -1
- package/dist/module/features/uiMode/uiMode.helpers.js +6 -1
- package/dist/module/features/uiMode/uiMode.helpers.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/typescript/commonjs/features/pmProgress/shared/TreeNormalizer.d.ts +4 -0
- package/dist/typescript/commonjs/features/pmProgress/shared/TreeNormalizer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/uiMode/index.d.ts +1 -0
- package/dist/typescript/commonjs/features/uiMode/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/uiMode/uiMode.helpers.d.ts +2 -0
- package/dist/typescript/commonjs/features/uiMode/uiMode.helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +0 -1
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/module/features/pmProgress/shared/TreeNormalizer.d.ts +4 -0
- package/dist/typescript/module/features/pmProgress/shared/TreeNormalizer.d.ts.map +1 -1
- package/dist/typescript/module/features/uiMode/index.d.ts +1 -0
- package/dist/typescript/module/features/uiMode/index.d.ts.map +1 -1
- package/dist/typescript/module/features/uiMode/uiMode.helpers.d.ts +2 -0
- package/dist/typescript/module/features/uiMode/uiMode.helpers.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +0 -1
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/package.json +2 -5
- package/src/features/pmProgress/shared/TreeNormalizer.ts +5 -1
- package/src/features/uiMode/__tests__/getUIMode.test.ts +64 -0
- package/src/features/uiMode/index.ts +1 -0
- package/src/features/uiMode/uiMode.helpers.ts +16 -1
- package/src/i18n/.generated/schema.json +1 -9
- package/src/index.ts +0 -1
- package/dist/commonjs/features/profile/Profile.js +0 -90
- package/dist/commonjs/features/profile/Profile.js.map +0 -1
- package/dist/commonjs/features/profile/components/actions/ProfileActions.js +0 -67
- package/dist/commonjs/features/profile/components/actions/ProfileActions.js.map +0 -1
- package/dist/commonjs/features/profile/components/cards/ProfileCard.js +0 -57
- package/dist/commonjs/features/profile/components/cards/ProfileCard.js.map +0 -1
- package/dist/commonjs/features/profile/components/info/AccountInfoCard.js +0 -90
- package/dist/commonjs/features/profile/components/info/AccountInfoCard.js.map +0 -1
- package/dist/commonjs/features/profile/components/modals/JoinClassModal.js +0 -154
- package/dist/commonjs/features/profile/components/modals/JoinClassModal.js.map +0 -1
- package/dist/commonjs/features/profile/components/modals/LogoutConfirmModal.js +0 -61
- package/dist/commonjs/features/profile/components/modals/LogoutConfirmModal.js.map +0 -1
- package/dist/commonjs/features/profile/components/modals/TranslationLanguageModal.js +0 -126
- package/dist/commonjs/features/profile/components/modals/TranslationLanguageModal.js.map +0 -1
- package/dist/commonjs/features/profile/components/settings/LanguageSettingsCard.js +0 -22
- package/dist/commonjs/features/profile/components/settings/LanguageSettingsCard.js.map +0 -1
- package/dist/commonjs/features/profile/components/settings/PreferencesCard.js +0 -70
- package/dist/commonjs/features/profile/components/settings/PreferencesCard.js.map +0 -1
- package/dist/commonjs/features/profile/components/settings/SettingRow.js +0 -48
- package/dist/commonjs/features/profile/components/settings/SettingRow.js.map +0 -1
- package/dist/commonjs/features/profile/components/settings/TextSettingsCard.js +0 -74
- package/dist/commonjs/features/profile/components/settings/TextSettingsCard.js.map +0 -1
- package/dist/commonjs/features/profile/components/settings/TextSizeSlider.js +0 -116
- package/dist/commonjs/features/profile/components/settings/TextSizeSlider.js.map +0 -1
- package/dist/commonjs/features/profile/components/settings/TextToSpeechRow.js +0 -35
- package/dist/commonjs/features/profile/components/settings/TextToSpeechRow.js.map +0 -1
- package/dist/commonjs/features/profile/components/settings/TranslationLanguageRow.js +0 -60
- package/dist/commonjs/features/profile/components/settings/TranslationLanguageRow.js.map +0 -1
- package/dist/commonjs/features/profile/context/ProfileContext.js +0 -18
- package/dist/commonjs/features/profile/context/ProfileContext.js.map +0 -1
- package/dist/commonjs/features/profile/index.js +0 -80
- package/dist/commonjs/features/profile/index.js.map +0 -1
- package/dist/commonjs/features/profile/model/ProfileApi.js +0 -15
- package/dist/commonjs/features/profile/model/ProfileApi.js.map +0 -1
- package/dist/commonjs/features/profile/model/ProfileJoinClassModel.js +0 -60
- package/dist/commonjs/features/profile/model/ProfileJoinClassModel.js.map +0 -1
- package/dist/commonjs/features/profile/model/ProfileLanguageModel.js +0 -30
- package/dist/commonjs/features/profile/model/ProfileLanguageModel.js.map +0 -1
- package/dist/commonjs/features/profile/model/ProfileModel.js +0 -53
- package/dist/commonjs/features/profile/model/ProfileModel.js.map +0 -1
- package/dist/commonjs/features/profile/model/profileModal.types.js +0 -6
- package/dist/commonjs/features/profile/model/profileModal.types.js.map +0 -1
- package/dist/commonjs/features/profile/shared/JoinClassError.js +0 -16
- package/dist/commonjs/features/profile/shared/JoinClassError.js.map +0 -1
- package/dist/commonjs/features/profile/shared/profile.constants.js +0 -29
- package/dist/commonjs/features/profile/shared/profile.constants.js.map +0 -1
- package/dist/commonjs/features/profile/shared/profile.helpers.js +0 -40
- package/dist/commonjs/features/profile/shared/profile.helpers.js.map +0 -1
- package/dist/commonjs/features/profile/shared/profile.types.js +0 -6
- package/dist/commonjs/features/profile/shared/profile.types.js.map +0 -1
- package/dist/module/features/profile/Profile.js +0 -84
- package/dist/module/features/profile/Profile.js.map +0 -1
- package/dist/module/features/profile/components/actions/ProfileActions.js +0 -61
- package/dist/module/features/profile/components/actions/ProfileActions.js.map +0 -1
- package/dist/module/features/profile/components/cards/ProfileCard.js +0 -51
- package/dist/module/features/profile/components/cards/ProfileCard.js.map +0 -1
- package/dist/module/features/profile/components/info/AccountInfoCard.js +0 -84
- package/dist/module/features/profile/components/info/AccountInfoCard.js.map +0 -1
- package/dist/module/features/profile/components/modals/JoinClassModal.js +0 -147
- package/dist/module/features/profile/components/modals/JoinClassModal.js.map +0 -1
- package/dist/module/features/profile/components/modals/LogoutConfirmModal.js +0 -55
- package/dist/module/features/profile/components/modals/LogoutConfirmModal.js.map +0 -1
- package/dist/module/features/profile/components/modals/TranslationLanguageModal.js +0 -120
- package/dist/module/features/profile/components/modals/TranslationLanguageModal.js.map +0 -1
- package/dist/module/features/profile/components/settings/LanguageSettingsCard.js +0 -16
- package/dist/module/features/profile/components/settings/LanguageSettingsCard.js.map +0 -1
- package/dist/module/features/profile/components/settings/PreferencesCard.js +0 -64
- package/dist/module/features/profile/components/settings/PreferencesCard.js.map +0 -1
- package/dist/module/features/profile/components/settings/SettingRow.js +0 -42
- package/dist/module/features/profile/components/settings/SettingRow.js.map +0 -1
- package/dist/module/features/profile/components/settings/TextSettingsCard.js +0 -68
- package/dist/module/features/profile/components/settings/TextSettingsCard.js.map +0 -1
- package/dist/module/features/profile/components/settings/TextSizeSlider.js +0 -109
- package/dist/module/features/profile/components/settings/TextSizeSlider.js.map +0 -1
- package/dist/module/features/profile/components/settings/TextToSpeechRow.js +0 -29
- package/dist/module/features/profile/components/settings/TextToSpeechRow.js.map +0 -1
- package/dist/module/features/profile/components/settings/TranslationLanguageRow.js +0 -54
- package/dist/module/features/profile/components/settings/TranslationLanguageRow.js.map +0 -1
- package/dist/module/features/profile/context/ProfileContext.js +0 -13
- package/dist/module/features/profile/context/ProfileContext.js.map +0 -1
- package/dist/module/features/profile/index.js +0 -11
- package/dist/module/features/profile/index.js.map +0 -1
- package/dist/module/features/profile/model/ProfileApi.js +0 -10
- package/dist/module/features/profile/model/ProfileApi.js.map +0 -1
- package/dist/module/features/profile/model/ProfileJoinClassModel.js +0 -55
- package/dist/module/features/profile/model/ProfileJoinClassModel.js.map +0 -1
- package/dist/module/features/profile/model/ProfileLanguageModel.js +0 -25
- package/dist/module/features/profile/model/ProfileLanguageModel.js.map +0 -1
- package/dist/module/features/profile/model/ProfileModel.js +0 -48
- package/dist/module/features/profile/model/ProfileModel.js.map +0 -1
- package/dist/module/features/profile/model/profileModal.types.js +0 -4
- package/dist/module/features/profile/model/profileModal.types.js.map +0 -1
- package/dist/module/features/profile/shared/JoinClassError.js +0 -11
- package/dist/module/features/profile/shared/JoinClassError.js.map +0 -1
- package/dist/module/features/profile/shared/profile.constants.js +0 -25
- package/dist/module/features/profile/shared/profile.constants.js.map +0 -1
- package/dist/module/features/profile/shared/profile.helpers.js +0 -32
- package/dist/module/features/profile/shared/profile.helpers.js.map +0 -1
- package/dist/module/features/profile/shared/profile.types.js +0 -4
- package/dist/module/features/profile/shared/profile.types.js.map +0 -1
- package/dist/typescript/commonjs/features/profile/Profile.d.ts +0 -6
- package/dist/typescript/commonjs/features/profile/Profile.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/__tests__/ProfileModel.test.d.ts +0 -2
- package/dist/typescript/commonjs/features/profile/__tests__/ProfileModel.test.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/__tests__/profile.helpers.test.d.ts +0 -2
- package/dist/typescript/commonjs/features/profile/__tests__/profile.helpers.test.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/actions/ProfileActions.d.ts +0 -3
- package/dist/typescript/commonjs/features/profile/components/actions/ProfileActions.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/cards/ProfileCard.d.ts +0 -10
- package/dist/typescript/commonjs/features/profile/components/cards/ProfileCard.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/info/AccountInfoCard.d.ts +0 -3
- package/dist/typescript/commonjs/features/profile/components/info/AccountInfoCard.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/modals/JoinClassModal.d.ts +0 -4
- package/dist/typescript/commonjs/features/profile/components/modals/JoinClassModal.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/modals/LogoutConfirmModal.d.ts +0 -4
- package/dist/typescript/commonjs/features/profile/components/modals/LogoutConfirmModal.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/modals/TranslationLanguageModal.d.ts +0 -4
- package/dist/typescript/commonjs/features/profile/components/modals/TranslationLanguageModal.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/settings/LanguageSettingsCard.d.ts +0 -3
- package/dist/typescript/commonjs/features/profile/components/settings/LanguageSettingsCard.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/settings/PreferencesCard.d.ts +0 -3
- package/dist/typescript/commonjs/features/profile/components/settings/PreferencesCard.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/settings/SettingRow.d.ts +0 -11
- package/dist/typescript/commonjs/features/profile/components/settings/SettingRow.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/settings/TextSettingsCard.d.ts +0 -3
- package/dist/typescript/commonjs/features/profile/components/settings/TextSettingsCard.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/settings/TextSizeSlider.d.ts +0 -8
- package/dist/typescript/commonjs/features/profile/components/settings/TextSizeSlider.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/settings/TextToSpeechRow.d.ts +0 -3
- package/dist/typescript/commonjs/features/profile/components/settings/TextToSpeechRow.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/components/settings/TranslationLanguageRow.d.ts +0 -3
- package/dist/typescript/commonjs/features/profile/components/settings/TranslationLanguageRow.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/context/ProfileContext.d.ts +0 -13
- package/dist/typescript/commonjs/features/profile/context/ProfileContext.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/index.d.ts +0 -12
- package/dist/typescript/commonjs/features/profile/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/model/ProfileApi.d.ts +0 -11
- package/dist/typescript/commonjs/features/profile/model/ProfileApi.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/model/ProfileJoinClassModel.d.ts +0 -14
- package/dist/typescript/commonjs/features/profile/model/ProfileJoinClassModel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/model/ProfileLanguageModel.d.ts +0 -13
- package/dist/typescript/commonjs/features/profile/model/ProfileLanguageModel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/model/ProfileModel.d.ts +0 -26
- package/dist/typescript/commonjs/features/profile/model/ProfileModel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/model/profileModal.types.d.ts +0 -14
- package/dist/typescript/commonjs/features/profile/model/profileModal.types.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/shared/JoinClassError.d.ts +0 -5
- package/dist/typescript/commonjs/features/profile/shared/JoinClassError.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/shared/profile.constants.d.ts +0 -20
- package/dist/typescript/commonjs/features/profile/shared/profile.constants.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/shared/profile.helpers.d.ts +0 -6
- package/dist/typescript/commonjs/features/profile/shared/profile.helpers.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/profile/shared/profile.types.d.ts +0 -27
- package/dist/typescript/commonjs/features/profile/shared/profile.types.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/Profile.d.ts +0 -6
- package/dist/typescript/module/features/profile/Profile.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/__tests__/ProfileModel.test.d.ts +0 -2
- package/dist/typescript/module/features/profile/__tests__/ProfileModel.test.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/__tests__/profile.helpers.test.d.ts +0 -2
- package/dist/typescript/module/features/profile/__tests__/profile.helpers.test.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/actions/ProfileActions.d.ts +0 -3
- package/dist/typescript/module/features/profile/components/actions/ProfileActions.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/cards/ProfileCard.d.ts +0 -10
- package/dist/typescript/module/features/profile/components/cards/ProfileCard.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/info/AccountInfoCard.d.ts +0 -3
- package/dist/typescript/module/features/profile/components/info/AccountInfoCard.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/modals/JoinClassModal.d.ts +0 -4
- package/dist/typescript/module/features/profile/components/modals/JoinClassModal.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/modals/LogoutConfirmModal.d.ts +0 -4
- package/dist/typescript/module/features/profile/components/modals/LogoutConfirmModal.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/modals/TranslationLanguageModal.d.ts +0 -4
- package/dist/typescript/module/features/profile/components/modals/TranslationLanguageModal.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/settings/LanguageSettingsCard.d.ts +0 -3
- package/dist/typescript/module/features/profile/components/settings/LanguageSettingsCard.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/settings/PreferencesCard.d.ts +0 -3
- package/dist/typescript/module/features/profile/components/settings/PreferencesCard.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/settings/SettingRow.d.ts +0 -11
- package/dist/typescript/module/features/profile/components/settings/SettingRow.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/settings/TextSettingsCard.d.ts +0 -3
- package/dist/typescript/module/features/profile/components/settings/TextSettingsCard.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/settings/TextSizeSlider.d.ts +0 -8
- package/dist/typescript/module/features/profile/components/settings/TextSizeSlider.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/settings/TextToSpeechRow.d.ts +0 -3
- package/dist/typescript/module/features/profile/components/settings/TextToSpeechRow.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/components/settings/TranslationLanguageRow.d.ts +0 -3
- package/dist/typescript/module/features/profile/components/settings/TranslationLanguageRow.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/context/ProfileContext.d.ts +0 -13
- package/dist/typescript/module/features/profile/context/ProfileContext.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/index.d.ts +0 -12
- package/dist/typescript/module/features/profile/index.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/model/ProfileApi.d.ts +0 -11
- package/dist/typescript/module/features/profile/model/ProfileApi.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/model/ProfileJoinClassModel.d.ts +0 -14
- package/dist/typescript/module/features/profile/model/ProfileJoinClassModel.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/model/ProfileLanguageModel.d.ts +0 -13
- package/dist/typescript/module/features/profile/model/ProfileLanguageModel.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/model/ProfileModel.d.ts +0 -26
- package/dist/typescript/module/features/profile/model/ProfileModel.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/model/profileModal.types.d.ts +0 -14
- package/dist/typescript/module/features/profile/model/profileModal.types.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/shared/JoinClassError.d.ts +0 -5
- package/dist/typescript/module/features/profile/shared/JoinClassError.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/shared/profile.constants.d.ts +0 -20
- package/dist/typescript/module/features/profile/shared/profile.constants.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/shared/profile.helpers.d.ts +0 -6
- package/dist/typescript/module/features/profile/shared/profile.helpers.d.ts.map +0 -1
- package/dist/typescript/module/features/profile/shared/profile.types.d.ts +0 -27
- package/dist/typescript/module/features/profile/shared/profile.types.d.ts.map +0 -1
- package/src/features/profile/Profile.tsx +0 -83
- package/src/features/profile/__tests__/ProfileModel.test.ts +0 -99
- package/src/features/profile/__tests__/profile.helpers.test.ts +0 -57
- package/src/features/profile/components/actions/ProfileActions.tsx +0 -65
- package/src/features/profile/components/cards/ProfileCard.tsx +0 -53
- package/src/features/profile/components/info/AccountInfoCard.tsx +0 -73
- package/src/features/profile/components/modals/JoinClassModal.tsx +0 -145
- package/src/features/profile/components/modals/LogoutConfirmModal.tsx +0 -64
- package/src/features/profile/components/modals/TranslationLanguageModal.tsx +0 -124
- package/src/features/profile/components/settings/LanguageSettingsCard.tsx +0 -16
- package/src/features/profile/components/settings/PreferencesCard.tsx +0 -68
- package/src/features/profile/components/settings/SettingRow.tsx +0 -42
- package/src/features/profile/components/settings/TextSettingsCard.tsx +0 -61
- package/src/features/profile/components/settings/TextSizeSlider.tsx +0 -110
- package/src/features/profile/components/settings/TextToSpeechRow.tsx +0 -24
- package/src/features/profile/components/settings/TranslationLanguageRow.tsx +0 -58
- package/src/features/profile/context/ProfileContext.tsx +0 -24
- package/src/features/profile/index.ts +0 -11
- package/src/features/profile/model/ProfileApi.ts +0 -23
- package/src/features/profile/model/ProfileJoinClassModel.ts +0 -58
- package/src/features/profile/model/ProfileLanguageModel.ts +0 -26
- package/src/features/profile/model/ProfileModel.ts +0 -57
- package/src/features/profile/model/profileModal.types.ts +0 -16
- package/src/features/profile/shared/JoinClassError.ts +0 -7
- package/src/features/profile/shared/profile.constants.ts +0 -23
- package/src/features/profile/shared/profile.helpers.ts +0 -36
- package/src/features/profile/shared/profile.types.ts +0 -34
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { useUnit } from 'effector-react'
|
|
3
|
-
import { StyleSheet } from 'react-native'
|
|
4
|
-
import {
|
|
5
|
-
COLORS,
|
|
6
|
-
FilterDropdown,
|
|
7
|
-
FilterDropdownSize,
|
|
8
|
-
FilterDropdownVariant,
|
|
9
|
-
GlobeIcon,
|
|
10
|
-
} from '@magmamath/react-native-ui'
|
|
11
|
-
|
|
12
|
-
import { useText } from '../../../../i18n/i18n'
|
|
13
|
-
import { useProfile } from '../../context/ProfileContext'
|
|
14
|
-
import { SettingRow } from './SettingRow'
|
|
15
|
-
|
|
16
|
-
const ICON_SIZE = 20
|
|
17
|
-
|
|
18
|
-
export const TranslationLanguageRow = () => {
|
|
19
|
-
const t = useText()
|
|
20
|
-
const { model, onOpenTranslationModal } = useProfile()
|
|
21
|
-
const settings = useUnit(model.$settings)
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<SettingRow
|
|
25
|
-
icon={<GlobeIcon size={ICON_SIZE} color={COLORS.NEUTRAL_7} />}
|
|
26
|
-
label={t('profile.translationLanguage')}
|
|
27
|
-
style={styles.settingRow}
|
|
28
|
-
>
|
|
29
|
-
<FilterDropdown
|
|
30
|
-
variant={FilterDropdownVariant.SECONDARY}
|
|
31
|
-
size={FilterDropdownSize.MEDIUM}
|
|
32
|
-
value={settings.translationLanguage ?? undefined}
|
|
33
|
-
placeholder={t('profile.selectLanguage')}
|
|
34
|
-
disabled={settings.isTranslationLocked}
|
|
35
|
-
onPress={onOpenTranslationModal}
|
|
36
|
-
accessibilityLabel={t('profile.translationLanguage')}
|
|
37
|
-
style={{
|
|
38
|
-
text: styles.filterLabel,
|
|
39
|
-
container: styles.filterContainer,
|
|
40
|
-
}}
|
|
41
|
-
/>
|
|
42
|
-
</SettingRow>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const styles = StyleSheet.create({
|
|
47
|
-
settingRow: {
|
|
48
|
-
paddingVertical: 0,
|
|
49
|
-
},
|
|
50
|
-
filterLabel: {
|
|
51
|
-
color: COLORS.NEUTRAL_7,
|
|
52
|
-
fontSize: 16,
|
|
53
|
-
fontWeight: '400',
|
|
54
|
-
},
|
|
55
|
-
filterContainer: {
|
|
56
|
-
maxWidth: 231,
|
|
57
|
-
},
|
|
58
|
-
})
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext, type ReactNode } from 'react'
|
|
2
|
-
|
|
3
|
-
import type { ProfileModel } from '../model/ProfileModel'
|
|
4
|
-
|
|
5
|
-
export type ProfileContextValue = {
|
|
6
|
-
model: ProfileModel
|
|
7
|
-
onLogout: () => void
|
|
8
|
-
onOpenTranslationModal: () => void
|
|
9
|
-
onOpenJoinClass: () => void
|
|
10
|
-
showSolveMode?: boolean
|
|
11
|
-
versionInfo?: ReactNode
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const ProfileContext = createContext<ProfileContextValue | null>(null)
|
|
15
|
-
|
|
16
|
-
export function useProfile(): ProfileContextValue {
|
|
17
|
-
const value = useContext(ProfileContext)
|
|
18
|
-
if (!value) {
|
|
19
|
-
throw new Error('useProfile must be used within ProfileProvider')
|
|
20
|
-
}
|
|
21
|
-
return value
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const ProfileProvider = ProfileContext.Provider
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { Profile } from './Profile'
|
|
2
|
-
export { ProfileModel } from './model/ProfileModel'
|
|
3
|
-
export type { ProfileApiProps } from './model/ProfileApi'
|
|
4
|
-
export type { ProfileContextValue } from './context/ProfileContext'
|
|
5
|
-
export { TranslationLanguageModal } from './components/modals/TranslationLanguageModal'
|
|
6
|
-
export { JoinClassModal } from './components/modals/JoinClassModal'
|
|
7
|
-
export { LogoutConfirmModal } from './components/modals/LogoutConfirmModal'
|
|
8
|
-
export type { ProfileModalParams, LogoutModalParams } from './model/profileModal.types'
|
|
9
|
-
export { JoinClassError } from './shared/JoinClassError'
|
|
10
|
-
export * from './shared/profile.types'
|
|
11
|
-
export * from './shared/profile.constants'
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createEffect } from 'effector'
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
JoinClassPayload,
|
|
5
|
-
JoinClassResult,
|
|
6
|
-
ProfileSettingsUpdate,
|
|
7
|
-
} from '../shared/profile.types'
|
|
8
|
-
|
|
9
|
-
export type ProfileApiProps = {
|
|
10
|
-
// `=> void` (not a Promise union) lets consumers wire an effector event or effect directly.
|
|
11
|
-
updateSettings: (payload: ProfileSettingsUpdate) => void
|
|
12
|
-
joinClass: (payload: JoinClassPayload) => Promise<JoinClassResult>
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export class ProfileApi {
|
|
16
|
-
public readonly updateSettingsFx
|
|
17
|
-
public readonly joinClassFx
|
|
18
|
-
|
|
19
|
-
constructor(props: ProfileApiProps) {
|
|
20
|
-
this.updateSettingsFx = createEffect(props.updateSettings)
|
|
21
|
-
this.joinClassFx = createEffect(props.joinClass)
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { createEffect, createEvent, restore, sample } from 'effector'
|
|
2
|
-
|
|
3
|
-
import { JoinClassError } from '../shared/JoinClassError'
|
|
4
|
-
import { CLASS_CODE_LENGTH, JoinClassStatus } from '../shared/profile.constants'
|
|
5
|
-
import { getJoinClassErrorMessage, getJoinClassSuccessMessage } from '../shared/profile.helpers'
|
|
6
|
-
import type { NotifyJoinClass } from '../shared/profile.types'
|
|
7
|
-
import type { ProfileApi } from './ProfileApi'
|
|
8
|
-
|
|
9
|
-
export class ProfileJoinClassModel {
|
|
10
|
-
public readonly reset = createEvent()
|
|
11
|
-
public readonly setCode = createEvent<string>()
|
|
12
|
-
public readonly submit = createEvent()
|
|
13
|
-
|
|
14
|
-
public readonly $code = restore(this.setCode, '').reset(this.reset)
|
|
15
|
-
public readonly $isComplete = this.$code.map((code) => code.length === CLASS_CODE_LENGTH)
|
|
16
|
-
|
|
17
|
-
constructor(
|
|
18
|
-
private readonly api: ProfileApi,
|
|
19
|
-
private readonly notify: NotifyJoinClass
|
|
20
|
-
) {
|
|
21
|
-
this.init()
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
private init() {
|
|
25
|
-
const notifyFx = createEffect(this.notify)
|
|
26
|
-
|
|
27
|
-
sample({
|
|
28
|
-
clock: this.submit,
|
|
29
|
-
source: this.$code,
|
|
30
|
-
filter: (code) => code.length === CLASS_CODE_LENGTH,
|
|
31
|
-
fn: (classCode) => ({ classCode }),
|
|
32
|
-
target: this.api.joinClassFx,
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
sample({
|
|
36
|
-
clock: this.api.joinClassFx.done,
|
|
37
|
-
fn: ({ result }) => ({
|
|
38
|
-
status: JoinClassStatus.SUCCESS,
|
|
39
|
-
message: getJoinClassSuccessMessage(result.name),
|
|
40
|
-
}),
|
|
41
|
-
target: notifyFx,
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
sample({
|
|
45
|
-
clock: this.api.joinClassFx.fail,
|
|
46
|
-
fn: ({ error }) => ({
|
|
47
|
-
status: JoinClassStatus.ERROR,
|
|
48
|
-
message: getJoinClassErrorMessage(error instanceof JoinClassError ? error.code : null),
|
|
49
|
-
}),
|
|
50
|
-
target: notifyFx,
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
sample({
|
|
54
|
-
clock: this.api.joinClassFx.done,
|
|
55
|
-
target: this.reset,
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createEvent, restore, sample } from 'effector'
|
|
2
|
-
import type { Language } from '@magmamath/frontend-config'
|
|
3
|
-
|
|
4
|
-
import { getAvailableLanguages } from '../shared/profile.helpers'
|
|
5
|
-
import type { ProfileApi } from './ProfileApi'
|
|
6
|
-
|
|
7
|
-
export class ProfileLanguageModel {
|
|
8
|
-
public readonly reset = createEvent()
|
|
9
|
-
public readonly setSearch = createEvent<string>()
|
|
10
|
-
public readonly selectLanguage = createEvent<Language | null>()
|
|
11
|
-
|
|
12
|
-
public readonly $search = restore(this.setSearch, '').reset(this.reset)
|
|
13
|
-
public readonly $languages = this.$search.map((search) => getAvailableLanguages(search))
|
|
14
|
-
|
|
15
|
-
constructor(private readonly api: ProfileApi) {
|
|
16
|
-
this.init()
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
private init() {
|
|
20
|
-
sample({
|
|
21
|
-
clock: this.selectLanguage,
|
|
22
|
-
fn: (translationLanguage) => ({ translationLanguage }),
|
|
23
|
-
target: this.api.updateSettingsFx,
|
|
24
|
-
})
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { createEvent, sample, type Store } from 'effector'
|
|
2
|
-
|
|
3
|
-
import type { ProfileCanvasType } from '../shared/profile.constants'
|
|
4
|
-
import type { NotifyJoinClass, ProfileSettings, ProfileUser } from '../shared/profile.types'
|
|
5
|
-
import { ProfileApi, type ProfileApiProps } from './ProfileApi'
|
|
6
|
-
import { ProfileJoinClassModel } from './ProfileJoinClassModel'
|
|
7
|
-
import { ProfileLanguageModel } from './ProfileLanguageModel'
|
|
8
|
-
|
|
9
|
-
type ProfileModelProps = {
|
|
10
|
-
api: ProfileApiProps
|
|
11
|
-
notify: NotifyJoinClass
|
|
12
|
-
$user: Store<ProfileUser | null>
|
|
13
|
-
$settings: Store<ProfileSettings>
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class ProfileModel {
|
|
17
|
-
public readonly api: ProfileApi
|
|
18
|
-
public readonly joinClass: ProfileJoinClassModel
|
|
19
|
-
public readonly language: ProfileLanguageModel
|
|
20
|
-
|
|
21
|
-
public readonly setTextToSpeech = createEvent<boolean>()
|
|
22
|
-
public readonly setTextSize = createEvent<number>()
|
|
23
|
-
public readonly setCanvasType = createEvent<ProfileCanvasType>()
|
|
24
|
-
|
|
25
|
-
public readonly $user: Store<ProfileUser | null>
|
|
26
|
-
public readonly $settings: Store<ProfileSettings>
|
|
27
|
-
|
|
28
|
-
constructor({ api, notify, $user, $settings }: ProfileModelProps) {
|
|
29
|
-
this.api = new ProfileApi(api)
|
|
30
|
-
this.joinClass = new ProfileJoinClassModel(this.api, notify)
|
|
31
|
-
this.language = new ProfileLanguageModel(this.api)
|
|
32
|
-
this.$user = $user
|
|
33
|
-
this.$settings = $settings
|
|
34
|
-
|
|
35
|
-
this.init()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
private init() {
|
|
39
|
-
sample({
|
|
40
|
-
clock: this.setTextToSpeech,
|
|
41
|
-
fn: (textToSpeech) => ({ textToSpeech }),
|
|
42
|
-
target: this.api.updateSettingsFx,
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
sample({
|
|
46
|
-
clock: this.setTextSize,
|
|
47
|
-
fn: (textSize) => ({ textSize }),
|
|
48
|
-
target: this.api.updateSettingsFx,
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
sample({
|
|
52
|
-
clock: this.setCanvasType,
|
|
53
|
-
fn: (canvasType) => ({ canvasType }),
|
|
54
|
-
target: this.api.updateSettingsFx,
|
|
55
|
-
})
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ProfileModel } from './ProfileModel'
|
|
2
|
-
|
|
3
|
-
export type ProfileModalParams = {
|
|
4
|
-
model: ProfileModel
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export type LogoutModalParams = {
|
|
8
|
-
onConfirm: () => void
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type ProfileModalProps<Params = ProfileModalParams> = {
|
|
12
|
-
modal: {
|
|
13
|
-
closeModal: () => void
|
|
14
|
-
params: Params
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// Carries the backend error code so the library can map it to a message without parsing HTTP errors.
|
|
2
|
-
export class JoinClassError extends Error {
|
|
3
|
-
constructor(public readonly code: number | null) {
|
|
4
|
-
super(code === null ? 'Join class failed' : `Join class failed (code ${code})`)
|
|
5
|
-
this.name = 'JoinClassError'
|
|
6
|
-
}
|
|
7
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export enum ProfileCanvasType {
|
|
2
|
-
DRAWING = 1,
|
|
3
|
-
SPREADSHEET = 2,
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const TEXT_SIZE = {
|
|
7
|
-
MIN: 16,
|
|
8
|
-
MAX: 32,
|
|
9
|
-
STEP: 4,
|
|
10
|
-
} as const
|
|
11
|
-
|
|
12
|
-
export const CLASS_CODE_LENGTH = 6
|
|
13
|
-
|
|
14
|
-
export enum JoinClassStatus {
|
|
15
|
-
SUCCESS = 'success',
|
|
16
|
-
ERROR = 'error',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export enum JoinClassErrorCode {
|
|
20
|
-
CLASS_NOT_FOUND = 1021,
|
|
21
|
-
ALREADY_JOINED = 1030,
|
|
22
|
-
OTHER_DISTRICT = 1035,
|
|
23
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Language, LANGUAGES_CONFIG, PRIORITY_LANGUAGES } from '@magmamath/frontend-config'
|
|
2
|
-
|
|
3
|
-
import { getText, type TranslationKey } from '../../../i18n/i18n'
|
|
4
|
-
import { JoinClassErrorCode, TEXT_SIZE } from './profile.constants'
|
|
5
|
-
|
|
6
|
-
export const getAvailableLanguages = (search?: string): Language[] => {
|
|
7
|
-
const prioritySet = new Set<Language>(PRIORITY_LANGUAGES)
|
|
8
|
-
|
|
9
|
-
const otherLanguages = Object.values(Language).filter(
|
|
10
|
-
(language) => !LANGUAGES_CONFIG[language]?.baseName && !prioritySet.has(language)
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
const allLanguages = [...PRIORITY_LANGUAGES, ...otherLanguages]
|
|
14
|
-
if (!search) return allLanguages
|
|
15
|
-
|
|
16
|
-
const query = search.toLowerCase()
|
|
17
|
-
return allLanguages.filter((language) => language.toLowerCase().includes(query))
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const snapTextSize = (value: number): number => {
|
|
21
|
-
const { MIN, MAX, STEP } = TEXT_SIZE
|
|
22
|
-
const clamped = Math.min(MAX, Math.max(MIN, value))
|
|
23
|
-
return Math.round((clamped - MIN) / STEP) * STEP + MIN
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const JOIN_CLASS_ERROR_KEYS: Record<number, TranslationKey> = {
|
|
27
|
-
[JoinClassErrorCode.CLASS_NOT_FOUND]: 'profile.joinClassErrorNotFound',
|
|
28
|
-
[JoinClassErrorCode.ALREADY_JOINED]: 'profile.joinClassErrorAlreadyJoined',
|
|
29
|
-
[JoinClassErrorCode.OTHER_DISTRICT]: 'profile.joinClassErrorOtherDistrict',
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const getJoinClassSuccessMessage = (className: string): string =>
|
|
33
|
-
getText('profile.joinClassSuccess', { className })
|
|
34
|
-
|
|
35
|
-
export const getJoinClassErrorMessage = (code: number | null): string =>
|
|
36
|
-
getText((code !== null && JOIN_CLASS_ERROR_KEYS[code]) || 'profile.joinClassErrorDefault')
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { Language } from '@magmamath/frontend-config'
|
|
2
|
-
|
|
3
|
-
import type { JoinClassStatus, ProfileCanvasType } from './profile.constants'
|
|
4
|
-
|
|
5
|
-
export type ProfileUser = {
|
|
6
|
-
fullName: string
|
|
7
|
-
username: string
|
|
8
|
-
schoolName: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type ProfileSettings = {
|
|
12
|
-
textToSpeech: boolean
|
|
13
|
-
textSize: number
|
|
14
|
-
translationLanguage: Language | null
|
|
15
|
-
canvasType: ProfileCanvasType
|
|
16
|
-
isTranslationLocked: boolean
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type ProfileSettingsUpdate = Partial<ProfileSettings>
|
|
20
|
-
|
|
21
|
-
export type JoinClassPayload = {
|
|
22
|
-
classCode: string
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export type JoinClassResult = {
|
|
26
|
-
name: string
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type JoinClassNotification = {
|
|
30
|
-
status: JoinClassStatus
|
|
31
|
-
message: string
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export type NotifyJoinClass = (notification: JoinClassNotification) => void
|