@magmamath/students-features 0.6.13 → 0.6.14-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.
Files changed (67) hide show
  1. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js +17 -5
  2. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js +148 -41
  4. package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/components/Alternatives/InputButton.js +110 -0
  6. package/dist/commonjs/features/chatbot/components/Alternatives/InputButton.js.map +1 -0
  7. package/dist/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.js +159 -0
  8. package/dist/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.js.map +1 -0
  9. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +7 -4
  10. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  11. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +1 -1
  12. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
  13. package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js +1 -1
  14. package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
  15. package/dist/commonjs/shared/translation/localization/ca.json +1 -1
  16. package/dist/commonjs/shared/translation/localization/en.json +2 -2
  17. package/dist/commonjs/shared/translation/localization/gb.json +1 -1
  18. package/dist/commonjs/shared/translation/localization/sct.json +1 -1
  19. package/dist/commonjs/shared/translation/localization/sw.json +1 -1
  20. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js +17 -5
  21. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
  22. package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js +147 -41
  23. package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -1
  24. package/dist/module/features/chatbot/components/Alternatives/InputButton.js +102 -0
  25. package/dist/module/features/chatbot/components/Alternatives/InputButton.js.map +1 -0
  26. package/dist/module/features/chatbot/components/Alternatives/InputWithHintRow.js +152 -0
  27. package/dist/module/features/chatbot/components/Alternatives/InputWithHintRow.js.map +1 -0
  28. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +7 -4
  29. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  30. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +1 -1
  31. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
  32. package/dist/module/features/problemSelector/components/ProblemSelectorButton.js +1 -1
  33. package/dist/module/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
  34. package/dist/module/shared/translation/localization/ca.json +1 -1
  35. package/dist/module/shared/translation/localization/en.json +2 -2
  36. package/dist/module/shared/translation/localization/gb.json +1 -1
  37. package/dist/module/shared/translation/localization/sct.json +1 -1
  38. package/dist/module/shared/translation/localization/sw.json +1 -1
  39. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
  40. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +3 -1
  41. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -1
  42. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputButton.d.ts +9 -0
  43. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputButton.d.ts.map +1 -0
  44. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts +10 -0
  45. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map +1 -0
  46. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  47. package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
  48. package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +3 -1
  49. package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -1
  50. package/dist/typescript/module/features/chatbot/components/Alternatives/InputButton.d.ts +9 -0
  51. package/dist/typescript/module/features/chatbot/components/Alternatives/InputButton.d.ts.map +1 -0
  52. package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts +10 -0
  53. package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map +1 -0
  54. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  55. package/package.json +2 -2
  56. package/src/features/chatbot/components/Alternatives/Alternatives.tsx +18 -8
  57. package/src/features/chatbot/components/Alternatives/HelpRequestOption.tsx +146 -35
  58. package/src/features/chatbot/components/Alternatives/InputButton.tsx +101 -0
  59. package/src/features/chatbot/components/Alternatives/InputWithHintRow.tsx +157 -0
  60. package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +6 -2
  61. package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +1 -1
  62. package/src/features/problemSelector/components/ProblemSelectorButton.tsx +1 -1
  63. package/src/shared/translation/localization/ca.json +1 -1
  64. package/src/shared/translation/localization/en.json +2 -2
  65. package/src/shared/translation/localization/gb.json +1 -1
  66. package/src/shared/translation/localization/sct.json +1 -1
  67. package/src/shared/translation/localization/sw.json +1 -1
@@ -1,13 +1,112 @@
1
- import React, { useEffect, useRef, useState } from 'react'
2
- import { Animated, Pressable, StyleSheet } from 'react-native'
3
- import { COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
4
- import { ArrowRightIcon } from '../../../../shared/icons/ArrowRightIcon'
1
+ // import React, { useEffect, useRef, useState } from 'react'
2
+ // import { Animated, Pressable, StyleSheet } from 'react-native'
3
+ // import { ArrowUpIcon, COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
4
+ //
5
+ // type HelpRequestOptionProps = {
6
+ // onPress: () => void
7
+ // message: string
8
+ // disabled: boolean
9
+ // hoverColor?: string
10
+ // }
11
+ //
12
+ // export const HelpRequestOption = ({
13
+ // onPress,
14
+ // message,
15
+ // disabled = false,
16
+ // hoverColor = COLORS.PRIMARY_BLUE,
17
+ // }: HelpRequestOptionProps) => {
18
+ // const [isHovered, setIsHovered] = useState(false)
19
+ // const hoverAnim = useRef(new Animated.Value(0)).current
20
+ //
21
+ // const backgroundColor = hoverAnim.interpolate({
22
+ // inputRange: [0, 1],
23
+ // outputRange: [COLORS.NEUTRAL_1, hoverColor],
24
+ // })
25
+ // const textColor = hoverAnim.interpolate({
26
+ // inputRange: [0, 1],
27
+ // outputRange: [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1],
28
+ // })
29
+ //
30
+ // useEffect(() => {
31
+ // Animated.timing(hoverAnim, {
32
+ // toValue: isHovered ? 1 : 0,
33
+ // duration: 200,
34
+ // useNativeDriver: false,
35
+ // }).start()
36
+ // }, [isHovered, hoverAnim])
37
+ //
38
+ // return (
39
+ // <Pressable
40
+ // onHoverIn={() => setIsHovered(true)}
41
+ // onHoverOut={() => setIsHovered(false)}
42
+ // onPress={onPress}
43
+ // style={styles.button}
44
+ // disabled={disabled}
45
+ // accessibilityState={{ disabled }}
46
+ // accessibilityRole="button"
47
+ // >
48
+ // <Animated.View
49
+ // style={[styles.textWrapper, { backgroundColor, borderColor: isHovered ? backgroundColor: COLORS.PRIMARY_BLUE }]}
50
+ // >
51
+ // <Animated.Text numberOfLines={1} style={[styles.text, { color: textColor }]}>
52
+ // I need a hint
53
+ // </Animated.Text>
54
+ // <ArrowUpIcon color={isHovered ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_10} />
55
+ // </Animated.View>
56
+ // </Pressable>
57
+ // )
58
+ // }
59
+ //
60
+ // const styles = StyleSheet.create({
61
+ // button: {
62
+ // flexDirection: 'row',
63
+ // alignItems: 'flex-end',
64
+ // justifyContent: 'space-between',
65
+ // width: '100%',
66
+ // },
67
+ // text: {
68
+ // fontSize: 18,
69
+ // fontWeight: 400,
70
+ // fontFamily: FONT_FAMILY.buenosAires,
71
+ // color: COLORS.NEUTRAL_10,
72
+ // },
73
+ // textWrapper: {
74
+ // flex: 1,
75
+ // flexDirection: 'row',
76
+ // alignItems: 'center',
77
+ // justifyContent: 'space-between',
78
+ // maxWidth: 163,
79
+ // paddingHorizontal: SPACING[400],
80
+ // paddingVertical: SPACING[200],
81
+ // borderWidth: 1,
82
+ // borderRadius: 48,
83
+ // elevation: 3,
84
+ // shadowColor: '#333',
85
+ // shadowOffset: { width: 0, height: 1 },
86
+ // shadowOpacity: 0.25,
87
+ // shadowRadius: 3,
88
+ // backgroundColor: COLORS.NEUTRAL_1,
89
+ // borderColor: COLORS.PRIMARY_BLUE,
90
+ // },
91
+ // })
92
+
93
+ import React from 'react'
94
+ import { Pressable, StyleSheet } from 'react-native'
95
+ import Animated, {
96
+ useSharedValue,
97
+ withTiming,
98
+ useAnimatedStyle,
99
+ interpolateColor,
100
+ SharedValue,
101
+ } from 'react-native-reanimated'
102
+ import { ArrowUpIcon, COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
5
103
 
6
104
  type HelpRequestOptionProps = {
7
105
  onPress: () => void
8
106
  message: string
9
107
  disabled: boolean
10
108
  hoverColor?: string
109
+ visibleSv: SharedValue<number>
11
110
  }
12
111
 
13
112
  export const HelpRequestOption = ({
@@ -15,44 +114,56 @@ export const HelpRequestOption = ({
15
114
  message,
16
115
  disabled = false,
17
116
  hoverColor = COLORS.PRIMARY_BLUE,
117
+ visibleSv,
18
118
  }: HelpRequestOptionProps) => {
19
- const [isHovered, setIsHovered] = useState(false)
20
- const hoverAnim = useRef(new Animated.Value(0)).current
119
+ const hoverSv = useSharedValue(0)
120
+
121
+ const onHoverIn = () => {
122
+ if (!disabled) hoverSv.value = withTiming(1, { duration: 200 })
123
+ }
124
+ const onHoverOut = () => {
125
+ if (!disabled) hoverSv.value = withTiming(0, { duration: 200 })
126
+ }
127
+
128
+ const animatedWrapperStyle = useAnimatedStyle(() => {
129
+ const backgroundColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_1, hoverColor])
130
+ const borderColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.PRIMARY_BLUE, hoverColor])
21
131
 
22
- const backgroundColor = hoverAnim.interpolate({
23
- inputRange: [0, 1],
24
- outputRange: [COLORS.NEUTRAL_1, hoverColor],
25
- })
26
- const textColor = hoverAnim.interpolate({
27
- inputRange: [0, 1],
28
- outputRange: [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1],
29
- })
132
+ return {
133
+ backgroundColor,
134
+ borderColor,
135
+ }
136
+ }, [hoverSv])
30
137
 
31
- useEffect(() => {
32
- Animated.timing(hoverAnim, {
33
- toValue: isHovered ? 1 : 0,
34
- duration: 200,
35
- useNativeDriver: false,
36
- }).start()
37
- }, [isHovered, hoverAnim])
138
+ const animatedTextStyle = useAnimatedStyle(() => {
139
+ const color = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1])
140
+ return { color }
141
+ }, [hoverSv])
142
+
143
+ const animatedVisibilityStyle = useAnimatedStyle(() => {
144
+ return {
145
+ opacity: visibleSv ? visibleSv.value : 1,
146
+ }
147
+ }, [visibleSv])
38
148
 
39
149
  return (
40
150
  <Pressable
41
- onHoverIn={() => setIsHovered(true)}
42
- onHoverOut={() => setIsHovered(false)}
151
+ onHoverIn={onHoverIn}
152
+ onHoverOut={onHoverOut}
43
153
  onPress={onPress}
44
- style={styles.button}
154
+ style={[styles.button, disabled && { cursor: 'auto' }]}
45
155
  disabled={disabled}
46
156
  accessibilityState={{ disabled }}
47
157
  accessibilityRole="button"
48
158
  >
49
- <Animated.View
50
- style={[styles.textWrapper, { backgroundColor, borderColor: backgroundColor }]}
51
- >
52
- <Animated.Text numberOfLines={1} style={[styles.text, { color: textColor }]}>
159
+ <Animated.View style={[styles.textWrapper, animatedWrapperStyle, animatedVisibilityStyle]}>
160
+ <Animated.Text numberOfLines={1} style={[styles.text, animatedTextStyle]}>
53
161
  {message}
54
162
  </Animated.Text>
55
- <ArrowRightIcon color={isHovered ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_10} />
163
+
164
+ <Animated.Text style={animatedTextStyle}>
165
+ <ArrowUpIcon color={'currentColor'} size={16}/>
166
+ </Animated.Text>
56
167
  </Animated.View>
57
168
  </Pressable>
58
169
  )
@@ -61,22 +172,21 @@ export const HelpRequestOption = ({
61
172
  const styles = StyleSheet.create({
62
173
  button: {
63
174
  flexDirection: 'row',
64
- alignItems: 'center',
65
- justifyContent: 'space-between',
66
- width: '100%',
175
+ justifyContent: 'flex-end',
67
176
  },
68
177
  text: {
69
- fontSize: 20,
70
- fontWeight: 400,
178
+ fontSize: 18,
179
+ fontWeight: '400',
71
180
  fontFamily: FONT_FAMILY.buenosAires,
72
181
  color: COLORS.NEUTRAL_10,
182
+
73
183
  },
74
184
  textWrapper: {
75
185
  flex: 1,
76
186
  flexDirection: 'row',
77
187
  alignItems: 'center',
78
188
  justifyContent: 'space-between',
79
- maxWidth: 305,
189
+ minWidth: 163,
80
190
  paddingHorizontal: SPACING[400],
81
191
  paddingVertical: SPACING[200],
82
192
  borderWidth: 1,
@@ -87,5 +197,6 @@ const styles = StyleSheet.create({
87
197
  shadowOpacity: 0.25,
88
198
  shadowRadius: 3,
89
199
  backgroundColor: COLORS.NEUTRAL_1,
200
+ borderColor: COLORS.PRIMARY_BLUE,
90
201
  },
91
202
  })
@@ -0,0 +1,101 @@
1
+ import React from 'react'
2
+ import { Pressable, StyleSheet } from 'react-native'
3
+ import Animated, {
4
+ useSharedValue,
5
+ withTiming,
6
+ useAnimatedStyle,
7
+ interpolateColor,
8
+ } from 'react-native-reanimated'
9
+ import { ArrowUpIcon, COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
10
+
11
+ type HelpRequestOptionProps = {
12
+ onPress: () => void
13
+ disabled: boolean
14
+ hoverColor?: string
15
+ }
16
+
17
+ export const InputButton = ({
18
+ onPress,
19
+ disabled = false,
20
+ hoverColor = COLORS.PRIMARY_BLUE,
21
+ }: HelpRequestOptionProps) => {
22
+ const hoverSv = useSharedValue(0)
23
+
24
+ const onHoverIn = () => {
25
+ if (!disabled) hoverSv.value = withTiming(1, { duration: 200 })
26
+ }
27
+ const onHoverOut = () => {
28
+ if (!disabled) hoverSv.value = withTiming(0, { duration: 200 })
29
+ }
30
+
31
+ // const animatedWrapperStyle = useAnimatedStyle(() => {
32
+ // const backgroundColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_1, hoverColor])
33
+ // const borderColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.PRIMARY_BLUE, hoverColor])
34
+ // const color = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1])
35
+ //
36
+ // return {
37
+ // backgroundColor,
38
+ // borderColor,
39
+ // color
40
+ // }
41
+ // }, [hoverSv])
42
+
43
+ const animatedWrapperStyle = useAnimatedStyle(() => {
44
+ const backgroundColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_1, hoverColor])
45
+ const borderColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.PRIMARY_BLUE, hoverColor])
46
+ const color = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1])
47
+
48
+ return {
49
+ backgroundColor: disabled ? COLORS.NEUTRAL_2 : backgroundColor, // 👈 dimmed when disabled
50
+ borderColor: disabled ? COLORS.NEUTRAL_5 : borderColor,
51
+ color: disabled ? COLORS.NEUTRAL_5 : color,
52
+ }
53
+ }, [hoverSv, disabled])
54
+
55
+ return (
56
+ <Pressable
57
+ onHoverIn={onHoverIn}
58
+ onHoverOut={onHoverOut}
59
+ onPress={onPress}
60
+ style={[styles.button, disabled && { cursor: 'auto' }]}
61
+ disabled={disabled}
62
+ accessibilityState={{ disabled }}
63
+ accessibilityRole="button"
64
+ >
65
+ <Animated.Text style={[styles.textWrapper, animatedWrapperStyle]}>
66
+ <ArrowUpIcon color={'currentColor'} size={16} />
67
+ </Animated.Text>
68
+ </Pressable>
69
+ )
70
+ }
71
+
72
+ const styles = StyleSheet.create({
73
+ button: {
74
+ flexDirection: 'row',
75
+ justifyContent: 'flex-end',
76
+ },
77
+ text: {
78
+ fontSize: 18,
79
+ fontWeight: '400',
80
+ fontFamily: FONT_FAMILY.buenosAires,
81
+ color: COLORS.NEUTRAL_10,
82
+ backgroundColor: 'purple',
83
+ },
84
+ textWrapper: {
85
+ flex: 1,
86
+ flexDirection: 'row',
87
+ alignItems: 'center',
88
+ justifyContent: 'space-between',
89
+ paddingHorizontal: 13,
90
+ paddingVertical: 12,
91
+ borderWidth: 1,
92
+ borderRadius: 48,
93
+ elevation: 3,
94
+ shadowColor: '#333',
95
+ shadowOffset: { width: 0, height: 1 },
96
+ shadowOpacity: 0.25,
97
+ shadowRadius: 3,
98
+ backgroundColor: COLORS.NEUTRAL_1,
99
+ borderColor: COLORS.PRIMARY_BLUE,
100
+ },
101
+ })
@@ -0,0 +1,157 @@
1
+ import React, { useState } from 'react'
2
+ import { Platform, StyleSheet, TextInput, View } from 'react-native'
3
+ import Animated, {
4
+ useSharedValue,
5
+ withTiming,
6
+ useAnimatedStyle,
7
+ useAnimatedReaction,
8
+ } from 'react-native-reanimated'
9
+ import { COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
10
+ import { HelpRequestOption } from './HelpRequestOption'
11
+ import { InputButton } from './InputButton'
12
+
13
+ const COMPACT_WIDTH = 134
14
+
15
+ type InputWithHintRowProps = {
16
+ onPress: () => void
17
+ message: string
18
+ disabled: boolean
19
+ hoverColor?: string
20
+ }
21
+
22
+ export const InputWithHintRow = ({
23
+ onPress,
24
+ message,
25
+ disabled,
26
+ hoverColor,
27
+ }: InputWithHintRowProps) => {
28
+ const [value, setValue] = useState('')
29
+
30
+ const widthSv = useSharedValue(COMPACT_WIDTH)
31
+ const arrowOpacitySv = useSharedValue(1)
32
+ const hintVisibleSv = useSharedValue(1)
33
+ const valueLengthSv = useSharedValue(0)
34
+
35
+ const shouldDisable = value.trim().length > 0;
36
+
37
+ const animatedInputStyle = useAnimatedStyle(
38
+ () => ({
39
+ width: widthSv.value,
40
+ }),
41
+ [widthSv],
42
+ )
43
+
44
+ const handleChangeText = (text: string) => {
45
+ setValue(text)
46
+ valueLengthSv.value = text.trim().length
47
+ }
48
+
49
+ useAnimatedReaction(
50
+ () => valueLengthSv.value,
51
+ (currentLength) => {
52
+ if (currentLength > 0) {
53
+ widthSv.value = withTiming(305, { duration: 200 })
54
+ arrowOpacitySv.value = withTiming(0, { duration: 200 })
55
+ hintVisibleSv.value = withTiming(0, { duration: 200 })
56
+ } else {
57
+ widthSv.value = withTiming(COMPACT_WIDTH, { duration: 200 })
58
+ arrowOpacitySv.value = withTiming(1, { duration: 200 })
59
+ hintVisibleSv.value = withTiming(1, { duration: 200 })
60
+ }
61
+ },
62
+ [valueLengthSv],
63
+ )
64
+
65
+
66
+ // const handleFocus = () => {
67
+ // widthSv.value = withTiming(305, { duration: 200 }) // expand full width (container limits it)
68
+ // arrowOpacitySv.value = withTiming(0, { duration: 200 })
69
+ // hintVisibleSv.value = withTiming(0, { duration: 200 })
70
+ //
71
+ // // setIsFocused(true)
72
+ // }
73
+ //
74
+ // const handleBlur = () => {
75
+ // if (value.trim().length > 0) return
76
+ // widthSv.value = withTiming(COMPACT_WIDTH, { duration: 200 })
77
+ // arrowOpacitySv.value = withTiming(1, { duration: 200 })
78
+ // hintVisibleSv.value = withTiming(1, { duration: 200 })
79
+ // // setIsFocused(false)
80
+ // }
81
+
82
+ return (
83
+ <View style={styles.container}>
84
+ <Animated.View style={[styles.inputWrapper, animatedInputStyle]}>
85
+ <TextInput
86
+ style={styles.input}
87
+ placeholder="Type..."
88
+ placeholderTextColor={COLORS.NEUTRAL_6}
89
+ value={value}
90
+ onChangeText={handleChangeText}
91
+ // onFocus={handleFocus}
92
+ // onBlur={handleBlur}
93
+ />
94
+ <Animated.View style={[styles.arrowWrapper]}>
95
+ <InputButton
96
+ onPress={() => {
97
+ console.log('Pressed')
98
+ }}
99
+ disabled={value.trim().length < 1}
100
+ />
101
+ </Animated.View>
102
+ </Animated.View>
103
+
104
+ <HelpRequestOption
105
+ visibleSv={hintVisibleSv}
106
+ disabled={disabled || shouldDisable}
107
+ onPress={onPress}
108
+ message={message}
109
+ hoverColor={hoverColor}
110
+ />
111
+ </View>
112
+ )
113
+ }
114
+
115
+ const styles = StyleSheet.create({
116
+ container: {
117
+ position: 'relative', // 👈 allows overlap
118
+ width: '100%',
119
+ alignItems: 'flex-end', // keeps hint button aligned right
120
+ height: 52,
121
+ justifyContent: 'center',
122
+ },
123
+ inputWrapper: {
124
+ position: 'absolute', // 👈 overlap on top
125
+ zIndex: 1,
126
+ right: SPACING[200], // align with hint button
127
+ left: 0,
128
+ flexDirection: 'row',
129
+ alignItems: 'center',
130
+ borderWidth: 1,
131
+ borderColor: COLORS.NEUTRAL_5,
132
+ borderRadius: 200,
133
+ backgroundColor: COLORS.NEUTRAL_1,
134
+ paddingHorizontal: SPACING[100],
135
+ paddingVertical: SPACING[100],
136
+ overflow: 'hidden',
137
+ elevation: 3,
138
+ shadowColor: '#333',
139
+ shadowOffset: { width: 0, height: 1 },
140
+ shadowOpacity: 0.25,
141
+ shadowRadius: 3,
142
+ },
143
+ input: {
144
+ flex: 1,
145
+ fontSize: 16,
146
+ minWidth: 60,
147
+ minHeight: 22,
148
+ fontWeight: '400',
149
+ fontFamily: FONT_FAMILY.buenosAires,
150
+ ...(Platform.OS === 'web' && { outlineStyle: 'none' }),
151
+ paddingHorizontal: SPACING[100],
152
+ paddingVertical: SPACING[200],
153
+ },
154
+ arrowWrapper: {
155
+ marginLeft: SPACING[200],
156
+ },
157
+ })
@@ -6,6 +6,7 @@ import { ChatbotIcon } from '../../../../shared/icons/ChatbotIcon'
6
6
  import { ThreeDotsLoader } from '../ThreeDotsLoader/ThreeDotsLoader'
7
7
  import { CONTROLS_COLORS_MAP } from '../../constants'
8
8
  import { ColorScheme } from '../../types/style.types'
9
+ import { LavaIconInGlasses } from '@magmamath/students-features'
9
10
 
10
11
  type MessageLoaderProps = {
11
12
  colorScheme?: ColorScheme
@@ -14,7 +15,7 @@ type MessageLoaderProps = {
14
15
  export const MessageLoader = ({ colorScheme = ColorScheme.Blue }: MessageLoaderProps) => (
15
16
  <View style={styles.container}>
16
17
  <View style={styles.icon}>
17
- <ChatbotIcon width={60} height={80} />
18
+ <LavaIconInGlasses width={60} height={80} />
18
19
  </View>
19
20
  <View style={styles.loader}>
20
21
  <ThreeDotsLoader backgroundColor={CONTROLS_COLORS_MAP[colorScheme].background} />
@@ -27,10 +28,13 @@ const styles = StyleSheet.create({
27
28
  flexDirection: 'row',
28
29
  width: 327,
29
30
  alignItems: 'flex-end',
31
+ paddingLeft:70
30
32
  },
31
33
  icon: {
34
+ position: 'absolute',
35
+ zIndex:1,
32
36
  alignSelf: 'flex-end',
33
- marginRight: 8,
37
+ left: 0
34
38
  },
35
39
  loader: {
36
40
  flex: 1,
@@ -88,7 +88,7 @@ export const ChatbotMessages = ({
88
88
  </View>
89
89
  )}
90
90
 
91
- {!isHelpRequestPending && isOpen && (
91
+ {isOpen && (
92
92
  <Alternatives
93
93
  onPressAlternative={askChatForHelp}
94
94
  hasMessages={messages.length > 1}
@@ -38,7 +38,7 @@ export const ProblemSelectorButton = ({
38
38
  disabled={locked}
39
39
  icon={
40
40
  locked ? (
41
- <LockIcon color={customColorScheme[ButtonStates.DISABLED]?.color} size="large" />
41
+ <LockIcon color={customColorScheme[ButtonStates.DISABLED]?.color} size={25} />
42
42
  ) : (
43
43
  <Typography
44
44
  variant="h3"
@@ -13,7 +13,7 @@
13
13
  "time.yearsAgo": "years ago",
14
14
  "chat": {
15
15
  "anotherHint": "Give me another hint",
16
- "giveHint": "Give me a hint",
16
+ "giveHint": "I need a hint",
17
17
  "answerAgain": "Answer again to get another hint!",
18
18
  "errorMessage": "Something went wrong! Try again",
19
19
  "howCanIHelp": "Hi! Do you want help?",
@@ -12,8 +12,8 @@
12
12
  "time.yearAgo": "year ago",
13
13
  "time.yearsAgo": "years ago",
14
14
  "chat": {
15
- "anotherHint": "Give me another hint",
16
- "giveHint": "Give me a hint",
15
+ "anotherHint": "I need a hint",
16
+ "giveHint": "I need a hint",
17
17
  "answerAgain": "Answer again to get another hint!",
18
18
  "errorMessage": "Something went wrong! Try again",
19
19
  "howCanIHelp": "Hi! Do you want help?",
@@ -13,7 +13,7 @@
13
13
  "time.yearsAgo": "years ago",
14
14
  "chat": {
15
15
  "anotherHint": "Give me another hint",
16
- "giveHint": "Give me a hint",
16
+ "giveHint": "I need a hint",
17
17
  "answerAgain": "Answer again to get another hint!",
18
18
  "errorMessage": "Something went wrong! Try again",
19
19
  "howCanIHelp": "Hi! Do you want help?",
@@ -13,7 +13,7 @@
13
13
  "time.yearsAgo": "years ago",
14
14
  "chat": {
15
15
  "anotherHint": "Give me another hint",
16
- "giveHint": "Give me a hint",
16
+ "giveHint": "I need a hint",
17
17
  "answerAgain": "Answer again to get another hint!",
18
18
  "errorMessage": "Something went wrong! Try again",
19
19
  "howCanIHelp": "Hi! Do you want help?",
@@ -13,7 +13,7 @@
13
13
  "time.yearsAgo": "år sedan",
14
14
  "chat": {
15
15
  "anotherHint": "Ge mig en ledtråd",
16
- "giveHint": "Ge mig en ledtråd",
16
+ "giveHint": "Ge ledtråd",
17
17
  "answerAgain": "Svara igen för att få en till ledtråd!",
18
18
  "errorMessage": "Något gick snett! Försök igen",
19
19
  "howCanIHelp": "Hej! Hur kan jag hjälpa dig?",