@towsila/expo-ui-library 4.11.5 → 4.12.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/package.json +1 -1
- package/src/components/reusable/templateSubPage.tsx +46 -31
- package/src/components/screens/AddReportScreen.tsx +55 -61
- package/src/components/screens/LegalScreen.tsx +27 -30
- package/src/components/screens/VerificationCodeScreen.tsx +4 -2
- package/src/components/screens/confirmDeleteScreen.tsx +81 -27
- package/src/components/screens/forgotPasswordScreen.tsx +15 -12
- package/src/components/screens/loginScreen.tsx +183 -79
- package/src/components/screens/onBoarding.tsx +98 -73
- package/src/components/screens/profileScreen.tsx +84 -32
- package/src/components/screens/resetPassword.tsx +3 -0
- package/src/components/screens/signUpScreen.tsx +98 -93
- package/src/components/screens/sucessScreen.tsx +75 -28
- package/src/components/ui/AnimatedSuccessIcon.tsx +15 -8
- package/src/components/ui/OTPInput.tsx +59 -17
- package/src/components/ui/PageTopBar.tsx +45 -33
- package/src/components/ui/customPopup.tsx +78 -86
- package/src/components/ui/dynamicForm.tsx +49 -18
- package/src/components/ui/input.tsx +102 -65
- package/src/components/ui/navigationCard.tsx +60 -47
- package/src/components/ui/pageIndicator.tsx +42 -18
- package/src/components/ui/requestCard.tsx +161 -105
- package/src/components/ui/requestCardSkeleton.tsx +38 -0
- package/src/components/ui/select.tsx +49 -33
- package/src/components/ui/sharpButton.tsx +37 -20
- package/src/components/ui/skeleton.tsx +38 -0
- package/src/components/ui/termsPopup.tsx +74 -45
- package/src/components/ui/textArea.tsx +37 -40
- package/src/components/ui/toast.tsx +49 -52
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { useState, useRef } from "react";
|
|
3
2
|
import {
|
|
4
3
|
Text,
|
|
@@ -6,6 +5,7 @@ import {
|
|
|
6
5
|
TouchableOpacity,
|
|
7
6
|
ScrollView,
|
|
8
7
|
Modal,
|
|
8
|
+
useWindowDimensions,
|
|
9
9
|
} from "react-native";
|
|
10
10
|
import { useAppTheme } from "../../context/ThemeContext";
|
|
11
11
|
import { Fonts, textSize } from "../../tokens/typography";
|
|
@@ -30,6 +30,8 @@ interface SelectProps {
|
|
|
30
30
|
bgColor?: string;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
const DROPDOWN_MAX_HEIGHT = 240;
|
|
34
|
+
|
|
33
35
|
export default function Select({
|
|
34
36
|
options,
|
|
35
37
|
value,
|
|
@@ -50,17 +52,23 @@ export default function Select({
|
|
|
50
52
|
|
|
51
53
|
const triggerRef = useRef<View>(null);
|
|
52
54
|
const { colors } = useAppTheme();
|
|
53
|
-
const {isRTL} = useLanguage();
|
|
55
|
+
const { isRTL } = useLanguage();
|
|
56
|
+
const { height: screenH } = useWindowDimensions();
|
|
54
57
|
|
|
55
|
-
const selectedLabel = options.find(
|
|
56
|
-
(option) => option.value === value
|
|
57
|
-
)?.label;
|
|
58
|
+
const selectedLabel = options.find((option) => option.value === value)?.label;
|
|
58
59
|
|
|
59
60
|
const handleOpen = () => {
|
|
60
61
|
triggerRef.current?.measureInWindow((x, y, width, measuredHeight) => {
|
|
62
|
+
const spaceBelow = screenH - (y + measuredHeight);
|
|
63
|
+
const spaceAbove = y;
|
|
64
|
+
// Flip above if there isn't enough room below AND there's more room above
|
|
65
|
+
const flipUp =
|
|
66
|
+
spaceBelow < DROPDOWN_MAX_HEIGHT + 8 && spaceAbove > spaceBelow;
|
|
61
67
|
setDropdownPos({
|
|
62
68
|
x,
|
|
63
|
-
y:
|
|
69
|
+
y: flipUp
|
|
70
|
+
? Math.max(y - DROPDOWN_MAX_HEIGHT - 4, 8)
|
|
71
|
+
: y + measuredHeight,
|
|
64
72
|
width,
|
|
65
73
|
});
|
|
66
74
|
setOpen(true);
|
|
@@ -68,8 +76,9 @@ export default function Select({
|
|
|
68
76
|
|
|
69
77
|
onClearError?.();
|
|
70
78
|
};
|
|
71
|
-
const align = isRTL ? "right":"left";
|
|
72
|
-
const layout = isRTL?"row-reverse":"row";
|
|
79
|
+
const align = isRTL ? "right" : "left";
|
|
80
|
+
const layout = isRTL ? "row-reverse" : "row";
|
|
81
|
+
|
|
73
82
|
return (
|
|
74
83
|
<View style={{ marginBottom: 4 }}>
|
|
75
84
|
{label && (
|
|
@@ -79,7 +88,7 @@ const layout = isRTL?"row-reverse":"row";
|
|
|
79
88
|
fontSize: textSize.xs,
|
|
80
89
|
fontFamily: Fonts.montserrat.semiBold,
|
|
81
90
|
marginBottom: 6,
|
|
82
|
-
textAlign: align
|
|
91
|
+
textAlign: align,
|
|
83
92
|
}}
|
|
84
93
|
>
|
|
85
94
|
{label}
|
|
@@ -93,44 +102,48 @@ const layout = isRTL?"row-reverse":"row";
|
|
|
93
102
|
<View ref={triggerRef} collapsable={false}>
|
|
94
103
|
<View
|
|
95
104
|
style={{
|
|
96
|
-
height,
|
|
105
|
+
minHeight: height,
|
|
97
106
|
backgroundColor: bgColor ?? colors.background.main,
|
|
98
107
|
borderWidth: 1.4,
|
|
99
108
|
borderColor: error
|
|
100
109
|
? colors.semantic.error
|
|
101
110
|
: open
|
|
102
|
-
|
|
103
|
-
|
|
111
|
+
? colors.primary
|
|
112
|
+
: colors.text.primary,
|
|
104
113
|
borderRadius: 12,
|
|
105
114
|
paddingHorizontal: 14,
|
|
106
|
-
|
|
115
|
+
paddingVertical: 12,
|
|
116
|
+
flexDirection: layout,
|
|
107
117
|
alignItems: "center",
|
|
108
118
|
justifyContent: "space-between",
|
|
119
|
+
gap: 8,
|
|
109
120
|
}}
|
|
110
121
|
>
|
|
111
122
|
<Text
|
|
112
123
|
numberOfLines={1}
|
|
113
124
|
style={{
|
|
114
125
|
flex: 1,
|
|
126
|
+
minWidth: 0,
|
|
115
127
|
fontSize: textSize.sm,
|
|
116
128
|
fontFamily: Fonts.montserrat.regular,
|
|
117
129
|
color: colors.text.primary,
|
|
118
|
-
|
|
130
|
+
textAlign: align,
|
|
119
131
|
}}
|
|
120
132
|
>
|
|
121
133
|
{selectedLabel ?? placeholder}
|
|
122
134
|
</Text>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
135
|
+
<View style={{ flexShrink: 0 }}>
|
|
136
|
+
<Ionicons
|
|
137
|
+
name={open ? "chevron-up" : "chevron-down"}
|
|
138
|
+
size={16}
|
|
139
|
+
color={colors.text.primary}
|
|
140
|
+
/>
|
|
141
|
+
</View>
|
|
129
142
|
</View>
|
|
130
143
|
</View>
|
|
131
144
|
</TouchableOpacity>
|
|
132
145
|
|
|
133
|
-
{error && <ErrorMessage message={error} position={align}/>}
|
|
146
|
+
{error && <ErrorMessage message={error} position={align} />}
|
|
134
147
|
|
|
135
148
|
<Modal
|
|
136
149
|
visible={open}
|
|
@@ -146,10 +159,10 @@ const layout = isRTL?"row-reverse":"row";
|
|
|
146
159
|
<View
|
|
147
160
|
style={{
|
|
148
161
|
position: "absolute",
|
|
149
|
-
top: dropdownPos.y
|
|
162
|
+
top: dropdownPos.y,
|
|
150
163
|
left: dropdownPos.x,
|
|
151
164
|
width: dropdownPos.width,
|
|
152
|
-
maxHeight:
|
|
165
|
+
maxHeight: DROPDOWN_MAX_HEIGHT,
|
|
153
166
|
backgroundColor: bgColor ?? colors.background.card,
|
|
154
167
|
borderRadius: 12,
|
|
155
168
|
borderWidth: 1.4,
|
|
@@ -168,9 +181,8 @@ const layout = isRTL?"row-reverse":"row";
|
|
|
168
181
|
nestedScrollEnabled
|
|
169
182
|
showsVerticalScrollIndicator={false}
|
|
170
183
|
>
|
|
171
|
-
{options.map((option
|
|
184
|
+
{options.map((option) => {
|
|
172
185
|
const isSelected = option.value === value;
|
|
173
|
-
|
|
174
186
|
return (
|
|
175
187
|
<TouchableOpacity
|
|
176
188
|
key={option.value}
|
|
@@ -185,14 +197,17 @@ const layout = isRTL?"row-reverse":"row";
|
|
|
185
197
|
flexDirection: layout,
|
|
186
198
|
alignItems: "center",
|
|
187
199
|
justifyContent: "space-between",
|
|
200
|
+
gap: 8,
|
|
188
201
|
backgroundColor: isSelected
|
|
189
202
|
? colors.primary + "12"
|
|
190
203
|
: bgColor ?? colors.background.card,
|
|
191
204
|
}}
|
|
192
205
|
>
|
|
193
206
|
<Text
|
|
207
|
+
numberOfLines={1}
|
|
194
208
|
style={{
|
|
195
209
|
flex: 1,
|
|
210
|
+
minWidth: 0,
|
|
196
211
|
fontSize: textSize.sm,
|
|
197
212
|
fontFamily: isSelected
|
|
198
213
|
? Fonts.montserrat.semiBold
|
|
@@ -200,18 +215,19 @@ const layout = isRTL?"row-reverse":"row";
|
|
|
200
215
|
color: isSelected
|
|
201
216
|
? colors.primary
|
|
202
217
|
: colors.text.primary,
|
|
203
|
-
|
|
218
|
+
textAlign: align,
|
|
204
219
|
}}
|
|
205
220
|
>
|
|
206
221
|
{option.label}
|
|
207
222
|
</Text>
|
|
208
|
-
|
|
209
223
|
{isSelected && (
|
|
210
|
-
<
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
224
|
+
<View style={{ flexShrink: 0 }}>
|
|
225
|
+
<Ionicons
|
|
226
|
+
name="checkmark"
|
|
227
|
+
size={18}
|
|
228
|
+
color={colors.primary}
|
|
229
|
+
/>
|
|
230
|
+
</View>
|
|
215
231
|
)}
|
|
216
232
|
</TouchableOpacity>
|
|
217
233
|
);
|
|
@@ -222,4 +238,4 @@ const layout = isRTL?"row-reverse":"row";
|
|
|
222
238
|
</Modal>
|
|
223
239
|
</View>
|
|
224
240
|
);
|
|
225
|
-
}
|
|
241
|
+
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
TouchableOpacity,
|
|
4
|
+
Text,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
ActivityIndicator,
|
|
7
|
+
View,
|
|
8
|
+
ViewStyle,
|
|
9
|
+
} from "react-native";
|
|
3
10
|
import { Fonts, textSize } from "../../tokens/typography";
|
|
4
11
|
import { useAppTheme } from "../../context/ThemeContext";
|
|
5
|
-
import SharpContainer from "./sharpContainer"
|
|
12
|
+
import SharpContainer from "./sharpContainer";
|
|
6
13
|
|
|
7
14
|
type ButtonProps = {
|
|
8
15
|
text: string;
|
|
@@ -17,21 +24,21 @@ type ButtonProps = {
|
|
|
17
24
|
disabled?: boolean;
|
|
18
25
|
};
|
|
19
26
|
|
|
20
|
-
|
|
21
27
|
export default function SharpButton({
|
|
22
28
|
text,
|
|
23
29
|
bgColor = "transparent",
|
|
24
30
|
textColor,
|
|
25
|
-
borderColor,
|
|
31
|
+
borderColor,
|
|
26
32
|
onPress,
|
|
27
33
|
fontSize = textSize.md,
|
|
28
34
|
fontFamily = Fonts.montserrat.semiBold,
|
|
29
35
|
height = 56,
|
|
30
36
|
loading,
|
|
31
|
-
disabled= false,
|
|
37
|
+
disabled = false,
|
|
32
38
|
}: ButtonProps) {
|
|
33
39
|
const { colors } = useAppTheme();
|
|
34
40
|
const isInactive = loading || disabled;
|
|
41
|
+
|
|
35
42
|
return (
|
|
36
43
|
<TouchableOpacity
|
|
37
44
|
onPress={onPress}
|
|
@@ -39,21 +46,31 @@ export default function SharpButton({
|
|
|
39
46
|
disabled={isInactive}
|
|
40
47
|
style={{ opacity: disabled && !loading ? 0.5 : 1 }}
|
|
41
48
|
>
|
|
42
|
-
<SharpContainer
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
<SharpContainer
|
|
50
|
+
height={height}
|
|
51
|
+
bgColor={bgColor}
|
|
52
|
+
borderColor={borderColor ?? colors.text.primary}
|
|
53
|
+
>
|
|
54
|
+
<View style={styles.contentContainer}>
|
|
55
|
+
{loading ? (
|
|
56
|
+
<ActivityIndicator
|
|
57
|
+
color={textColor ?? colors.text.primary}
|
|
58
|
+
size="small"
|
|
59
|
+
/>
|
|
60
|
+
) : (
|
|
61
|
+
<Text
|
|
62
|
+
numberOfLines={2}
|
|
63
|
+
style={{
|
|
64
|
+
fontSize,
|
|
65
|
+
fontFamily: fontFamily,
|
|
66
|
+
color: textColor ?? colors.text.primary,
|
|
67
|
+
textAlign: "center",
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{text}
|
|
71
|
+
</Text>
|
|
72
|
+
)}
|
|
73
|
+
</View>
|
|
57
74
|
</SharpContainer>
|
|
58
75
|
</TouchableOpacity>
|
|
59
76
|
);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { Animated, DimensionValue, StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import { useAppTheme } from "../../context/ThemeContext";
|
|
4
|
+
|
|
5
|
+
export default function Skeleton({
|
|
6
|
+
width = "100%",
|
|
7
|
+
height = 16,
|
|
8
|
+
radius = 8,
|
|
9
|
+
style,
|
|
10
|
+
}: {
|
|
11
|
+
width?: DimensionValue;
|
|
12
|
+
height?: number;
|
|
13
|
+
radius?: number;
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
|
+
}) {
|
|
16
|
+
const { colors } = useAppTheme();
|
|
17
|
+
const opacity = useRef(new Animated.Value(0.4)).current;
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const loop = Animated.loop(
|
|
21
|
+
Animated.sequence([
|
|
22
|
+
Animated.timing(opacity, { toValue: 1, duration: 700, useNativeDriver: true }),
|
|
23
|
+
Animated.timing(opacity, { toValue: 0.4, duration: 700, useNativeDriver: true }),
|
|
24
|
+
])
|
|
25
|
+
);
|
|
26
|
+
loop.start();
|
|
27
|
+
return () => loop.stop();
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Animated.View
|
|
32
|
+
style={[
|
|
33
|
+
{ width, height, borderRadius: radius, backgroundColor: colors.semantic.border, opacity },
|
|
34
|
+
style,
|
|
35
|
+
]}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -4,58 +4,87 @@ import { useAppTheme } from "../../context/ThemeContext";
|
|
|
4
4
|
import { useLanguage } from "../../context/LanguageContext";
|
|
5
5
|
import { Fonts, textSize } from "../../tokens/typography";
|
|
6
6
|
|
|
7
|
-
interface TermsPopupProps{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
interface TermsPopupProps {
|
|
8
|
+
showTerms: boolean;
|
|
9
|
+
generalTerms: string[];
|
|
10
|
+
onAgree: () => void;
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
buttonText: string;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
|
|
16
|
+
export default function TermsPopup({
|
|
17
|
+
showTerms,
|
|
18
|
+
generalTerms,
|
|
19
|
+
onAgree,
|
|
20
|
+
title,
|
|
21
|
+
description,
|
|
22
|
+
buttonText,
|
|
23
|
+
}: TermsPopupProps) {
|
|
24
|
+
const { colors } = useAppTheme();
|
|
25
|
+
const { isRTL } = useLanguage();
|
|
26
|
+
const align = isRTL ? "right" : "left";
|
|
27
|
+
|
|
28
|
+
return (
|
|
20
29
|
<CustomPopUp
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
visible={showTerms}
|
|
31
|
+
title={title}
|
|
32
|
+
header={
|
|
33
|
+
<Text
|
|
34
|
+
style={{
|
|
25
35
|
fontFamily: Fonts.montserrat.regular,
|
|
26
36
|
fontSize: textSize.sm,
|
|
27
37
|
color: colors.text.secondary,
|
|
28
|
-
marginBottom:
|
|
29
|
-
textAlign:align
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
marginBottom: 8,
|
|
39
|
+
textAlign: align,
|
|
40
|
+
lineHeight: textSize.sm * 1.4,
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
{description}
|
|
44
|
+
</Text>
|
|
45
|
+
}
|
|
46
|
+
body={
|
|
47
|
+
<ScrollView
|
|
48
|
+
style={{ maxHeight: 320 }} // a bit more room, still short enough
|
|
49
|
+
scrollEventThrottle={16}
|
|
50
|
+
showsVerticalScrollIndicator={false}
|
|
51
|
+
>
|
|
52
|
+
{generalTerms.map((term, i) => (
|
|
53
|
+
<View
|
|
54
|
+
key={i}
|
|
55
|
+
style={{
|
|
56
|
+
flexDirection: isRTL ? "row-reverse" : "row",
|
|
57
|
+
gap: 8,
|
|
58
|
+
marginBottom: 8,
|
|
59
|
+
alignItems: "flex-start",
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
<Text
|
|
63
|
+
style={{
|
|
64
|
+
color: colors.primary,
|
|
65
|
+
lineHeight: textSize.sm * 1.4,
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
•
|
|
69
|
+
</Text>
|
|
70
|
+
<Text
|
|
71
|
+
style={{
|
|
44
72
|
fontFamily: Fonts.montserrat.regular,
|
|
45
73
|
fontSize: textSize.sm,
|
|
46
74
|
color: colors.text.secondary,
|
|
47
75
|
flex: 1,
|
|
48
|
-
lineHeight:
|
|
49
|
-
textAlign:align
|
|
50
|
-
}}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
76
|
+
lineHeight: textSize.sm * 1.4,
|
|
77
|
+
textAlign: align,
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
{term}
|
|
81
|
+
</Text>
|
|
82
|
+
</View>
|
|
83
|
+
))}
|
|
84
|
+
</ScrollView>
|
|
85
|
+
}
|
|
86
|
+
agreeText={buttonText}
|
|
87
|
+
onAgree={onAgree}
|
|
88
|
+
/>
|
|
89
|
+
);
|
|
61
90
|
}
|
|
@@ -30,54 +30,51 @@ export default function TextArea({
|
|
|
30
30
|
showCharCount = false,
|
|
31
31
|
}: TextAreaProps) {
|
|
32
32
|
const { colors } = useAppTheme();
|
|
33
|
-
|
|
33
|
+
const { isRTL } = useLanguage();
|
|
34
34
|
const handleChange = (text: string) => {
|
|
35
35
|
onChangeText(text);
|
|
36
36
|
onClearError?.();
|
|
37
37
|
};
|
|
38
|
-
const align = isRTL?"right":"left";
|
|
38
|
+
const align = isRTL ? "right" : "left";
|
|
39
|
+
|
|
39
40
|
return (
|
|
40
41
|
<View style={{ marginBottom: 16 }}>
|
|
41
42
|
{label && (
|
|
42
43
|
<Text
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
style={{
|
|
45
|
+
fontSize: textSize.xs,
|
|
46
|
+
fontFamily: Fonts.montserrat.semiBold,
|
|
47
|
+
color: colors.text.primary,
|
|
48
|
+
marginBottom: 6,
|
|
49
|
+
textAlign: align,
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
{label}
|
|
53
|
+
</Text>
|
|
53
54
|
)}
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
textAlign: isRTL ? "right" : "left",
|
|
78
|
-
writingDirection: isRTL ? "rtl" : "ltr",
|
|
79
|
-
}}
|
|
80
|
-
/>
|
|
56
|
+
<TextInput
|
|
57
|
+
value={value}
|
|
58
|
+
onChangeText={handleChange}
|
|
59
|
+
placeholder={placeholder}
|
|
60
|
+
multiline
|
|
61
|
+
textAlignVertical="top"
|
|
62
|
+
maxLength={maxLength}
|
|
63
|
+
placeholderTextColor={colors.text.placeholder}
|
|
64
|
+
style={{
|
|
65
|
+
minHeight,
|
|
66
|
+
padding: 14,
|
|
67
|
+
backgroundColor: bgColor ?? colors.background.card,
|
|
68
|
+
borderWidth: 1.4,
|
|
69
|
+
borderColor: error ? colors.semantic.error : colors.text.primary,
|
|
70
|
+
borderRadius: 12,
|
|
71
|
+
fontSize: textSize.sm,
|
|
72
|
+
fontFamily: Fonts.montserrat.regular,
|
|
73
|
+
color: colors.text.primary,
|
|
74
|
+
textAlign: isRTL ? "right" : "left",
|
|
75
|
+
writingDirection: isRTL ? "rtl" : "ltr",
|
|
76
|
+
}}
|
|
77
|
+
/>
|
|
81
78
|
|
|
82
79
|
{showCharCount && (
|
|
83
80
|
<Text
|
|
@@ -92,11 +89,11 @@ const align = isRTL?"right":"left";
|
|
|
92
89
|
marginTop: 4,
|
|
93
90
|
}}
|
|
94
91
|
>
|
|
95
|
-
{
|
|
92
|
+
{value.length} / {maxLength}
|
|
96
93
|
</Text>
|
|
97
94
|
)}
|
|
98
95
|
|
|
99
|
-
{error && <ErrorMessage message={error} />}
|
|
96
|
+
{error && <ErrorMessage message={error} position={align} />}
|
|
100
97
|
</View>
|
|
101
98
|
);
|
|
102
99
|
}
|