@momo-kits/foundation 0.150.2-phuc.13 → 0.150.2-scaleSize.35

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 (74) hide show
  1. package/Application/BottomSheet.tsx +39 -114
  2. package/Application/BottomTab/Badge.tsx +15 -2
  3. package/Application/BottomTab/BottomTabBar.tsx +1 -1
  4. package/Application/BottomTab/CustomBottomTabItem.tsx +5 -3
  5. package/Application/BottomTab/TabBarIcon.tsx +8 -6
  6. package/Application/BottomTab/index.tsx +82 -87
  7. package/Application/Components/BackgroundImageView.tsx +1 -1
  8. package/Application/Components/HeaderAnimated.tsx +12 -11
  9. package/Application/Components/HeaderBackground.tsx +1 -1
  10. package/Application/Components/HeaderExtendHeader.tsx +31 -26
  11. package/Application/Components/HeaderLeft.tsx +2 -2
  12. package/Application/Components/HeaderRight.tsx +24 -20
  13. package/Application/Components/HeaderTitle.tsx +19 -7
  14. package/Application/Components/NavigationButton.tsx +12 -11
  15. package/Application/Components/SearchHeader.tsx +20 -3
  16. package/Application/ModalScreen.tsx +14 -1
  17. package/Application/NavigationContainer.tsx +13 -7
  18. package/Application/StackScreen.tsx +100 -155
  19. package/Application/WidgetContainer.tsx +1 -1
  20. package/Application/index.ts +12 -31
  21. package/Application/types.ts +66 -18
  22. package/Application/utils.tsx +41 -17
  23. package/Assets/language.json +6 -2
  24. package/Assets/lottie_circle_loader.json +1 -0
  25. package/Badge/Badge.tsx +14 -11
  26. package/Badge/BadgeRibbon.tsx +1 -1
  27. package/Button/index.tsx +47 -32
  28. package/CheckBox/index.tsx +23 -19
  29. package/CheckBox/styles.ts +1 -0
  30. package/Context/index.ts +23 -0
  31. package/Divider/DashDivider.tsx +10 -9
  32. package/Divider/index.tsx +7 -7
  33. package/FoundationList/index.tsx +7 -4
  34. package/Icon/index.tsx +9 -9
  35. package/IconButton/index.tsx +12 -10
  36. package/Image/index.tsx +9 -2
  37. package/Input/Input.tsx +3 -5
  38. package/Input/InputDropDown.tsx +31 -23
  39. package/Input/InputMoney.tsx +3 -5
  40. package/Input/InputOTP.tsx +7 -7
  41. package/Input/InputPhoneNumber.tsx +271 -0
  42. package/Input/InputSearch.tsx +3 -5
  43. package/Input/InputTextArea.tsx +2 -1
  44. package/Input/TextTyping.tsx +8 -2
  45. package/Input/common.tsx +31 -24
  46. package/Input/index.tsx +21 -1
  47. package/Input/styles.ts +17 -12
  48. package/Input/utils.ts +42 -1
  49. package/Layout/Card.tsx +4 -3
  50. package/Layout/FloatingButton.tsx +1 -1
  51. package/Layout/GridSystem.tsx +15 -14
  52. package/Layout/Item.tsx +1 -1
  53. package/Layout/Screen.tsx +8 -5
  54. package/Layout/Section.tsx +1 -1
  55. package/Layout/TrackingScope.tsx +3 -3
  56. package/Loader/DotLoader.tsx +7 -7
  57. package/Loader/ProgressBar.tsx +10 -9
  58. package/Loader/Spinner.tsx +7 -7
  59. package/Pagination/Dot.tsx +10 -7
  60. package/Pagination/PaginationDot.tsx +8 -8
  61. package/Pagination/PaginationScroll.tsx +12 -10
  62. package/Popup/PopupNotify.tsx +2 -2
  63. package/Popup/PopupPromotion.tsx +1 -1
  64. package/Radio/index.tsx +18 -18
  65. package/Skeleton/index.tsx +1 -1
  66. package/Switch/index.tsx +17 -12
  67. package/Text/index.tsx +4 -4
  68. package/Text/styles.ts +37 -36
  69. package/Text/types.ts +1 -0
  70. package/Text/utils.ts +33 -4
  71. package/Title/index.tsx +48 -29
  72. package/index.ts +1 -0
  73. package/package.json +35 -34
  74. package/Application/Components/index.ts +0 -7
@@ -1,16 +1,18 @@
1
- import React, {useContext} from 'react';
2
- import {TouchableOpacity, View} from 'react-native';
1
+ import React, { useContext } from 'react';
2
+ import { TouchableOpacity, View } from 'react-native';
3
+ import { useComponentId } from '../Application';
4
+ import { ApplicationContext, ComponentContext } from '../Context';
5
+ import { Icon } from '../Icon';
3
6
  import {
4
- ApplicationContext,
5
- ComponentContext,
6
- useComponentId,
7
- } from '../Application';
8
- import {Icon} from '../Icon';
9
- import {ErrorView, FloatingView, getBorderColor, getSizeStyle} from './common';
10
- import {InputDropDownProps} from './index';
11
- import {Text} from '../Text';
7
+ ErrorView,
8
+ FloatingView,
9
+ getBorderColor,
10
+ getSizeStyle,
11
+ } from './common';
12
+ import { InputDropDownProps } from './index';
13
+ import { Text } from '../Text';
12
14
  import styles from './styles';
13
- import {Spacing} from '../Consts';
15
+ import { Spacing } from '../Consts';
14
16
 
15
17
  const InputDropDown = ({
16
18
  value,
@@ -32,12 +34,12 @@ const InputDropDown = ({
32
34
  multiline,
33
35
  ...props
34
36
  }: InputDropDownProps) => {
35
- const {theme} = useContext(ApplicationContext);
37
+ const { theme } = useContext(ApplicationContext);
36
38
  const componentName = 'InputDropDown';
37
39
 
38
- const {componentId} = useComponentId(
40
+ const { componentId } = useComponentId(
39
41
  `${componentName}/${placeholder}`,
40
- props.accessibilityLabel
42
+ props.accessibilityLabel,
41
43
  );
42
44
 
43
45
  /**
@@ -57,10 +59,11 @@ const InputDropDown = ({
57
59
  <View
58
60
  style={[
59
61
  styles.inputDropDownWrapper,
60
- {backgroundColor: theme.colors.background.surface},
62
+ { backgroundColor: theme.colors.background.surface },
61
63
  getSizeStyle(size, multiline),
62
64
  getBorderColor(theme, false, errorMessage, disabled as boolean),
63
- ]}>
65
+ ]}
66
+ >
64
67
  <FloatingView
65
68
  floatingValue={floatingValue}
66
69
  floatingIconColor={floatingIconColor}
@@ -79,7 +82,8 @@ const InputDropDown = ({
79
82
  marginTop: Spacing.M,
80
83
  marginRight: Spacing.S,
81
84
  },
82
- ]}>
85
+ ]}
86
+ >
83
87
  <Icon
84
88
  color={leadingIconColor}
85
89
  source={leadingIcon}
@@ -93,8 +97,9 @@ const InputDropDown = ({
93
97
  numberOfLines={multiline ? undefined : 1}
94
98
  typography={'body_default_regular'}
95
99
  color={value ? textColor : placeholderColor}
96
- accessibilityState={{disabled: disabled as boolean}}
97
- accessibilityLabel={`${componentId}`}>
100
+ accessibilityState={{ disabled: disabled as boolean }}
101
+ accessibilityLabel={`${componentId}`}
102
+ >
98
103
  {value || placeholder}
99
104
  </Text>
100
105
  </View>
@@ -106,7 +111,8 @@ const InputDropDown = ({
106
111
  alignItems: multiline ? 'flex-start' : 'center',
107
112
  paddingTop: multiline ? Spacing.M : 0,
108
113
  },
109
- ]}>
114
+ ]}
115
+ >
110
116
  <Icon source={'arrow_chevron_down_small'} />
111
117
  </View>
112
118
  </View>
@@ -120,13 +126,15 @@ const InputDropDown = ({
120
126
  componentId,
121
127
  params,
122
128
  state: 'enabled',
123
- }}>
129
+ }}
130
+ >
124
131
  <TouchableOpacity
125
132
  {...props}
126
133
  accessibilityLabel={`${componentId}|touch`}
127
- accessibilityState={{disabled: disabled as boolean}}
134
+ accessibilityState={{ disabled: disabled as boolean }}
128
135
  activeOpacity={0.6}
129
- style={[style, styles.wrapper]}>
136
+ style={[style, styles.wrapper]}
137
+ >
130
138
  {renderInputView()}
131
139
  <ErrorView
132
140
  errorMessage={errorMessage}
@@ -14,11 +14,8 @@ import {
14
14
  TouchableOpacity,
15
15
  View,
16
16
  } from 'react-native';
17
- import {
18
- ApplicationContext,
19
- ComponentContext,
20
- useComponentId,
21
- } from '../Application';
17
+ import { useComponentId } from '../Application';
18
+ import { ApplicationContext, ComponentContext } from '../Context';
22
19
  import { Icon } from '../Icon';
23
20
  import {
24
21
  ErrorView,
@@ -122,6 +119,7 @@ const InputMoney = forwardRef(
122
119
 
123
120
  const onClearText = () => {
124
121
  inputRef?.current?.clear();
122
+ inputRef.current?.setNativeProps({ text: '' });
125
123
  setDisplayValue('');
126
124
  setNumericValue('');
127
125
  onChangeText?.('');
@@ -14,18 +14,16 @@ import {
14
14
  TouchableOpacity,
15
15
  View,
16
16
  } from 'react-native';
17
- import {
18
- ApplicationContext,
19
- ComponentContext,
20
- useComponentId,
21
- } from '../Application';
17
+ import { useComponentId } from '../Application';
22
18
  import { Spacing, Styles } from '../Consts';
23
- import { scaleSize, Text } from '../Text';
19
+ import { Text } from '../Text';
24
20
  import { ErrorView, getBorderColor } from './common';
25
21
  import { CaretProps, InputOTPProps } from './index';
26
22
  import styles from './styles';
27
23
  import { Icon } from '../Icon';
28
24
  import SystemTextInput from './SystemTextInput';
25
+ import { ApplicationContext, ComponentContext } from '../Context';
26
+ import { useScaleSize } from '../Text/utils.ts';
29
27
 
30
28
  const OTPCaret: FC<CaretProps> = ({ index, length }) => {
31
29
  const DURATION = 300;
@@ -56,7 +54,7 @@ const OTPCaret: FC<CaretProps> = ({ index, length }) => {
56
54
  <View style={[Styles.rowCenter, spacingStyle]}>
57
55
  <Animated.View
58
56
  style={{
59
- height: scaleSize(12),
57
+ height: useScaleSize(12),
60
58
  width: 1,
61
59
  backgroundColor: theme.colors.primary,
62
60
  opacity,
@@ -202,6 +200,7 @@ const InputOTP = forwardRef(
202
200
  const renderInputView = () => {
203
201
  return (
204
202
  <TouchableOpacity
203
+ activeOpacity={1}
205
204
  onPress={() => inputRef.current?.focus()}
206
205
  style={[
207
206
  styles.otpInput,
@@ -238,6 +237,7 @@ const InputOTP = forwardRef(
238
237
  {...props}
239
238
  ref={inputRef}
240
239
  value={value}
240
+ textAlign={'center'}
241
241
  onChangeText={_onChangeText}
242
242
  keyboardType={dataType === 'number' ? 'number-pad' : 'default'}
243
243
  allowFontScaling={false}
@@ -0,0 +1,271 @@
1
+ import React, {
2
+ forwardRef,
3
+ useContext,
4
+ useImperativeHandle,
5
+ useRef,
6
+ useState,
7
+ } from 'react';
8
+ import {
9
+ NativeSyntheticEvent,
10
+ StyleSheet,
11
+ TextInput,
12
+ TextInputFocusEventData,
13
+ TouchableOpacity,
14
+ View,
15
+ } from 'react-native';
16
+ import { useComponentId } from '../Application';
17
+ import { ApplicationContext, ComponentContext } from '../Context';
18
+ import { Colors, Spacing, Styles } from '../Consts';
19
+ import { Icon } from '../Icon';
20
+ import { scaleSize, Text } from '../Text';
21
+ import {
22
+ ErrorView,
23
+ getBorderColor,
24
+ getSizeStyle,
25
+ RenderTrailing,
26
+ } from './common';
27
+ import { InputPhoneNumberProps } from './index';
28
+ import styles from './styles';
29
+ import SystemTextInput from './SystemTextInput';
30
+ import { checkTyping } from './utils';
31
+ import { Image } from '../Image';
32
+ import { Typography } from '../Text/types';
33
+
34
+ /**
35
+ * Input default component
36
+ */
37
+ const InputPhoneNumber = forwardRef(
38
+ (
39
+ {
40
+ value,
41
+ onChangeText,
42
+ size = 'small',
43
+ placeholder = '0123456789',
44
+ onBlur,
45
+ onFocus,
46
+ errorMessage,
47
+ trailing,
48
+ trailingColor,
49
+ onPressTrailing,
50
+ disabled = false,
51
+ errorSpacing,
52
+ loading = false,
53
+ secureTextEntry,
54
+ keyboardType,
55
+ style,
56
+ params,
57
+ hintText,
58
+ editable = true,
59
+ showClearIcon = true,
60
+ ...props
61
+ }: InputPhoneNumberProps,
62
+ ref,
63
+ ) => {
64
+ const { theme } = useContext(ApplicationContext);
65
+ const [focused, setFocused] = useState(false);
66
+ const [haveValue, setHaveValue] = useState(!!value || !!props.defaultValue);
67
+ const inputRef = useRef<TextInput | null>(null);
68
+ const componentName = 'InputPhoneNumber';
69
+
70
+ const { componentId } = useComponentId(
71
+ `${componentName}/${placeholder}`,
72
+ props.accessibilityLabel,
73
+ );
74
+
75
+ const onClearText = () => {
76
+ inputRef?.current?.clear();
77
+ _onChangeText('');
78
+ };
79
+
80
+ const _onChangeText = (text: string) => {
81
+ checkTyping(text, haveValue, setHaveValue);
82
+ onChangeText?.(text);
83
+ };
84
+
85
+ const _onFocus = (e: NativeSyntheticEvent<TextInputFocusEventData>) => {
86
+ setFocused(true);
87
+ onFocus?.(e);
88
+ };
89
+
90
+ const _onBlur = (e: NativeSyntheticEvent<TextInputFocusEventData>) => {
91
+ setFocused(false);
92
+ onBlur?.(e);
93
+ };
94
+
95
+ const _setText = (text: string) => {
96
+ inputRef?.current?.setNativeProps({ text });
97
+ _onChangeText(text);
98
+ };
99
+
100
+ useImperativeHandle(ref, () => {
101
+ return {
102
+ clear: onClearText,
103
+ focus: () => inputRef.current?.focus(),
104
+ blur: () => inputRef.current?.blur(),
105
+ setText: _setText,
106
+ };
107
+ });
108
+
109
+ let inputTextStyles = {};
110
+ let dividerHeight = 24;
111
+ let typography: Typography;
112
+ if (size === 'small') {
113
+ inputTextStyles = { fontSize: scaleSize(14), fontWeight: '600' };
114
+ dividerHeight = 24;
115
+ typography = 'header_s_semibold';
116
+ } else {
117
+ inputTextStyles = { fontSize: scaleSize(18), fontWeight: '700' };
118
+ dividerHeight = 32;
119
+ typography = 'header_m_bold';
120
+ }
121
+
122
+ /**
123
+ * Render input view
124
+ */
125
+ const renderInputView = () => {
126
+ const disabledColor = theme.colors.text.disable;
127
+ const secure = secureTextEntry;
128
+ let textColor = theme.colors.text.default;
129
+ let placeholderColor = theme.colors.text.hint;
130
+ let iconTintColor = trailingColor ?? theme.colors.text.default;
131
+ const borderWidth = focused ? 1.5 : 1;
132
+
133
+ if (disabled) {
134
+ textColor = disabledColor;
135
+ placeholderColor = disabledColor;
136
+ iconTintColor = disabledColor;
137
+ }
138
+
139
+ return (
140
+ <View
141
+ style={[
142
+ styles.inputWrapper,
143
+ { backgroundColor: theme.colors.background.surface },
144
+ getSizeStyle(size),
145
+ { borderWidth },
146
+ getBorderColor(theme, focused, errorMessage, disabled),
147
+ ]}
148
+ >
149
+ <View style={styles.inputView}>
150
+ <View style={[styles.leadingIconContainer, Styles.row]}>
151
+ <Image
152
+ source={{
153
+ uri: 'https://static.momocdn.net/app/img/icon/ic-qrcode-package/ic_vn_flag.png',
154
+ }}
155
+ style={innerStyle.iconFlag}
156
+ resizeMode="contain"
157
+ accessibilityLabel={`${componentId}|leading-icon`}
158
+ />
159
+ <View style={{ width: Spacing.XS }} />
160
+ <Text typography={typography} color={textColor}>
161
+ {'+84'}
162
+ </Text>
163
+ <View
164
+ style={[
165
+ styles.phoneNumberDivider,
166
+ {
167
+ height: dividerHeight,
168
+ backgroundColor: Colors.black_04,
169
+ },
170
+ ]}
171
+ />
172
+ </View>
173
+ <SystemTextInput
174
+ {...props}
175
+ accessibilityLabel={`${componentId}`}
176
+ editable={editable && !disabled}
177
+ secureTextEntry={secure}
178
+ textAlignVertical="center"
179
+ ref={inputRef}
180
+ accessibilityState={{
181
+ disabled,
182
+ ...props.accessibilityState,
183
+ }}
184
+ style={[
185
+ styles.input,
186
+ {
187
+ color: textColor,
188
+ },
189
+ inputTextStyles,
190
+ secure && haveValue && { fontSize: size === 'small' ? 18 : 22 },
191
+ ]}
192
+ allowFontScaling={false}
193
+ textBreakStrategy="highQuality"
194
+ value={value}
195
+ onChangeText={_onChangeText}
196
+ onFocus={_onFocus}
197
+ onBlur={_onBlur}
198
+ placeholder={placeholder}
199
+ selectionColor={theme.colors.primary}
200
+ placeholderTextColor={placeholderColor}
201
+ keyboardType={keyboardType ?? 'number-pad'}
202
+ />
203
+ </View>
204
+ <View style={styles.iconView}>
205
+ {showClearIcon && focused && haveValue && (
206
+ <TouchableOpacity
207
+ accessibilityLabel={`${componentId}|clear-icon-touch`}
208
+ accessible={false}
209
+ style={styles.iconWrapper}
210
+ onPress={onClearText}
211
+ >
212
+ <Icon
213
+ source="24_navigation_close_circle_full"
214
+ size={16}
215
+ color={theme.colors.text.hint}
216
+ accessibilityLabel={`${componentId}|clear-icon`}
217
+ />
218
+ </TouchableOpacity>
219
+ )}
220
+ <RenderTrailing
221
+ color={iconTintColor}
222
+ icon={trailing}
223
+ onPressIcon={onPressTrailing}
224
+ loading={loading}
225
+ componentId={componentId}
226
+ />
227
+ </View>
228
+ </View>
229
+ );
230
+ };
231
+
232
+ let inputState = 'active';
233
+ if (value && value?.length > 0) {
234
+ inputState = 'filled';
235
+ }
236
+ if (errorMessage && errorMessage?.length > 0) {
237
+ inputState = 'error';
238
+ }
239
+
240
+ return (
241
+ <ComponentContext.Provider
242
+ value={{
243
+ componentName,
244
+ componentId,
245
+ params,
246
+ state: inputState,
247
+ }}
248
+ >
249
+ <View style={[style, styles.wrapper]}>
250
+ {renderInputView()}
251
+ <ErrorView
252
+ errorMessage={errorMessage}
253
+ errorSpacing={errorSpacing}
254
+ hintText={hintText}
255
+ componentId={componentId}
256
+ />
257
+ </View>
258
+ </ComponentContext.Provider>
259
+ );
260
+ },
261
+ );
262
+
263
+ const innerStyle = StyleSheet.create({
264
+ iconFlag: {
265
+ width: 24,
266
+ height: 24,
267
+ marginHorizontal: 2,
268
+ },
269
+ });
270
+
271
+ export default InputPhoneNumber;
@@ -16,11 +16,8 @@ import {
16
16
  TouchableOpacity,
17
17
  View,
18
18
  } from 'react-native';
19
- import {
20
- ApplicationContext,
21
- ComponentContext,
22
- useComponentId,
23
- } from '../Application';
19
+ import { useComponentId } from '../Application';
20
+ import { ApplicationContext, ComponentContext } from '../Context';
24
21
  import { Icon } from '../Icon';
25
22
  import { Text } from '../Text';
26
23
  import { InputRef, InputSearchProps } from './index';
@@ -166,6 +163,7 @@ const InputSearch: ForwardRefRenderFunction<InputRef, InputSearchProps> = (
166
163
 
167
164
  const onClearText = () => {
168
165
  inputRef?.current?.clear();
166
+ inputRef.current?.setNativeProps({ text: '' });
169
167
  _onChangeText('');
170
168
  };
171
169
 
@@ -13,7 +13,7 @@ import {
13
13
  TouchableOpacity,
14
14
  View,
15
15
  } from 'react-native';
16
- import { ApplicationContext } from '../Application';
16
+ import { ApplicationContext } from '../Context';
17
17
  import { Icon } from '../Icon';
18
18
  import { Text } from '../Text';
19
19
  import {
@@ -62,6 +62,7 @@ const InputTextArea = forwardRef(
62
62
 
63
63
  const onClearText = () => {
64
64
  inputRef?.current?.clear();
65
+ inputRef.current?.setNativeProps({ text: '' });
65
66
  _onChangeText('');
66
67
  };
67
68
 
@@ -3,6 +3,7 @@ import React, { FC, memo, useEffect, useRef } from 'react';
3
3
  import { Platform, StyleSheet, TextInput, TextStyle } from 'react-native';
4
4
  import { Colors } from '../Consts';
5
5
  import { scaleSize } from '../Text';
6
+ import { useScaleSize } from '../Text/utils.ts';
6
7
 
7
8
  export interface TextTypingProps {
8
9
  data: string[];
@@ -90,7 +91,13 @@ const TextTyping: FC<TextTypingProps> = ({
90
91
 
91
92
  return (
92
93
  <TextInput
93
- style={[styles.inputStyle, inputStyle]}
94
+ style={[
95
+ styles.inputStyle,
96
+ inputStyle,
97
+ {
98
+ fontSize: useScaleSize(12),
99
+ },
100
+ ]}
94
101
  ref={textRef}
95
102
  editable={false}
96
103
  autoCorrect={false}
@@ -106,7 +113,6 @@ export default memo(TextTyping);
106
113
  const styles = StyleSheet.create({
107
114
  inputStyle: {
108
115
  color: Colors.black_12,
109
- fontSize: scaleSize(12),
110
116
  height: Platform.select({
111
117
  android: 60,
112
118
  ios: 36,
package/Input/common.tsx CHANGED
@@ -1,17 +1,17 @@
1
- import React, {FC, ReactNode, useContext} from 'react';
1
+ import React, { FC, ReactNode, useContext } from 'react';
2
2
  import {
3
3
  GestureResponderEvent,
4
4
  TouchableOpacity,
5
5
  View,
6
6
  ViewStyle,
7
7
  } from 'react-native';
8
- import {ApplicationContext} from '../Application';
9
- import {Theme} from '../Application/types';
10
- import {Styles} from '../Consts';
11
- import {Icon} from '../Icon';
12
- import {scaleSize, Text} from '../Text';
8
+ import { ApplicationContext } from '../Context';
9
+ import { Theme } from '../Application/types';
10
+ import { Styles } from '../Consts';
11
+ import { Icon } from '../Icon';
12
+ import { scaleSize, Text } from '../Text';
13
13
  import styles from './styles';
14
- import {Loader} from '../Loader';
14
+ import { Loader } from '../Loader';
15
15
  import IconSources from '../Assets/icon.json';
16
16
 
17
17
  type FloatingViewProps = {
@@ -40,7 +40,7 @@ export const getBorderColor = (
40
40
  theme: Theme,
41
41
  focused: boolean,
42
42
  errorMessage?: string,
43
- disabled?: boolean
43
+ disabled?: boolean,
44
44
  ) => {
45
45
  let borderColor = theme.colors.border.default;
46
46
 
@@ -56,12 +56,12 @@ export const getBorderColor = (
56
56
  borderColor = theme.colors.border.disable;
57
57
  }
58
58
 
59
- return {borderColor};
59
+ return { borderColor };
60
60
  };
61
61
 
62
62
  export const getSizeStyle = (
63
63
  size?: 'small' | 'large',
64
- multiline: boolean = false
64
+ multiline: boolean = false,
65
65
  ) => {
66
66
  if (multiline)
67
67
  return [
@@ -81,8 +81,8 @@ export const ErrorView: FC<{
81
81
  errorSpacing?: boolean;
82
82
  hintText?: string;
83
83
  componentId?: string;
84
- }> = ({errorMessage, errorSpacing, hintText, componentId}) => {
85
- const {theme} = useContext(ApplicationContext);
84
+ }> = ({ errorMessage, errorSpacing, hintText, componentId }) => {
85
+ const { theme } = useContext(ApplicationContext);
86
86
  const errorColor = theme.colors.error.primary;
87
87
  const hintColor = theme.colors.text.hint;
88
88
  const hintTextDefault = hintText ?? 'Không thể chỉnh sửa';
@@ -102,14 +102,15 @@ export const ErrorView: FC<{
102
102
  }-text`}
103
103
  style={Styles.flex}
104
104
  color={errorMessage ? errorColor : hintColor}
105
- typography={'description_default_regular'}>
105
+ typography={'description_default_regular'}
106
+ >
106
107
  {errorMessage ?? hintTextDefault}
107
108
  </Text>
108
109
  </View>
109
110
  );
110
111
  }
111
112
  if (errorSpacing) {
112
- return <View style={[styles.errorView, {height: 18}]} />;
113
+ return <View style={[styles.errorView, { height: 18 }]} />;
113
114
  }
114
115
  return <View />;
115
116
  };
@@ -124,7 +125,7 @@ export const FloatingView: FC<FloatingViewProps> = ({
124
125
  onPress,
125
126
  componentId,
126
127
  }) => {
127
- const {theme} = useContext(ApplicationContext);
128
+ const { theme } = useContext(ApplicationContext);
128
129
 
129
130
  if (floatingValue) {
130
131
  let floatingTextColor = theme.colors.text.hint;
@@ -143,16 +144,19 @@ export const FloatingView: FC<FloatingViewProps> = ({
143
144
  zIndex: 10,
144
145
  },
145
146
  style,
146
- ]}>
147
+ ]}
148
+ >
147
149
  <Text
148
150
  color={floatingTextColor}
149
151
  typography={'label_s_medium'}
150
- accessibilityLabel={`${componentId}|floating-text`}>
152
+ accessibilityLabel={`${componentId}|floating-text`}
153
+ >
151
154
  {floatingValue}
152
155
  {required && (
153
156
  <Text
154
157
  typography={'label_s_medium'}
155
- color={theme.colors.error.primary}>
158
+ color={theme.colors.error.primary}
159
+ >
156
160
  *
157
161
  </Text>
158
162
  )}
@@ -161,7 +165,8 @@ export const FloatingView: FC<FloatingViewProps> = ({
161
165
  <TouchableOpacity
162
166
  activeOpacity={onPress ? 0.6 : 1}
163
167
  onPress={onPress}
164
- accessibilityLabel={`${componentId}|floating-icon-touch`}>
168
+ accessibilityLabel={`${componentId}|floating-icon-touch`}
169
+ >
165
170
  <Icon
166
171
  color={floatingIconTintColor}
167
172
  source={floatingIcon}
@@ -184,7 +189,7 @@ export const RenderTrailing: FC<TrailingProps> = ({
184
189
  onPressIcon,
185
190
  componentId,
186
191
  }) => {
187
- const {theme} = useContext(ApplicationContext);
192
+ const { theme } = useContext(ApplicationContext);
188
193
  if (loading) {
189
194
  return <Loader type={'spinner'} color={color} style={styles.icon} />;
190
195
  }
@@ -197,7 +202,8 @@ export const RenderTrailing: FC<TrailingProps> = ({
197
202
  <TouchableOpacity
198
203
  accessibilityLabel={`${componentId}|trailing-touch`}
199
204
  onPress={onPressIcon}
200
- style={styles.icon}>
205
+ style={styles.icon}
206
+ >
201
207
  {icon}
202
208
  </TouchableOpacity>
203
209
  );
@@ -210,7 +216,7 @@ export const RenderTrailing: FC<TrailingProps> = ({
210
216
  source={icon as string}
211
217
  size={24}
212
218
  accessibilityLabel={`${componentId}|trailing-icon`}
213
- />
219
+ />,
214
220
  );
215
221
  }
216
222
  return renderIconTouchable(
@@ -218,9 +224,10 @@ export const RenderTrailing: FC<TrailingProps> = ({
218
224
  typography="action_xs_bold"
219
225
  color={color ?? theme.colors.primary}
220
226
  numberOfLines={1}
221
- accessibilityLabel={`${componentId}|trailing-text`}>
227
+ accessibilityLabel={`${componentId}|trailing-text`}
228
+ >
222
229
  {icon!.substring(0, 15)}
223
- </Text>
230
+ </Text>,
224
231
  );
225
232
  }
226
233
  return null;