@magmamath/students-features 0.5.7 → 0.5.9-rc-0
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/endOfAssignment/components/Modal/assets/SunrisingIcon.js +77 -5
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +5 -5
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +42 -21
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/commonjs/features/problemSelector/components/ProblemSelector.js +43 -0
- package/dist/commonjs/features/problemSelector/components/ProblemSelector.js.map +1 -0
- package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js +69 -0
- package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js.map +1 -0
- package/dist/commonjs/features/problemSelector/constants.js +76 -0
- package/dist/commonjs/features/problemSelector/constants.js.map +1 -0
- package/dist/commonjs/features/problemSelector/index.js +20 -0
- package/dist/commonjs/features/problemSelector/index.js.map +1 -0
- package/dist/commonjs/features/problemSelector/types.js +6 -0
- package/dist/commonjs/features/problemSelector/types.js.map +1 -0
- package/dist/commonjs/index.js +12 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/shared/icons/LockIcon.js +31 -0
- package/dist/commonjs/shared/icons/LockIcon.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +77 -5
- package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +5 -5
- package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +43 -22
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/module/features/problemSelector/components/ProblemSelector.js +36 -0
- package/dist/module/features/problemSelector/components/ProblemSelector.js.map +1 -0
- package/dist/module/features/problemSelector/components/ProblemSelectorButton.js +63 -0
- package/dist/module/features/problemSelector/components/ProblemSelectorButton.js.map +1 -0
- package/dist/module/features/problemSelector/constants.js +72 -0
- package/dist/module/features/problemSelector/constants.js.map +1 -0
- package/dist/module/features/problemSelector/index.js +5 -0
- package/dist/module/features/problemSelector/index.js.map +1 -0
- package/dist/module/features/problemSelector/types.js +4 -0
- package/dist/module/features/problemSelector/types.js.map +1 -0
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/shared/icons/LockIcon.js +23 -0
- package/dist/module/shared/icons/LockIcon.js.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +1 -1
- 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 +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/problemSelector/components/ProblemSelector.d.ts +8 -0
- package/dist/typescript/commonjs/features/problemSelector/components/ProblemSelector.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/problemSelector/components/ProblemSelectorButton.d.ts +4 -0
- package/dist/typescript/commonjs/features/problemSelector/components/ProblemSelectorButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/problemSelector/constants.d.ts +22 -0
- package/dist/typescript/commonjs/features/problemSelector/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/problemSelector/index.d.ts +4 -0
- package/dist/typescript/commonjs/features/problemSelector/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/problemSelector/types.d.ts +11 -0
- package/dist/typescript/commonjs/features/problemSelector/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +1 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/LockIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/LockIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +1 -1
- 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 +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/module/features/problemSelector/components/ProblemSelector.d.ts +8 -0
- package/dist/typescript/module/features/problemSelector/components/ProblemSelector.d.ts.map +1 -0
- package/dist/typescript/module/features/problemSelector/components/ProblemSelectorButton.d.ts +4 -0
- package/dist/typescript/module/features/problemSelector/components/ProblemSelectorButton.d.ts.map +1 -0
- package/dist/typescript/module/features/problemSelector/constants.d.ts +22 -0
- package/dist/typescript/module/features/problemSelector/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/problemSelector/index.d.ts +4 -0
- package/dist/typescript/module/features/problemSelector/index.d.ts.map +1 -0
- package/dist/typescript/module/features/problemSelector/types.d.ts +11 -0
- package/dist/typescript/module/features/problemSelector/types.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +1 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/LockIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/LockIcon.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/features/endOfAssignment/components/Modal/assets/SunrisingIcon.tsx +26 -4
- package/src/features/endOfAssignment/components/Modal/assets/TrophyIcon.tsx +3 -4
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +52 -25
- package/src/features/problemSelector/components/ProblemSelector.tsx +37 -0
- package/src/features/problemSelector/components/ProblemSelectorButton.tsx +81 -0
- package/src/features/problemSelector/constants.ts +93 -0
- package/src/features/problemSelector/index.ts +3 -0
- package/src/features/problemSelector/types.ts +13 -0
- package/src/index.ts +1 -0
- package/src/shared/icons/LockIcon.tsx +16 -0
|
@@ -5,6 +5,7 @@ import { useUnit } from 'effector-react'
|
|
|
5
5
|
import {
|
|
6
6
|
Button,
|
|
7
7
|
ButtonColor,
|
|
8
|
+
ButtonSize,
|
|
8
9
|
ButtonVariant,
|
|
9
10
|
COLORS,
|
|
10
11
|
SPACING,
|
|
@@ -13,7 +14,6 @@ import {
|
|
|
13
14
|
|
|
14
15
|
import { EOAModalContentProps } from '../../types'
|
|
15
16
|
import { NoAnswerContent } from './NoAnswerContent'
|
|
16
|
-
import { PracticeButton } from '../../ui/PracticeButton'
|
|
17
17
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
18
18
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
19
19
|
|
|
@@ -22,17 +22,49 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
22
22
|
|
|
23
23
|
const { stats, isExam, user } = popUpData ?? {}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
function getButtons() {
|
|
26
|
+
const buttons = [
|
|
27
|
+
{
|
|
28
|
+
text: textContent.leftButtonText ?? '',
|
|
29
|
+
colorScheme: isExam ? ButtonColor.PURPLE : ButtonColor.BLUE,
|
|
30
|
+
onPress: () => model.hidePopUpAndLeave(),
|
|
31
|
+
},
|
|
32
|
+
]
|
|
27
33
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
if (!isExam) {
|
|
35
|
+
buttons.push({
|
|
36
|
+
text: textContent.rightButtonText ?? '',
|
|
37
|
+
colorScheme: ButtonColor.BLUE,
|
|
38
|
+
onPress: () => {
|
|
39
|
+
model.goToFirstProblemPressed()
|
|
40
|
+
model.hidePopUp()
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
return buttons
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const isPracticeAvailable = !!user?.practiceMode && user?.practiceButtonVisible
|
|
47
|
+
|
|
48
|
+
if (isPracticeAvailable) {
|
|
49
|
+
buttons.push({
|
|
50
|
+
text: textContent.rightButtonText ?? '',
|
|
51
|
+
colorScheme: ButtonColor.YELLOW,
|
|
52
|
+
onPress: () => {
|
|
53
|
+
onPracticePress?.()
|
|
54
|
+
model.hidePopUp()
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return buttons
|
|
31
60
|
}
|
|
32
61
|
|
|
62
|
+
const buttons = getButtons()
|
|
63
|
+
|
|
33
64
|
useKeyBoard((event) => {
|
|
34
65
|
if (event.key === KeyboardKeys.ENTER) {
|
|
35
|
-
|
|
66
|
+
const primaryButton = buttons.at(-1)
|
|
67
|
+
primaryButton?.onPress()
|
|
36
68
|
}
|
|
37
69
|
})
|
|
38
70
|
|
|
@@ -44,7 +76,7 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
44
76
|
{textContent.title}
|
|
45
77
|
</Typography>
|
|
46
78
|
)}
|
|
47
|
-
{!!textContent.subtitle &&
|
|
79
|
+
{!!textContent.subtitle && buttons.length === 2 && (
|
|
48
80
|
<Typography variant="h4" style={styles.subtitle}>
|
|
49
81
|
{textContent.subtitle}
|
|
50
82
|
</Typography>
|
|
@@ -55,23 +87,18 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
55
87
|
problemsAmount={stats?.problemsAmount ?? 0}
|
|
56
88
|
/>
|
|
57
89
|
<View style={styles.buttonsContainer}>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
onPress={handlePrimaryButtonPress}
|
|
71
|
-
text={textContent.rightButtonText}
|
|
72
|
-
colorScheme={buttonColorScheme}
|
|
73
|
-
/>
|
|
74
|
-
)}
|
|
90
|
+
{buttons.map((button, index) => (
|
|
91
|
+
<Button
|
|
92
|
+
key={index}
|
|
93
|
+
variant={index === buttons.length - 1 ? ButtonVariant.PRIMARY : ButtonVariant.TERTIARY}
|
|
94
|
+
size={ButtonSize.LARGE}
|
|
95
|
+
colorScheme={button.colorScheme}
|
|
96
|
+
style={{ text: { textTransform: 'uppercase' } }}
|
|
97
|
+
onPress={button.onPress}
|
|
98
|
+
>
|
|
99
|
+
{button.text}
|
|
100
|
+
</Button>
|
|
101
|
+
))}
|
|
75
102
|
</View>
|
|
76
103
|
</View>
|
|
77
104
|
)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View, StyleSheet } from 'react-native'
|
|
3
|
+
import { SPACING } from '@magmamath/react-native-ui'
|
|
4
|
+
|
|
5
|
+
import { ProblemSelectorButton } from './ProblemSelectorButton'
|
|
6
|
+
|
|
7
|
+
import { PROBLEM_SELECTOR_CONTENT_WIDTH } from '../constants'
|
|
8
|
+
import { ProblemSelectorButtonProps } from '../types'
|
|
9
|
+
|
|
10
|
+
type ProblemSelectorProps = {
|
|
11
|
+
buttons: ProblemSelectorButtonProps[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const ProblemSelector = ({ buttons }: ProblemSelectorProps) => {
|
|
15
|
+
if (!buttons.length) return null
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<View style={styles.container}>
|
|
19
|
+
<View style={styles.contentContainer}>
|
|
20
|
+
{buttons.map((btn) => (
|
|
21
|
+
<ProblemSelectorButton {...btn} key={btn.key} />
|
|
22
|
+
))}
|
|
23
|
+
</View>
|
|
24
|
+
</View>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const styles = StyleSheet.create({
|
|
29
|
+
container: { alignItems: 'center' },
|
|
30
|
+
contentContainer: {
|
|
31
|
+
width: PROBLEM_SELECTOR_CONTENT_WIDTH,
|
|
32
|
+
flexWrap: 'wrap',
|
|
33
|
+
flexDirection: 'row',
|
|
34
|
+
paddingVertical: SPACING[400],
|
|
35
|
+
gap: 15,
|
|
36
|
+
},
|
|
37
|
+
})
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View, StyleSheet } from 'react-native'
|
|
3
|
+
|
|
4
|
+
import { UnreadMessagesBadge } from '@magmamath/students-features'
|
|
5
|
+
import {
|
|
6
|
+
Button,
|
|
7
|
+
ButtonSize,
|
|
8
|
+
ButtonStates,
|
|
9
|
+
ButtonVariant,
|
|
10
|
+
Typography,
|
|
11
|
+
} from '@magmamath/react-native-ui'
|
|
12
|
+
|
|
13
|
+
import { BADGE_COORDINATES, BUTTON_SIZE, COLOR_SCHEME_MAP, ICON_SIZE } from '../constants'
|
|
14
|
+
import { LockIcon } from '../../../shared/icons/LockIcon'
|
|
15
|
+
|
|
16
|
+
import { ProblemSelectorButtonProps } from '../types'
|
|
17
|
+
|
|
18
|
+
export const ProblemSelectorButton = ({
|
|
19
|
+
text,
|
|
20
|
+
state,
|
|
21
|
+
onClick,
|
|
22
|
+
badgeValue,
|
|
23
|
+
locked,
|
|
24
|
+
}: ProblemSelectorButtonProps) => {
|
|
25
|
+
const customColorScheme = COLOR_SCHEME_MAP[state]
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<View style={styles.wrapper}>
|
|
29
|
+
<Button
|
|
30
|
+
variant={ButtonVariant.PRIMARY}
|
|
31
|
+
size={ButtonSize.MEDIUM}
|
|
32
|
+
customColorScheme={customColorScheme}
|
|
33
|
+
onPress={onClick}
|
|
34
|
+
style={{
|
|
35
|
+
button: styles.button,
|
|
36
|
+
}}
|
|
37
|
+
disabled={locked}
|
|
38
|
+
icon={
|
|
39
|
+
locked ? (
|
|
40
|
+
<LockIcon
|
|
41
|
+
height={ICON_SIZE.height}
|
|
42
|
+
width={ICON_SIZE.width}
|
|
43
|
+
color={customColorScheme[ButtonStates.DISABLED]?.color}
|
|
44
|
+
/>
|
|
45
|
+
) : (
|
|
46
|
+
<Typography
|
|
47
|
+
variant="h2"
|
|
48
|
+
style={{ color: customColorScheme[ButtonStates.DEFAULT]?.color }}
|
|
49
|
+
>
|
|
50
|
+
{text ?? ''}
|
|
51
|
+
</Typography>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
{typeof badgeValue === 'number' && (
|
|
57
|
+
<UnreadMessagesBadge
|
|
58
|
+
badgeContent={badgeValue !== 0 ? badgeValue : undefined}
|
|
59
|
+
withBorder
|
|
60
|
+
style={[
|
|
61
|
+
styles.badge,
|
|
62
|
+
{
|
|
63
|
+
top: badgeValue ? 0 : BADGE_COORDINATES.top,
|
|
64
|
+
right: badgeValue ? 0 : BADGE_COORDINATES.right,
|
|
65
|
+
},
|
|
66
|
+
]}
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
69
|
+
</View>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const styles = StyleSheet.create({
|
|
74
|
+
wrapper: { position: 'relative' },
|
|
75
|
+
badge: { position: 'absolute' },
|
|
76
|
+
button: {
|
|
77
|
+
width: BUTTON_SIZE,
|
|
78
|
+
height: BUTTON_SIZE,
|
|
79
|
+
borderWidth: 2.75,
|
|
80
|
+
},
|
|
81
|
+
})
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ButtonColorPreset, ButtonStates, COLORS } from '@magmamath/react-native-ui'
|
|
2
|
+
import { ProblemSelectorButtonState } from './types'
|
|
3
|
+
|
|
4
|
+
export const BUTTON_SIZE = 49.5
|
|
5
|
+
export const BADGE_COORDINATES = { top: 4, right: 4 }
|
|
6
|
+
export const ICON_SIZE = { width: 22, height: 24 }
|
|
7
|
+
export const PROBLEM_SELECTOR_CONTENT_WIDTH = 265
|
|
8
|
+
|
|
9
|
+
export const PROBLEM_SELECTOR_BUTTON_STATE = {
|
|
10
|
+
SELECTED: 'selected',
|
|
11
|
+
SOLVED: 'solved',
|
|
12
|
+
SOLVED_FIRST_ATTEMPT: 'solved-first-attempt',
|
|
13
|
+
NOT_SOLVED: 'not-solved',
|
|
14
|
+
MISTAKE: 'mistake',
|
|
15
|
+
EXAM: 'exam',
|
|
16
|
+
} as const
|
|
17
|
+
|
|
18
|
+
const colorPreset = (bg: string, border: string, color: string, raise: string = border) => ({
|
|
19
|
+
backgroundColor: bg,
|
|
20
|
+
borderColor: border,
|
|
21
|
+
color,
|
|
22
|
+
raiseColor: raise,
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
export const COLOR_SCHEME_MAP: Record<ProblemSelectorButtonState, ButtonColorPreset> = {
|
|
26
|
+
[PROBLEM_SELECTOR_BUTTON_STATE.SELECTED]: {
|
|
27
|
+
[ButtonStates.DEFAULT]: colorPreset(COLORS.BLUE_1, COLORS.PRIMARY_BLUE, COLORS.PRIMARY_BLUE),
|
|
28
|
+
[ButtonStates.HOVER]: colorPreset(COLORS.BLUE_1, COLORS.BLUE_4, COLORS.BLUE_4),
|
|
29
|
+
[ButtonStates.ACTIVE]: colorPreset(COLORS.BLUE_1, COLORS.BLUE_4, COLORS.BLUE_4),
|
|
30
|
+
[ButtonStates.PRESSED]: colorPreset(COLORS.BLUE_1, COLORS.BLUE_4, COLORS.BLUE_4),
|
|
31
|
+
[ButtonStates.DISABLED]: colorPreset(COLORS.BLUE_1, COLORS.BLUE_3, COLORS.BLUE_3),
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
[PROBLEM_SELECTOR_BUTTON_STATE.MISTAKE]: {
|
|
35
|
+
[ButtonStates.DEFAULT]: colorPreset(COLORS.PRIMARY_RED, COLORS.PRIMARY_RED, COLORS.NEUTRAL_1),
|
|
36
|
+
[ButtonStates.HOVER]: colorPreset(COLORS.RED_4, COLORS.RED_4, COLORS.NEUTRAL_1),
|
|
37
|
+
[ButtonStates.ACTIVE]: colorPreset(COLORS.RED_4, COLORS.RED_4, COLORS.NEUTRAL_1),
|
|
38
|
+
[ButtonStates.PRESSED]: colorPreset(COLORS.RED_4, COLORS.RED_4, COLORS.NEUTRAL_1),
|
|
39
|
+
[ButtonStates.DISABLED]: colorPreset(COLORS.RED_3, COLORS.RED_3, COLORS.NEUTRAL_1),
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
[PROBLEM_SELECTOR_BUTTON_STATE.SOLVED]: {
|
|
43
|
+
[ButtonStates.DEFAULT]: colorPreset(
|
|
44
|
+
COLORS.PRIMARY_YELLOW,
|
|
45
|
+
COLORS.PRIMARY_YELLOW,
|
|
46
|
+
COLORS.NEUTRAL_1,
|
|
47
|
+
),
|
|
48
|
+
[ButtonStates.HOVER]: colorPreset(COLORS.YELLOW_4, COLORS.YELLOW_4, COLORS.NEUTRAL_1),
|
|
49
|
+
[ButtonStates.ACTIVE]: colorPreset(COLORS.YELLOW_4, COLORS.YELLOW_4, COLORS.NEUTRAL_1),
|
|
50
|
+
[ButtonStates.PRESSED]: colorPreset(COLORS.YELLOW_4, COLORS.YELLOW_4, COLORS.NEUTRAL_1),
|
|
51
|
+
[ButtonStates.DISABLED]: colorPreset(COLORS.YELLOW_3, COLORS.YELLOW_3, COLORS.NEUTRAL_1),
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
[PROBLEM_SELECTOR_BUTTON_STATE.SOLVED_FIRST_ATTEMPT]: {
|
|
55
|
+
[ButtonStates.DEFAULT]: colorPreset(
|
|
56
|
+
COLORS.PRIMARY_GREEN,
|
|
57
|
+
COLORS.PRIMARY_GREEN,
|
|
58
|
+
COLORS.NEUTRAL_1,
|
|
59
|
+
),
|
|
60
|
+
[ButtonStates.HOVER]: colorPreset(COLORS.GREEN_4, COLORS.GREEN_4, COLORS.NEUTRAL_1),
|
|
61
|
+
[ButtonStates.ACTIVE]: colorPreset(COLORS.GREEN_4, COLORS.GREEN_4, COLORS.NEUTRAL_1),
|
|
62
|
+
[ButtonStates.PRESSED]: colorPreset(COLORS.GREEN_4, COLORS.GREEN_4, COLORS.NEUTRAL_1),
|
|
63
|
+
[ButtonStates.DISABLED]: colorPreset(COLORS.GREEN_3, COLORS.GREEN_3, COLORS.NEUTRAL_1),
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
[PROBLEM_SELECTOR_BUTTON_STATE.NOT_SOLVED]: {
|
|
67
|
+
[ButtonStates.DEFAULT]: colorPreset(COLORS.NEUTRAL_4, COLORS.NEUTRAL_4, COLORS.NEUTRAL_10),
|
|
68
|
+
[ButtonStates.HOVER]: colorPreset(COLORS.NEUTRAL_3, COLORS.NEUTRAL_3, COLORS.NEUTRAL_10),
|
|
69
|
+
[ButtonStates.ACTIVE]: colorPreset(COLORS.NEUTRAL_3, COLORS.NEUTRAL_3, COLORS.NEUTRAL_10),
|
|
70
|
+
[ButtonStates.PRESSED]: colorPreset(COLORS.NEUTRAL_3, COLORS.NEUTRAL_3, COLORS.NEUTRAL_10),
|
|
71
|
+
[ButtonStates.DISABLED]: colorPreset(COLORS.NEUTRAL_3, COLORS.NEUTRAL_3, COLORS.NEUTRAL_6),
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
[PROBLEM_SELECTOR_BUTTON_STATE.EXAM]: {
|
|
75
|
+
[ButtonStates.DEFAULT]: colorPreset(
|
|
76
|
+
COLORS.PRIMARY_PURPLE,
|
|
77
|
+
COLORS.PRIMARY_PURPLE,
|
|
78
|
+
COLORS.NEUTRAL_1,
|
|
79
|
+
),
|
|
80
|
+
[ButtonStates.HOVER]: colorPreset(COLORS.PURPLE_4, COLORS.PURPLE_4, COLORS.NEUTRAL_1),
|
|
81
|
+
[ButtonStates.ACTIVE]: colorPreset(
|
|
82
|
+
COLORS.PRIMARY_PURPLE,
|
|
83
|
+
COLORS.PRIMARY_PURPLE,
|
|
84
|
+
COLORS.NEUTRAL_1,
|
|
85
|
+
),
|
|
86
|
+
[ButtonStates.PRESSED]: colorPreset(
|
|
87
|
+
COLORS.PRIMARY_PURPLE,
|
|
88
|
+
COLORS.PRIMARY_PURPLE,
|
|
89
|
+
COLORS.NEUTRAL_1,
|
|
90
|
+
),
|
|
91
|
+
[ButtonStates.DISABLED]: colorPreset(COLORS.PURPLE_3, COLORS.PURPLE_3, COLORS.NEUTRAL_1),
|
|
92
|
+
},
|
|
93
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PROBLEM_SELECTOR_BUTTON_STATE } from './constants'
|
|
2
|
+
|
|
3
|
+
export type ProblemSelectorButtonState =
|
|
4
|
+
(typeof PROBLEM_SELECTOR_BUTTON_STATE)[keyof typeof PROBLEM_SELECTOR_BUTTON_STATE]
|
|
5
|
+
|
|
6
|
+
export type ProblemSelectorButtonProps = {
|
|
7
|
+
key: string
|
|
8
|
+
text: string
|
|
9
|
+
state: ProblemSelectorButtonState
|
|
10
|
+
locked: boolean
|
|
11
|
+
onClick: () => void
|
|
12
|
+
badgeValue?: number
|
|
13
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Svg, { Path } from 'react-native-svg'
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
|
|
5
|
+
import { IconProps } from './icon.types'
|
|
6
|
+
|
|
7
|
+
export const LockIcon = ({ width = 22, height = 24, color = COLORS.NEUTRAL_6 }: IconProps) => (
|
|
8
|
+
<Svg width={width} height={height} viewBox="0 0 24 28" fill="none">
|
|
9
|
+
<Path
|
|
10
|
+
fillRule="evenodd"
|
|
11
|
+
clipRule="evenodd"
|
|
12
|
+
d="M4.183 8.91H3.44A2.578 2.578 0 00.862 11.49v11.068a2.578 2.578 0 002.578 2.578h17.12a2.578 2.578 0 002.578-2.578V11.49a2.578 2.578 0 00-2.578-2.578h-.743c-.119-1.421-.391-3.307-1.374-4.897C17.304 2.172 15.303.864 12 .864c-3.304 0-5.304 1.308-6.443 3.15-.983 1.59-1.255 3.476-1.374 4.897zm2.008 0h11.618c-.12-1.303-.369-2.714-1.067-3.844C16.002 3.87 14.68 2.864 12 2.864c-2.68 0-4.003 1.006-4.742 2.202-.699 1.13-.947 2.54-1.067 3.845zm-2.75 2H20.56c.319 0 .578.26.578.579v11.068c0 .32-.26.578-.578.578H3.44a.578.578 0 01-.578-.578V11.49c0-.32.26-.578.578-.578z"
|
|
13
|
+
fill={color}
|
|
14
|
+
/>
|
|
15
|
+
</Svg>
|
|
16
|
+
)
|