@magmamath/students-features 0.5.7-rc-0 → 0.5.7
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/celebrations/components/ParticleBatch.js.map +1 -1
- package/dist/commonjs/features/celebrations/components/Spark.js +8 -11
- package/dist/commonjs/features/celebrations/components/Spark.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +4 -6
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +4 -6
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -1
- package/dist/commonjs/features/formulaSheet/components/FormulaSheet.js +54 -0
- package/dist/commonjs/features/formulaSheet/components/FormulaSheet.js.map +1 -0
- package/dist/commonjs/features/formulaSheet/components/FormulaSheetModal.js +64 -0
- package/dist/commonjs/features/formulaSheet/components/FormulaSheetModal.js.map +1 -0
- package/dist/commonjs/features/formulaSheet/index.js +20 -0
- package/dist/commonjs/features/formulaSheet/index.js.map +1 -0
- package/dist/commonjs/features/formulaSheet/model/api.model.js +15 -0
- package/dist/commonjs/features/formulaSheet/model/api.model.js.map +1 -0
- package/dist/commonjs/features/formulaSheet/model/file.model.js +19 -0
- package/dist/commonjs/features/formulaSheet/model/file.model.js.map +1 -0
- package/dist/commonjs/features/formulaSheet/model/modal.model.js +15 -0
- package/dist/commonjs/features/formulaSheet/model/modal.model.js.map +1 -0
- package/dist/commonjs/features/formulaSheet/model/model.js +35 -0
- package/dist/commonjs/features/formulaSheet/model/model.js.map +1 -0
- package/dist/commonjs/index.js +1 -1
- package/dist/commonjs/shared/icons/Halloween.js.map +1 -1
- package/dist/commonjs/shared/icons/MessageBubbleIcon.js.map +1 -1
- package/dist/commonjs/shared/icons/Pi.js +1 -3
- package/dist/commonjs/shared/icons/Pi.js.map +1 -1
- package/dist/commonjs/shared/icons/Star.js.map +1 -1
- package/dist/commonjs/shared/icons/Valentine.js +1 -3
- package/dist/commonjs/shared/icons/Valentine.js.map +1 -1
- package/dist/commonjs/shared/icons/Winter.js +1 -3
- package/dist/commonjs/shared/icons/Winter.js.map +1 -1
- package/dist/commonjs/shared/icons/XCloseIcon.js.map +1 -1
- package/dist/module/features/celebrations/components/ParticleBatch.js.map +1 -1
- package/dist/module/features/celebrations/components/Spark.js +8 -11
- package/dist/module/features/celebrations/components/Spark.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +4 -6
- package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +4 -6
- package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -1
- package/dist/module/features/endOfAssignment/ui/SparkIcon.js.map +1 -1
- package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -1
- package/dist/module/features/formulaSheet/components/FormulaSheet.js +48 -0
- package/dist/module/features/formulaSheet/components/FormulaSheet.js.map +1 -0
- package/dist/module/features/formulaSheet/components/FormulaSheetModal.js +58 -0
- package/dist/module/features/formulaSheet/components/FormulaSheetModal.js.map +1 -0
- package/dist/module/features/formulaSheet/index.js +5 -0
- package/dist/module/features/formulaSheet/index.js.map +1 -0
- package/dist/module/features/formulaSheet/model/api.model.js +10 -0
- package/dist/module/features/formulaSheet/model/api.model.js.map +1 -0
- package/dist/module/features/formulaSheet/model/file.model.js +14 -0
- package/dist/module/features/formulaSheet/model/file.model.js.map +1 -0
- package/dist/module/features/formulaSheet/model/modal.model.js +10 -0
- package/dist/module/features/formulaSheet/model/modal.model.js.map +1 -0
- package/dist/module/features/formulaSheet/model/model.js +30 -0
- package/dist/module/features/formulaSheet/model/model.js.map +1 -0
- package/dist/module/index.js +1 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/shared/icons/Halloween.js.map +1 -1
- package/dist/module/shared/icons/MessageBubbleIcon.js.map +1 -1
- package/dist/module/shared/icons/Pi.js +1 -3
- package/dist/module/shared/icons/Pi.js.map +1 -1
- package/dist/module/shared/icons/Star.js.map +1 -1
- package/dist/module/shared/icons/Valentine.js +1 -3
- package/dist/module/shared/icons/Valentine.js.map +1 -1
- package/dist/module/shared/icons/Winter.js +1 -3
- package/dist/module/shared/icons/Winter.js.map +1 -1
- package/dist/module/shared/icons/XCloseIcon.js.map +1 -1
- package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts +1 -1
- package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts +1 -1
- package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +2 -2
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +2 -2
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/formulaSheet/components/FormulaSheet.d.ts +16 -0
- package/dist/typescript/commonjs/features/formulaSheet/components/FormulaSheet.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/formulaSheet/components/FormulaSheetModal.d.ts +10 -0
- package/dist/typescript/commonjs/features/formulaSheet/components/FormulaSheetModal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/formulaSheet/index.d.ts +3 -0
- package/dist/typescript/commonjs/features/formulaSheet/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/formulaSheet/model/api.model.d.ts +9 -0
- package/dist/typescript/commonjs/features/formulaSheet/model/api.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/formulaSheet/model/file.model.d.ts +14 -0
- package/dist/typescript/commonjs/features/formulaSheet/model/file.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/formulaSheet/model/modal.model.d.ts +7 -0
- package/dist/typescript/commonjs/features/formulaSheet/model/modal.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/formulaSheet/model/model.d.ts +14 -0
- package/dist/typescript/commonjs/features/formulaSheet/model/model.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +1 -1
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Halloween.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/Halloween.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/MessageBubbleIcon.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/MessageBubbleIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Pi.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/Pi.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Star.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/Star.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Valentine.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/Valentine.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Winter.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/Winter.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/XCloseIcon.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/XCloseIcon.d.ts.map +1 -1
- package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts +1 -1
- package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts.map +1 -1
- package/dist/typescript/module/features/celebrations/components/Spark.d.ts +1 -1
- package/dist/typescript/module/features/celebrations/components/Spark.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +2 -2
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +2 -2
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -1
- package/dist/typescript/module/features/formulaSheet/components/FormulaSheet.d.ts +16 -0
- package/dist/typescript/module/features/formulaSheet/components/FormulaSheet.d.ts.map +1 -0
- package/dist/typescript/module/features/formulaSheet/components/FormulaSheetModal.d.ts +10 -0
- package/dist/typescript/module/features/formulaSheet/components/FormulaSheetModal.d.ts.map +1 -0
- package/dist/typescript/module/features/formulaSheet/index.d.ts +3 -0
- package/dist/typescript/module/features/formulaSheet/index.d.ts.map +1 -0
- package/dist/typescript/module/features/formulaSheet/model/api.model.d.ts +9 -0
- package/dist/typescript/module/features/formulaSheet/model/api.model.d.ts.map +1 -0
- package/dist/typescript/module/features/formulaSheet/model/file.model.d.ts +14 -0
- package/dist/typescript/module/features/formulaSheet/model/file.model.d.ts.map +1 -0
- package/dist/typescript/module/features/formulaSheet/model/modal.model.d.ts +7 -0
- package/dist/typescript/module/features/formulaSheet/model/modal.model.d.ts.map +1 -0
- package/dist/typescript/module/features/formulaSheet/model/model.d.ts +14 -0
- package/dist/typescript/module/features/formulaSheet/model/model.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +1 -1
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Halloween.d.ts +1 -1
- package/dist/typescript/module/shared/icons/Halloween.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/MessageBubbleIcon.d.ts +1 -1
- package/dist/typescript/module/shared/icons/MessageBubbleIcon.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Pi.d.ts +1 -1
- package/dist/typescript/module/shared/icons/Pi.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Star.d.ts +1 -1
- package/dist/typescript/module/shared/icons/Star.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Valentine.d.ts +1 -1
- package/dist/typescript/module/shared/icons/Valentine.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Winter.d.ts +1 -1
- package/dist/typescript/module/shared/icons/Winter.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/XCloseIcon.d.ts +1 -1
- package/dist/typescript/module/shared/icons/XCloseIcon.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/features/celebrations/components/ParticleBatch.tsx +1 -1
- package/src/features/celebrations/components/Spark.tsx +11 -15
- package/src/features/endOfAssignment/components/Modal/assets/SunrisingIcon.tsx +4 -5
- package/src/features/endOfAssignment/components/Modal/assets/TrophyIcon.tsx +4 -5
- package/src/features/endOfAssignment/ui/SparkIcon.tsx +1 -2
- package/src/features/endOfAssignment/ui/ThumbUpIcon.tsx +2 -2
- package/src/features/formulaSheet/components/FormulaSheet.tsx +78 -0
- package/src/features/formulaSheet/components/FormulaSheetModal.tsx +64 -0
- package/src/features/formulaSheet/index.ts +2 -0
- package/src/features/formulaSheet/model/api.model.ts +13 -0
- package/src/features/formulaSheet/model/file.model.ts +18 -0
- package/src/features/formulaSheet/model/modal.model.ts +10 -0
- package/src/features/formulaSheet/model/model.ts +31 -0
- package/src/index.ts +1 -1
- package/src/shared/icons/Halloween.tsx +2 -2
- package/src/shared/icons/MessageBubbleIcon.tsx +6 -5
- package/src/shared/icons/Pi.tsx +3 -5
- package/src/shared/icons/Star.tsx +2 -1
- package/src/shared/icons/Valentine.tsx +3 -5
- package/src/shared/icons/Winter.tsx +3 -7
- package/src/shared/icons/XCloseIcon.tsx +4 -3
- package/dist/commonjs/features/problemSelector/components/ProblemSelector.js +0 -43
- package/dist/commonjs/features/problemSelector/components/ProblemSelector.js.map +0 -1
- package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js +0 -68
- package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js.map +0 -1
- package/dist/commonjs/features/problemSelector/constants.js +0 -220
- package/dist/commonjs/features/problemSelector/constants.js.map +0 -1
- package/dist/commonjs/features/problemSelector/index.js +0 -20
- package/dist/commonjs/features/problemSelector/index.js.map +0 -1
- package/dist/commonjs/features/problemSelector/types.js +0 -6
- package/dist/commonjs/features/problemSelector/types.js.map +0 -1
- package/dist/commonjs/shared/icons/LockIcon.js +0 -31
- package/dist/commonjs/shared/icons/LockIcon.js.map +0 -1
- package/dist/module/features/problemSelector/components/ProblemSelector.js +0 -36
- package/dist/module/features/problemSelector/components/ProblemSelector.js.map +0 -1
- package/dist/module/features/problemSelector/components/ProblemSelectorButton.js +0 -62
- package/dist/module/features/problemSelector/components/ProblemSelectorButton.js.map +0 -1
- package/dist/module/features/problemSelector/constants.js +0 -216
- package/dist/module/features/problemSelector/constants.js.map +0 -1
- package/dist/module/features/problemSelector/index.js +0 -5
- package/dist/module/features/problemSelector/index.js.map +0 -1
- package/dist/module/features/problemSelector/types.js +0 -4
- package/dist/module/features/problemSelector/types.js.map +0 -1
- package/dist/module/shared/icons/LockIcon.js +0 -23
- package/dist/module/shared/icons/LockIcon.js.map +0 -1
- package/dist/typescript/commonjs/features/problemSelector/components/ProblemSelector.d.ts +0 -8
- package/dist/typescript/commonjs/features/problemSelector/components/ProblemSelector.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/problemSelector/components/ProblemSelectorButton.d.ts +0 -4
- package/dist/typescript/commonjs/features/problemSelector/components/ProblemSelectorButton.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/problemSelector/constants.d.ts +0 -22
- package/dist/typescript/commonjs/features/problemSelector/constants.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/problemSelector/index.d.ts +0 -4
- package/dist/typescript/commonjs/features/problemSelector/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/problemSelector/types.d.ts +0 -11
- package/dist/typescript/commonjs/features/problemSelector/types.d.ts.map +0 -1
- package/dist/typescript/commonjs/shared/icons/LockIcon.d.ts +0 -4
- package/dist/typescript/commonjs/shared/icons/LockIcon.d.ts.map +0 -1
- package/dist/typescript/module/features/problemSelector/components/ProblemSelector.d.ts +0 -8
- package/dist/typescript/module/features/problemSelector/components/ProblemSelector.d.ts.map +0 -1
- package/dist/typescript/module/features/problemSelector/components/ProblemSelectorButton.d.ts +0 -4
- package/dist/typescript/module/features/problemSelector/components/ProblemSelectorButton.d.ts.map +0 -1
- package/dist/typescript/module/features/problemSelector/constants.d.ts +0 -22
- package/dist/typescript/module/features/problemSelector/constants.d.ts.map +0 -1
- package/dist/typescript/module/features/problemSelector/index.d.ts +0 -4
- package/dist/typescript/module/features/problemSelector/index.d.ts.map +0 -1
- package/dist/typescript/module/features/problemSelector/types.d.ts +0 -11
- package/dist/typescript/module/features/problemSelector/types.d.ts.map +0 -1
- package/dist/typescript/module/shared/icons/LockIcon.d.ts +0 -4
- package/dist/typescript/module/shared/icons/LockIcon.d.ts.map +0 -1
- package/src/features/problemSelector/components/ProblemSelector.tsx +0 -37
- package/src/features/problemSelector/components/ProblemSelectorButton.tsx +0 -77
- package/src/features/problemSelector/constants.ts +0 -216
- package/src/features/problemSelector/index.ts +0 -3
- package/src/features/problemSelector/types.ts +0 -13
- package/src/shared/icons/LockIcon.tsx +0 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/students-features",
|
|
3
|
-
"version": "0.5.7
|
|
3
|
+
"version": "0.5.7",
|
|
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.12",
|
|
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",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState, useEffect, ComponentType } from 'react'
|
|
2
|
-
import { IconProps } from '@magmamath/react-native-ui'
|
|
3
2
|
import { CELEBRATION_VARIANTS } from '../config'
|
|
4
3
|
import { generateParticle } from '../helpers'
|
|
5
4
|
import { Particle } from './Particle'
|
|
6
5
|
import { CelebrationVariant } from '../types'
|
|
6
|
+
import { IconProps } from '../../../shared/icons/icon.types'
|
|
7
7
|
|
|
8
8
|
export type ParticlesBatch = {
|
|
9
9
|
id: number
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { IconProps } from '@magmamath/react-native-ui'
|
|
2
1
|
import React from 'react'
|
|
3
2
|
import { View } from 'react-native'
|
|
3
|
+
import { IconProps } from '../../../shared/icons/icon.types'
|
|
4
4
|
|
|
5
|
-
export const Spark = ({ size = 10, color }: IconProps) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}}
|
|
16
|
-
/>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
5
|
+
export const Spark = ({ size = 10, color }: IconProps) => (
|
|
6
|
+
<View
|
|
7
|
+
style={{
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
10
|
+
backgroundColor: color,
|
|
11
|
+
borderRadius: size / 2,
|
|
12
|
+
}}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import { IconProps } from '@magmamath/react-native-ui'
|
|
3
2
|
import Svg, { G, Path, Defs, LinearGradient, Stop } from 'react-native-svg'
|
|
3
|
+
import { IconProps } from '../../../../../shared/icons/icon.types'
|
|
4
4
|
|
|
5
|
-
export const SunrisingIcon = (
|
|
6
|
-
const
|
|
7
|
-
const height = actualSize * 0.606
|
|
5
|
+
export const SunrisingIcon = (props: IconProps) => {
|
|
6
|
+
const height = (props.size ?? 0) * 0.606
|
|
8
7
|
|
|
9
8
|
return (
|
|
10
|
-
<Svg width={size} height={height} viewBox="0 0 909 551" fill="none">
|
|
9
|
+
<Svg width={props.size} height={height} viewBox="0 0 909 551" fill="none" {...props}>
|
|
11
10
|
<G opacity={0.1}>
|
|
12
11
|
<Path
|
|
13
12
|
d="M164.04-598.854a893.984 893.984 0 01222.319 28.085L164.04 295.106v-893.96z"
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { IconProps } from '@magmamath/react-native-ui'
|
|
2
1
|
import * as React from 'react'
|
|
3
2
|
import Svg, { Path } from 'react-native-svg'
|
|
3
|
+
import { IconProps } from '../../../../../shared/icons/icon.types'
|
|
4
4
|
|
|
5
|
-
export const TrophyIcon = (
|
|
6
|
-
const
|
|
7
|
-
const height = actualSize * 0.982
|
|
5
|
+
export const TrophyIcon = (props: IconProps) => {
|
|
6
|
+
const height = (props.size ?? 0) * 0.982
|
|
8
7
|
|
|
9
8
|
return (
|
|
10
|
-
<Svg width={size} height={height} viewBox="0 0 466 458" fill="none">
|
|
9
|
+
<Svg width={props.size} height={height} viewBox="0 0 466 458" fill="none" {...props}>
|
|
11
10
|
<Path
|
|
12
11
|
d="M258.454 244.45l-5.731 32.767 16.384 2.86c8.047 1.407 15.796 2.106 23.222 2.106 15.697.011 29.985-3.137 42.766-9.389 6.728-3.292 13.025-7.438 18.9-12.449 44.672-38.12 50.247-115.859 49.604-158.813-.288-18.467-9.466-35.848-24.575-46.49-9.355-6.606-20.23-10.209-31.348-10.575a57.996 57.996 0 00-17.935 2.206c-14.355 4.09-26.36 13.38-33.875 25.994l-32.379-14.332L250.03 88.75l39.162 17.326c6.274 2.771 13.247 2.916 19.632.388 6.374-2.516 11.373-7.382 14.055-13.7a24.56 24.56 0 0115.974-14.112c2.993-.853 6.052-1.13 9.056-.853a24.578 24.578 0 0111.961 4.422c6.44 4.534 10.353 11.95 10.475 19.82 1.164 76.841-18.822 112.224-32.024 127.144-2.195 2.494-4.213 4.412-5.909 5.864-14.632 12.47-33.465 16.483-57.586 12.271l-16.372-2.871zM37.623 282.187c7.429 0 15.173-.703 23.223-2.111l16.379-2.864-5.73-32.757-16.378 2.865c-24.126 4.221-42.953.202-57.575-12.274-11.858-10.119-39.295-43.336-37.936-133.006.119-7.871 4.036-15.28 10.476-19.82a24.601 24.601 0 0121.015-3.57A24.606 24.606 0 017.075 92.764c2.683 6.318 7.675 11.186 14.058 13.709 6.384 2.522 13.355 2.38 19.63-.396l39.152-17.329-13.46-30.41-32.37 14.328C26.57 60.055 14.57 50.762.213 46.67c-16.936-4.828-34.901-1.777-49.293 8.369-15.102 10.647-24.286 28.03-24.565 46.498-.652 42.947 4.926 120.686 49.6 158.806 17.036 14.535 37.71 21.844 61.668 21.844z"
|
|
13
12
|
fill="#FFD690"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import { IconProps } from '@magmamath/react-native-ui'
|
|
4
2
|
import Svg, { Path } from 'react-native-svg'
|
|
3
|
+
import { IconProps } from '../../../shared/icons/icon.types'
|
|
5
4
|
|
|
6
5
|
export const SparkIcon = ({ size = 12, color }: IconProps) => {
|
|
7
6
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import { COLORS, IconProps } from '@magmamath/react-native-ui'
|
|
2
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
3
|
import Svg, { Path } from 'react-native-svg'
|
|
4
|
+
import { IconProps } from '../../../shared/icons/icon.types'
|
|
5
5
|
|
|
6
6
|
export const ThumbUpIcon = ({ size = 57, color = COLORS.NEUTRAL_1 }: IconProps) => {
|
|
7
7
|
return (
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, { forwardRef, ReactNode, useEffect } from 'react'
|
|
2
|
+
import { useUnit } from 'effector-react'
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
ButtonColor,
|
|
6
|
+
ButtonSize,
|
|
7
|
+
ButtonVariant,
|
|
8
|
+
COLORS,
|
|
9
|
+
TheoryIcon,
|
|
10
|
+
ButtonRef,
|
|
11
|
+
LoaderColor,
|
|
12
|
+
ButtonStyle,
|
|
13
|
+
} from '@magmamath/react-native-ui'
|
|
14
|
+
import { FormulaSheetModel } from '../model/model'
|
|
15
|
+
import { FormulaSheetModal } from './FormulaSheetModal'
|
|
16
|
+
|
|
17
|
+
type FormulaSheetProps = {
|
|
18
|
+
model: FormulaSheetModel
|
|
19
|
+
fileId: string
|
|
20
|
+
renderer: (fileBlob: string) => ReactNode
|
|
21
|
+
buttonSize: ButtonSize
|
|
22
|
+
buttonColor: ButtonColor
|
|
23
|
+
loaderColor: LoaderColor
|
|
24
|
+
onPress?: () => void
|
|
25
|
+
style?: ButtonStyle
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const FormulaSheet = forwardRef<ButtonRef | null, FormulaSheetProps>(
|
|
29
|
+
(
|
|
30
|
+
{
|
|
31
|
+
model,
|
|
32
|
+
fileId,
|
|
33
|
+
renderer,
|
|
34
|
+
buttonSize = ButtonSize.MEDIUM,
|
|
35
|
+
buttonColor = ButtonColor.BLUE,
|
|
36
|
+
loaderColor = LoaderColor.BLUE,
|
|
37
|
+
onPress,
|
|
38
|
+
style,
|
|
39
|
+
},
|
|
40
|
+
ref,
|
|
41
|
+
) => {
|
|
42
|
+
const isOpen = useUnit(model.modal.$isOpen)
|
|
43
|
+
const sheetFileBlob = useUnit(model.file.$blob)
|
|
44
|
+
const isRequestPending = useUnit(model.api.getPDFFileBlobFx.pending)
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
model.file.setId(fileId ?? null)
|
|
48
|
+
}, [fileId])
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
<Button
|
|
53
|
+
ref={ref}
|
|
54
|
+
size={buttonSize}
|
|
55
|
+
variant={ButtonVariant.SECONDARY}
|
|
56
|
+
colorScheme={buttonColor}
|
|
57
|
+
isActive={isOpen}
|
|
58
|
+
onPress={() => {
|
|
59
|
+
model.modal.toggle()
|
|
60
|
+
onPress?.()
|
|
61
|
+
}}
|
|
62
|
+
icon={<TheoryIcon color={isOpen ? COLORS.NEUTRAL_1 : undefined} size={20} />}
|
|
63
|
+
style={style}
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
{isOpen && (
|
|
67
|
+
<FormulaSheetModal
|
|
68
|
+
isLoading={isRequestPending}
|
|
69
|
+
loaderColor={loaderColor}
|
|
70
|
+
onClose={() => model.modal.setIsOpen(false)}
|
|
71
|
+
>
|
|
72
|
+
{renderer(sheetFileBlob ?? '')}
|
|
73
|
+
</FormulaSheetModal>
|
|
74
|
+
)}
|
|
75
|
+
</>
|
|
76
|
+
)
|
|
77
|
+
},
|
|
78
|
+
)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react'
|
|
2
|
+
import { View, Modal, StyleSheet, TouchableWithoutFeedback } from 'react-native'
|
|
3
|
+
import {
|
|
4
|
+
BORDER_RADIUS,
|
|
5
|
+
COLORS,
|
|
6
|
+
Loader,
|
|
7
|
+
LoaderColor,
|
|
8
|
+
LoaderSize,
|
|
9
|
+
LoaderType,
|
|
10
|
+
SPACING,
|
|
11
|
+
} from '@magmamath/react-native-ui'
|
|
12
|
+
|
|
13
|
+
type FormulaSheetModalProps = {
|
|
14
|
+
isLoading: boolean
|
|
15
|
+
loaderColor: LoaderColor
|
|
16
|
+
onClose: () => void
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const FormulaSheetModal = ({
|
|
20
|
+
children,
|
|
21
|
+
loaderColor,
|
|
22
|
+
isLoading,
|
|
23
|
+
onClose,
|
|
24
|
+
}: PropsWithChildren<FormulaSheetModalProps>) => {
|
|
25
|
+
return (
|
|
26
|
+
<Modal visible transparent animationType="none" onRequestClose={onClose}>
|
|
27
|
+
<TouchableWithoutFeedback onPress={onClose}>
|
|
28
|
+
<View style={styles.container}>
|
|
29
|
+
<TouchableWithoutFeedback onPress={(event) => event.stopPropagation()}>
|
|
30
|
+
<View style={styles.content}>
|
|
31
|
+
{isLoading ? (
|
|
32
|
+
<Loader type={LoaderType.PRIMARY} color={loaderColor} size={LoaderSize.LARGE} />
|
|
33
|
+
) : (
|
|
34
|
+
children
|
|
35
|
+
)}
|
|
36
|
+
</View>
|
|
37
|
+
</TouchableWithoutFeedback>
|
|
38
|
+
</View>
|
|
39
|
+
</TouchableWithoutFeedback>
|
|
40
|
+
</Modal>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
container: {
|
|
46
|
+
width: '100%',
|
|
47
|
+
height: '100%',
|
|
48
|
+
alignItems: 'center',
|
|
49
|
+
justifyContent: 'center',
|
|
50
|
+
backgroundColor: 'rgba(0, 0, 0, 0.25)',
|
|
51
|
+
},
|
|
52
|
+
content: {
|
|
53
|
+
width: '100%',
|
|
54
|
+
maxWidth: 720,
|
|
55
|
+
height: '100%',
|
|
56
|
+
maxHeight: '80%',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
justifyContent: 'center',
|
|
59
|
+
paddingHorizontal: SPACING['800'],
|
|
60
|
+
paddingVertical: SPACING['400'],
|
|
61
|
+
borderRadius: BORDER_RADIUS['400'],
|
|
62
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
63
|
+
},
|
|
64
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createEffect, Effect } from 'effector'
|
|
2
|
+
|
|
3
|
+
export type FormulaSheetApiProps = {
|
|
4
|
+
getPDFFileBlob: (id: string) => Promise<string>
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export class FormulaSheetAPI {
|
|
8
|
+
public readonly getPDFFileBlobFx: Effect<string, string> = createEffect()
|
|
9
|
+
|
|
10
|
+
public setupRequests(api: FormulaSheetApiProps) {
|
|
11
|
+
this.getPDFFileBlobFx.use(api.getPDFFileBlob)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createEvent, restore, StoreWritable } from 'effector'
|
|
2
|
+
import { FormulaSheetAPI } from './api.model'
|
|
3
|
+
|
|
4
|
+
type FormulaSheetFileProps = {
|
|
5
|
+
api: FormulaSheetAPI
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class FormulaSheetFile {
|
|
9
|
+
public readonly reset = createEvent()
|
|
10
|
+
public readonly $blob: StoreWritable<string | null>
|
|
11
|
+
|
|
12
|
+
public readonly setId = createEvent<string>()
|
|
13
|
+
public readonly $id = restore(this.setId, null)
|
|
14
|
+
|
|
15
|
+
constructor({ api }: FormulaSheetFileProps) {
|
|
16
|
+
this.$blob = restore(api.getPDFFileBlobFx.doneData, null).reset(this.reset)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createEvent, restore } from 'effector'
|
|
2
|
+
|
|
3
|
+
export class FormulaSheetModal {
|
|
4
|
+
public readonly reset = createEvent()
|
|
5
|
+
public readonly toggle = createEvent()
|
|
6
|
+
public readonly setIsOpen = createEvent<boolean>()
|
|
7
|
+
public readonly $isOpen = restore(this.setIsOpen, false)
|
|
8
|
+
.on(this.toggle, (state) => !state)
|
|
9
|
+
.reset(this.reset)
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { sample } from 'effector'
|
|
2
|
+
import { FormulaSheetAPI, type FormulaSheetApiProps } from './api.model'
|
|
3
|
+
import { FormulaSheetModal } from './modal.model'
|
|
4
|
+
import { FormulaSheetFile } from './file.model'
|
|
5
|
+
|
|
6
|
+
type FormulaSheetModelProps = {
|
|
7
|
+
api: FormulaSheetApiProps
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export class FormulaSheetModel {
|
|
11
|
+
public readonly api = new FormulaSheetAPI()
|
|
12
|
+
public readonly modal = new FormulaSheetModal()
|
|
13
|
+
public readonly file = new FormulaSheetFile({ api: this.api })
|
|
14
|
+
|
|
15
|
+
constructor({ api }: FormulaSheetModelProps) {
|
|
16
|
+
this.api.setupRequests(api)
|
|
17
|
+
|
|
18
|
+
sample({
|
|
19
|
+
clock: this.modal.$isOpen,
|
|
20
|
+
source: [this.file.$id, this.file.$blob],
|
|
21
|
+
filter: ([fileId, blob], isOpen) => !!(isOpen && fileId && !blob),
|
|
22
|
+
fn: ([fileId]) => fileId as string,
|
|
23
|
+
target: this.api.getPDFFileBlobFx,
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
sample({
|
|
27
|
+
clock: this.file.$id,
|
|
28
|
+
target: [this.file.reset, this.modal.reset],
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Svg, { ClipPath, Defs, G, Path } from 'react-native-svg'
|
|
3
|
-
|
|
4
|
-
import {
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
import { IconProps } from './icon.types'
|
|
5
5
|
|
|
6
6
|
function Halloween({ size = 57, color = COLORS.NEUTRAL_8 }: IconProps) {
|
|
7
7
|
return (
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Svg, { Path } from 'react-native-svg'
|
|
3
|
-
import {
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
import { IconProps } from './icon.types'
|
|
4
5
|
|
|
5
6
|
export const MessageBubbleIcon = ({ size = 26, color = COLORS.NEUTRAL_1 }: IconProps) => {
|
|
6
7
|
return (
|
|
7
|
-
<Svg width={size} height={size} viewBox=
|
|
8
|
+
<Svg width={size} height={size} viewBox="0 0 26 26" fill="none">
|
|
8
9
|
<Path
|
|
9
|
-
d=
|
|
10
|
+
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
11
|
stroke={color}
|
|
11
|
-
strokeWidth=
|
|
12
|
-
strokeLinejoin=
|
|
12
|
+
strokeWidth="2"
|
|
13
|
+
strokeLinejoin="round"
|
|
13
14
|
/>
|
|
14
15
|
</Svg>
|
|
15
16
|
)
|
package/src/shared/icons/Pi.tsx
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Svg, { Path } from 'react-native-svg'
|
|
3
|
-
import { COLORS
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
import { IconProps } from './icon.types'
|
|
4
5
|
|
|
5
6
|
function Pi({ size = 57, color = COLORS.NEUTRAL_8 }: IconProps) {
|
|
6
|
-
const actualSize = typeof size === 'number' ? size : 0
|
|
7
|
-
const height = actualSize * 0.8421
|
|
8
|
-
|
|
9
7
|
return (
|
|
10
|
-
<Svg width={57} height={
|
|
8
|
+
<Svg width={57} height={size * 0.8421} viewBox="0 0 57 48" fill="none">
|
|
11
9
|
<Path
|
|
12
10
|
d="M2.311 10.528a5.23 5.23 0 00.244 7.63c2.166 1.926 5.52 1.836 7.572-.23l4.685-4.719a5.09 5.09 0 01.04-.04c.557-.55 1.37-.044 1.302.735a96.284 96.284 0 01-.666 5.732c-.546 3.688-1.358 7.523-2.543 10.924-1.209 3.468-2.669 6.084-4.272 7.7a5.23 5.23 0 00.246 7.63c2.167 1.925 5.52 1.835 7.572-.233 3.195-3.219 5.307-7.505 6.759-11.67 1.475-4.232 2.41-8.76 3.012-12.831.483-3.272.763-6.327.926-8.813a1.006 1.006 0 011.002-.942h2.357a1 1 0 011 1v23.505c0 6.436 5.464 11.367 11.84 11.367 7.233 0 13.389-5.587 13.389-12.831v-.872c0-3.093-2.6-5.315-5.443-5.315-2.843 0-5.443 2.222-5.443 5.315v.872c0 1.058-.958 2.202-2.502 2.202-.69 0-.955-.489-.955-.738V12.401a1 1 0 011-1h7.9c2.844 0 5.443-2.221 5.443-5.315 0-3.093-2.6-5.315-5.443-5.315H19.267c-4.614 0-9.059 1.803-12.27 5.038L2.31 10.528z"
|
|
13
11
|
fill={color}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Svg, { Path } from 'react-native-svg'
|
|
3
|
-
import { COLORS
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
import { IconProps } from './icon.types'
|
|
4
5
|
|
|
5
6
|
function Star({ size = 57, color = COLORS.NEUTRAL_8 }: IconProps) {
|
|
6
7
|
return (
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Svg, { Path } from 'react-native-svg'
|
|
3
|
-
import { COLORS
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
import { IconProps } from './icon.types'
|
|
4
5
|
|
|
5
6
|
function Valentine({ size = 57, color = COLORS.NEUTRAL_8 }: IconProps) {
|
|
6
|
-
const actualSize = typeof size === 'number' ? size : 0
|
|
7
|
-
const height = actualSize * 0.8421
|
|
8
|
-
|
|
9
7
|
return (
|
|
10
|
-
<Svg width={size} height={
|
|
8
|
+
<Svg width={size} height={size * 0.8421} viewBox="0 0 57 48" fill="none">
|
|
11
9
|
<Path
|
|
12
10
|
d="M52.473 24.947L29.763 47.5a1.4 1.4 0 01-1.973 0L5.08 24.947A14.57 14.57 0 013.567 6.032C8.604-.884 18.487-1.994 24.931 3.633l2.924 2.554a1.4 1.4 0 001.842 0l2.924-2.554c6.444-5.627 16.327-4.517 21.363 2.399a14.57 14.57 0 01-1.511 18.915z"
|
|
13
11
|
fill={color}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Svg, { Path } from 'react-native-svg'
|
|
3
|
-
|
|
4
|
-
import {
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
import { IconProps } from './icon.types'
|
|
5
5
|
|
|
6
6
|
function Winter({ size = 50, color = COLORS.NEUTRAL_8 }: IconProps) {
|
|
7
|
-
const actualSize = typeof size === 'number' ? size : 0
|
|
8
|
-
|
|
9
|
-
const height = actualSize * 1.14
|
|
10
|
-
|
|
11
7
|
return (
|
|
12
|
-
<Svg width={size} height={
|
|
8
|
+
<Svg width={size} height={size * 1.14} viewBox="0 0 50 57" fill="none">
|
|
13
9
|
<Path
|
|
14
10
|
fillRule="evenodd"
|
|
15
11
|
clipRule="evenodd"
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Svg, { Path } from 'react-native-svg'
|
|
3
|
-
import {
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
import { IconProps } from './icon.types'
|
|
4
5
|
|
|
5
6
|
export const XCloseIcon = ({ size = 26, color = COLORS.NEUTRAL_9 }: IconProps) => {
|
|
6
7
|
return (
|
|
7
|
-
<Svg width={size} height={size} viewBox=
|
|
8
|
+
<Svg width={size} height={size} viewBox="0 0 26 26" fill="none">
|
|
8
9
|
<Path
|
|
9
|
-
d=
|
|
10
|
+
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
11
|
fill={color}
|
|
11
12
|
/>
|
|
12
13
|
</Svg>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ProblemSelector = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
|
-
var _ProblemSelectorButton = require("./ProblemSelectorButton.js");
|
|
11
|
-
var _constants = require("../constants.js");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
-
const ProblemSelector = ({
|
|
16
|
-
buttons
|
|
17
|
-
}) => {
|
|
18
|
-
if (!buttons.length) return null;
|
|
19
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
20
|
-
style: styles.container,
|
|
21
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
22
|
-
style: styles.contentContainer,
|
|
23
|
-
children: buttons.map(btn => /*#__PURE__*/(0, _react.createElement)(_ProblemSelectorButton.ProblemSelectorButton, {
|
|
24
|
-
...btn,
|
|
25
|
-
key: btn.key
|
|
26
|
-
}))
|
|
27
|
-
})
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
exports.ProblemSelector = ProblemSelector;
|
|
31
|
-
const styles = _reactNative.StyleSheet.create({
|
|
32
|
-
container: {
|
|
33
|
-
alignItems: 'center'
|
|
34
|
-
},
|
|
35
|
-
contentContainer: {
|
|
36
|
-
width: _constants.PROBLEM_SELECTOR_CONTENT_WIDTH,
|
|
37
|
-
flexWrap: 'wrap',
|
|
38
|
-
flexDirection: 'row',
|
|
39
|
-
paddingVertical: _reactNativeUi.SPACING[400],
|
|
40
|
-
gap: 15
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=ProblemSelector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeUi","_ProblemSelectorButton","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ProblemSelector","buttons","length","jsx","View","style","styles","container","children","contentContainer","map","btn","createElement","ProblemSelectorButton","key","exports","StyleSheet","create","alignItems","width","PROBLEM_SELECTOR_CONTENT_WIDTH","flexWrap","flexDirection","paddingVertical","SPACING","gap"],"sourceRoot":"../../../../../src","sources":["features/problemSelector/components/ProblemSelector.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAEA,IAAAG,sBAAA,GAAAH,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAA6D,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA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-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ProblemSelectorButton = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _studentsFeatures = require("@magmamath/students-features");
|
|
10
|
-
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
11
|
-
var _constants = require("../constants.js");
|
|
12
|
-
var _LockIcon = require("../../../shared/icons/LockIcon.js");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
const ProblemSelectorButton = ({
|
|
16
|
-
text,
|
|
17
|
-
state,
|
|
18
|
-
onClick,
|
|
19
|
-
badgeValue,
|
|
20
|
-
locked
|
|
21
|
-
}) => {
|
|
22
|
-
const customColorScheme = _constants.COLOR_SCHEME_MAP[state];
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
24
|
-
style: styles.wrapper,
|
|
25
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Button, {
|
|
26
|
-
variant: _reactNativeUi.ButtonVariant.PRIMARY,
|
|
27
|
-
size: _reactNativeUi.ButtonSize.MEDIUM,
|
|
28
|
-
customColorScheme: customColorScheme,
|
|
29
|
-
onPress: onClick,
|
|
30
|
-
style: {
|
|
31
|
-
button: styles.button
|
|
32
|
-
},
|
|
33
|
-
disabled: locked,
|
|
34
|
-
icon: locked ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_LockIcon.LockIcon, {
|
|
35
|
-
..._constants.ICON_SIZE,
|
|
36
|
-
color: customColorScheme[_reactNativeUi.ButtonStates.DISABLED]?.color
|
|
37
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
38
|
-
variant: "h2",
|
|
39
|
-
style: {
|
|
40
|
-
color: customColorScheme[_reactNativeUi.ButtonStates.DEFAULT]?.color
|
|
41
|
-
},
|
|
42
|
-
children: text ?? ''
|
|
43
|
-
})
|
|
44
|
-
}), typeof badgeValue === 'number' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_studentsFeatures.UnreadMessagesBadge, {
|
|
45
|
-
badgeContent: badgeValue !== 0 ? badgeValue : undefined,
|
|
46
|
-
withBorder: true,
|
|
47
|
-
style: [styles.badge, {
|
|
48
|
-
top: badgeValue ? 0 : _constants.BADGE_COORDINATES.top,
|
|
49
|
-
right: badgeValue ? 0 : _constants.BADGE_COORDINATES.right
|
|
50
|
-
}]
|
|
51
|
-
})]
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
exports.ProblemSelectorButton = ProblemSelectorButton;
|
|
55
|
-
const styles = _reactNative.StyleSheet.create({
|
|
56
|
-
wrapper: {
|
|
57
|
-
position: 'relative'
|
|
58
|
-
},
|
|
59
|
-
badge: {
|
|
60
|
-
position: 'absolute'
|
|
61
|
-
},
|
|
62
|
-
button: {
|
|
63
|
-
width: _constants.BUTTON_SIZE,
|
|
64
|
-
height: _constants.BUTTON_SIZE,
|
|
65
|
-
borderWidth: 2.75
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=ProblemSelectorButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_studentsFeatures","_reactNativeUi","_constants","_LockIcon","_jsxRuntime","e","__esModule","default","ProblemSelectorButton","text","state","onClick","badgeValue","locked","customColorScheme","COLOR_SCHEME_MAP","jsxs","View","style","styles","wrapper","children","jsx","Button","variant","ButtonVariant","PRIMARY","size","ButtonSize","MEDIUM","onPress","button","disabled","icon","LockIcon","ICON_SIZE","color","ButtonStates","DISABLED","Typography","DEFAULT","UnreadMessagesBadge","badgeContent","undefined","withBorder","badge","top","BADGE_COORDINATES","right","exports","StyleSheet","create","position","width","BUTTON_SIZE","height","borderWidth"],"sourceRoot":"../../../../../src","sources":["features/problemSelector/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