@bigbinary/neetoui-rn 0.0.223 → 0.0.225

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 (92) hide show
  1. package/lib/components/Accordion.js +1 -1
  2. package/lib/components/Alert.js +1 -1
  3. package/lib/components/AnimatedImage.js +1 -1
  4. package/lib/components/Avatar.js +1 -1
  5. package/lib/components/Badge.js +1 -1
  6. package/lib/components/BottomSheet.js +1 -1
  7. package/lib/components/BottomTabBar.js +1 -1
  8. package/lib/components/Button.js +1 -1
  9. package/lib/components/ButtonGroup.js +1 -1
  10. package/lib/components/Calendar.js +1 -1
  11. package/lib/components/Card.js +1 -1
  12. package/lib/components/Carousel.js +1 -1
  13. package/lib/components/CheckBox.js +1 -1
  14. package/lib/components/Chip.js +1 -1
  15. package/lib/components/Container.js +1 -1
  16. package/lib/components/Divider.js +1 -1
  17. package/lib/components/FAB.js +1 -1
  18. package/lib/components/FlashList.js +1 -1
  19. package/lib/components/FlatList.js +1 -1
  20. package/lib/components/Input.js +1 -1
  21. package/lib/components/ListItem.js +1 -1
  22. package/lib/components/Loader.js +1 -1
  23. package/lib/components/MultiSelect.js +1 -1
  24. package/lib/components/NotificationPreferenceList.js +1 -1
  25. package/lib/components/OnBoarding.js +1 -1
  26. package/lib/components/OrganizationItem.js +1 -1
  27. package/lib/components/OtpInputs.js +1 -1
  28. package/lib/components/ParentView.js +1 -1
  29. package/lib/components/Popover.js +1 -1
  30. package/lib/components/RadioButton.js +1 -1
  31. package/lib/components/RichTextEditor.js +1 -1
  32. package/lib/components/ScrollView.js +1 -1
  33. package/lib/components/SearchBar.js +1 -1
  34. package/lib/components/SegmentedTopBar.js +1 -1
  35. package/lib/components/Select.js +1 -1
  36. package/lib/components/SocialButton.js +1 -1
  37. package/lib/components/Toast.js +1 -1
  38. package/lib/components/ToggleSwitch.js +1 -1
  39. package/lib/components/TopBar.js +1 -1
  40. package/lib/components/Touchable.js +1 -1
  41. package/lib/components/Typography.js +1 -1
  42. package/lib/config/toasterConfig.js +1 -1
  43. package/lib/index.js +1 -1
  44. package/package.json +10 -7
  45. package/src/components/{Accordion.js → Accordion.jsx} +11 -12
  46. package/src/components/{Alert.js → Alert.jsx} +30 -29
  47. package/src/components/{AnimatedImage.js → AnimatedImage.jsx} +52 -55
  48. package/src/components/{Avatar.js → Avatar.jsx} +36 -39
  49. package/src/components/{Badge.js → Badge.jsx} +19 -20
  50. package/src/components/{BottomSheet.js → BottomSheet.jsx} +81 -87
  51. package/src/components/{BottomTabBar.js → BottomTabBar.jsx} +71 -77
  52. package/src/components/{Button.js → Button.jsx} +18 -15
  53. package/src/components/{ButtonGroup.js → ButtonGroup.jsx} +35 -38
  54. package/src/components/{Calendar.js → Calendar.jsx} +3 -2
  55. package/src/components/{Card.js → Card.jsx} +5 -2
  56. package/src/components/{Carousel.js → Carousel.jsx} +6 -6
  57. package/src/components/{CheckBox.js → CheckBox.jsx} +12 -8
  58. package/src/components/{Chip.js → Chip.jsx} +30 -31
  59. package/src/components/{Container.js → Container.jsx} +6 -5
  60. package/src/components/{Divider.js → Divider.jsx} +3 -2
  61. package/src/components/{FAB.js → FAB.jsx} +3 -2
  62. package/src/components/{FlashList.js → FlashList.jsx} +54 -53
  63. package/src/components/FlatList.js +1 -1
  64. package/src/components/{Input.js → Input.jsx} +43 -43
  65. package/src/components/{ListItem.js → ListItem.jsx} +24 -25
  66. package/src/components/{Loader.js → Loader.jsx} +11 -9
  67. package/src/components/{MultiSelect.js → MultiSelect.jsx} +62 -68
  68. package/src/components/{NotificationPreferenceList.js → NotificationPreferenceList.jsx} +43 -43
  69. package/src/components/{OnBoarding.js → OnBoarding.jsx} +24 -27
  70. package/src/components/OrganizationItem.jsx +107 -0
  71. package/src/components/{OtpInputs.js → OtpInputs.jsx} +35 -34
  72. package/src/components/{ParentView.js → ParentView.jsx} +5 -3
  73. package/src/components/{Popover.js → Popover.jsx} +21 -22
  74. package/src/components/{RadioButton.js → RadioButton.jsx} +10 -6
  75. package/src/components/{RichTextEditor.js → RichTextEditor.jsx} +32 -34
  76. package/src/components/ScrollView.js +1 -1
  77. package/src/components/{SearchBar.js → SearchBar.jsx} +22 -22
  78. package/src/components/{SegmentedTopBar.js → SegmentedTopBar.jsx} +15 -17
  79. package/src/components/{Select.js → Select.jsx} +33 -30
  80. package/src/components/{SocialButton.js → SocialButton.jsx} +9 -8
  81. package/src/components/{Toast.js → Toast.jsx} +25 -22
  82. package/src/components/{ToggleSwitch.js → ToggleSwitch.jsx} +12 -11
  83. package/src/components/{TopBar.js → TopBar.jsx} +4 -4
  84. package/src/components/{Touchable.js → Touchable.jsx} +9 -4
  85. package/src/components/{Typography.js → Typography.jsx} +6 -5
  86. package/src/config/{toasterConfig.js → toasterConfig.jsx} +23 -24
  87. package/src/hooks/useDebounce.js +1 -0
  88. package/src/hooks/useKeyboard.js +1 -0
  89. package/src/index.js +2 -2
  90. package/src/theme/index.js +1 -1
  91. package/src/utils/utils.js +2 -1
  92. package/src/components/OrganizationItem.js +0 -116
@@ -1,12 +1,13 @@
1
- /* eslint-disable react/prop-types */
2
- import PropTypes from "prop-types";
3
1
  import React, { useEffect } from "react";
4
2
  import { Dimensions, Platform, StyleSheet } from "react-native";
3
+
4
+ import PropTypes from "prop-types";
5
5
  import Animated, {
6
6
  useAnimatedStyle,
7
7
  useSharedValue,
8
8
  withSpring,
9
9
  } from "react-native-reanimated";
10
+
10
11
  import { Typography, Touchable } from "@components";
11
12
  import { theme } from "@theme";
12
13
 
@@ -88,17 +89,14 @@ export const SegmentedTopBar = ({
88
89
  const tabTranslateValue = useSharedValue(0);
89
90
  useEffect(() => {
90
91
  tabTranslateValue.value = withSpring(
91
- index * (translateValue * 1),
92
+ index * Number(translateValue),
92
93
  DEFAULT_SPRING_CONFIG
93
94
  );
94
- // eslint-disable-next-line react-hooks/exhaustive-deps
95
95
  }, [index]);
96
96
 
97
- const tabTranslateAnimatedStyles = useAnimatedStyle(() => {
98
- return {
99
- transform: [{ translateX: tabTranslateValue.value }],
100
- };
101
- });
97
+ const tabTranslateAnimatedStyles = useAnimatedStyle(() => ({
98
+ transform: [{ translateX: tabTranslateValue.value }],
99
+ }));
102
100
 
103
101
  return (
104
102
  <Animated.View
@@ -129,20 +127,20 @@ export const SegmentedTopBar = ({
129
127
 
130
128
  return (
131
129
  <Touchable
132
- onPress={() => navigation.navigate(route.name)}
133
- key={i}
130
+ alignItems="center"
131
+ elevation={Platform.OS === "android" ? 9 : null}
134
132
  flex={1}
135
133
  height={height}
136
- alignItems="center"
137
134
  justifyContent="center"
138
- elevation={Platform.OS === "android" ? 9 : null}
135
+ key={i}
136
+ onPress={() => navigation.navigate(route.name)}
139
137
  {...currentIndexTextStyle}
140
138
  >
141
139
  <Typography
142
- fontSize="xs"
143
- textAlign="center"
144
140
  color="font.grey800"
145
141
  fontFamily="sf500"
142
+ fontSize="xs"
143
+ textAlign="center"
146
144
  >
147
145
  {label}
148
146
  </Typography>
@@ -159,7 +157,7 @@ const styles = StyleSheet.create({
159
157
  flexDirection: "row",
160
158
  alignItems: "center",
161
159
  borderRadius: 8,
162
- width: width,
160
+ width,
163
161
  },
164
162
  defaultSegmentedControlWrapper: {
165
163
  position: "relative",
@@ -168,7 +166,7 @@ const styles = StyleSheet.create({
168
166
  alignItems: "center",
169
167
  borderRadius: 8,
170
168
  backgroundColor: "#F6F6FA",
171
- width: width,
169
+ width,
172
170
  marginBottom: 5,
173
171
  },
174
172
  movingSegmentStyle: {
@@ -1,6 +1,8 @@
1
1
  import React, { useState, useContext, useEffect } from "react";
2
- import Icon from "react-native-remix-icon";
2
+ import { TouchableWithoutFeedback, Keyboard } from "react-native";
3
+
3
4
  import PropTypes from "prop-types";
5
+ import { ScrollView } from "react-native-gesture-handler";
4
6
  import Animated, {
5
7
  useSharedValue,
6
8
  useAnimatedStyle,
@@ -8,9 +10,8 @@ import Animated, {
8
10
  Easing,
9
11
  runOnJS,
10
12
  } from "react-native-reanimated";
11
- import { TouchableWithoutFeedback, Keyboard } from "react-native";
13
+ import Icon from "react-native-remix-icon";
12
14
  import { ThemeContext } from "styled-components/native";
13
- import { ScrollView } from "react-native-gesture-handler";
14
15
 
15
16
  import {
16
17
  Card,
@@ -40,9 +41,9 @@ const DropdownItem = ({
40
41
  {...(isSelectedItem && selectedItemContainerStyle)}
41
42
  >
42
43
  <Typography
44
+ color={isSelectedItem ? "font.white" : "font.grey"}
43
45
  fontFamily="sf400"
44
46
  fontSize="s"
45
- color={isSelectedItem ? "font.white" : "font.grey"}
46
47
  {...itemLabelStyle}
47
48
  {...(isSelectedItem && selectedItemLabelStyle)}
48
49
  >
@@ -146,6 +147,7 @@ export const Select = ({
146
147
  const filteredOptions = options.filter((item, index) => {
147
148
  const label = labelExtractor(item, index);
148
149
  if (searchQuery?.length === 0) return true;
150
+
149
151
  return formatStr(label).includes(formatStr(searchQuery));
150
152
  });
151
153
 
@@ -170,8 +172,8 @@ export const Select = ({
170
172
  const selectedOptionLabel = labelExtractor(value || {});
171
173
  const selectedOptionValue = valueExtractor(value || {});
172
174
 
173
- const animatedStyles = useAnimatedStyle(() => {
174
- return {
175
+ const animatedStyles = useAnimatedStyle(
176
+ () => ({
175
177
  height: withTiming(
176
178
  dropdownAnimatedHeight.value,
177
179
  {
@@ -184,8 +186,9 @@ export const Select = ({
184
186
  }
185
187
  }
186
188
  ),
187
- };
188
- }, []);
189
+ }),
190
+ []
191
+ );
189
192
 
190
193
  const toggleAnimation = () => {
191
194
  dropdownAnimatedHeight.value =
@@ -198,6 +201,7 @@ export const Select = ({
198
201
  if (!showDropdown) {
199
202
  setShowDropdown(true);
200
203
  }
204
+
201
205
  if (showDropdown) {
202
206
  toggleAnimation();
203
207
  }
@@ -212,16 +216,15 @@ export const Select = ({
212
216
  if (showDropdown) {
213
217
  dropdownAnimatedHeight.value = dropdownHeight;
214
218
  }
215
- // eslint-disable-next-line react-hooks/exhaustive-deps
216
219
  }, [showDropdown, dropdownHeight]);
217
220
 
218
221
  return (
219
222
  <Container {...containerStyle}>
220
223
  <Typography
224
+ color="font.base"
221
225
  fontFamily="sf400"
222
- mb={1}
223
226
  fontSize="s"
224
- color="font.base"
227
+ mb={1}
225
228
  {...labelStyle}
226
229
  >
227
230
  {label}
@@ -231,25 +234,25 @@ export const Select = ({
231
234
  onPress={handleOpenDropdown}
232
235
  >
233
236
  <Container
234
- borderWidth={1}
237
+ alignItems="center"
235
238
  borderColor="border.grey400"
236
- p={2}
239
+ borderWidth={1}
237
240
  flexDirection="row"
238
241
  justifyContent="space-between"
239
- alignItems="center"
242
+ p={2}
240
243
  {...inputContainerStyle}
241
244
  {...rest}
242
245
  >
243
- <Typography fontFamily="sf400" fontSize="s" color="font.grey">
246
+ <Typography color="font.grey" fontFamily="sf400" fontSize="s">
244
247
  {selectedOptionLabel || placeholder}
245
248
  </Typography>
246
249
  {isLoading ? (
247
250
  <Loader color={theme.colors.background.base} />
248
251
  ) : (
249
252
  <Icon
253
+ color="grey"
250
254
  name={`arrow-${showDropdown ? "up" : "down"}-s-line`}
251
255
  size="20"
252
- color="grey"
253
256
  />
254
257
  )}
255
258
  </Container>
@@ -259,37 +262,36 @@ export const Select = ({
259
262
  <Animated.View style={animatedStyles}>
260
263
  <Card
261
264
  bg="background.white"
262
- borderWidth={1}
263
265
  borderColor="border.grey400"
266
+ borderWidth={1}
264
267
  maxHeight={dropdownHeight}
265
268
  {...dropdownContainerStyle}
266
269
  >
267
270
  {isSearchable && (
268
271
  <Container p={1} {...searchInputContainerStyle}>
269
272
  <Input
270
- placeholder="Search"
271
- onChangeText={setSearchQuery}
272
273
  fontSize="s"
273
- // eslint-disable-next-line react-native/no-inline-styles
274
+ placeholder="Search"
274
275
  containerStyles={{
275
276
  height: searchInputHeight,
276
277
  justifyContent: "center",
277
278
  }}
279
+ onChangeText={setSearchQuery}
278
280
  {...searchInputStyle}
279
281
  />
280
282
  </Container>
281
283
  )}
282
284
  {isOptionsEmpty && !(isSearchedOptionsEmpty && showCreateOption) && (
283
285
  <Container
286
+ alignItems="center"
284
287
  height={emptyOptionsPlaceholderHeight}
285
288
  justifyContent="center"
286
- alignItems="center"
287
289
  {...emptyOptionsContainerStyle}
288
290
  >
289
291
  <Typography
292
+ color="font.grey"
290
293
  fontFamily="sf400"
291
294
  fontSize="s"
292
- color="font.grey"
293
295
  {...emptyOptionsLabelStyle}
294
296
  >
295
297
  {emptyOptionsPlaceholder || "No Options"}
@@ -298,19 +300,19 @@ export const Select = ({
298
300
  )}
299
301
  {isSearchedOptionsEmpty && showCreateOption && (
300
302
  <Touchable
303
+ alignItems="center"
301
304
  height={emptySearchedOptionsHeight}
302
305
  justifyContent="center"
303
- alignItems="center"
304
306
  onPress={() => onPressCreateOption(searchQuery)}
305
307
  {...createSearchedOptionContainerStyle}
306
308
  >
307
309
  {showCreateOptionLoader ? (
308
- <Loader size="s" color={theme.colors.background.base} />
310
+ <Loader color={theme.colors.background.base} size="s" />
309
311
  ) : (
310
312
  <Typography
313
+ color="font.grey"
311
314
  fontFamily="sf400"
312
315
  fontSize="s"
313
- color="font.grey"
314
316
  {...createSearchedOptionLabelStyle}
315
317
  >
316
318
  {createOptionLabel || `Create ${searchQuery} option`}
@@ -328,17 +330,18 @@ export const Select = ({
328
330
  const optionValue = valueExtractor(item, index);
329
331
  const isSelectedItem =
330
332
  selectedOptionValue && selectedOptionValue === optionValue;
333
+
331
334
  return (
332
335
  <DropdownItem
333
- key={index}
334
- label={optionLabel}
335
- isSelectedItem={isSelectedItem}
336
336
  defaultDropdownItemHeight={defaultDropdownItemHeight}
337
- onPress={() => handleItemSelection(item, index)}
337
+ isSelectedItem={isSelectedItem}
338
338
  itemContainerStyle={itemContainerStyle}
339
- selectedItemContainerStyle={selectedItemContainerStyle}
340
339
  itemLabelStyle={itemLabelStyle}
340
+ key={index}
341
+ label={optionLabel}
342
+ selectedItemContainerStyle={selectedItemContainerStyle}
341
343
  selectedItemLabelStyle={selectedItemLabelStyle}
344
+ onPress={() => handleItemSelection(item, index)}
342
345
  />
343
346
  );
344
347
  })}
@@ -1,4 +1,5 @@
1
1
  import React, { useContext } from "react";
2
+
2
3
  import propTypes from "@styled-system/prop-types";
3
4
  import PropTypes from "prop-types";
4
5
  import { ThemeContext } from "styled-components/native";
@@ -44,30 +45,30 @@ export const SocialButton = ({
44
45
 
45
46
  return (
46
47
  <Touchable
47
- rippleColor={theme.colors.background.grey800}
48
- disabled={disabled}
48
+ alignItems="center"
49
49
  bg="transparent"
50
- height={48}
51
- width="100%"
50
+ borderColor={theme.colors.border.grey800}
52
51
  borderRadius={8}
53
52
  borderWidth={1}
54
- borderColor={theme.colors.border.grey800}
55
- alignItems="center"
53
+ disabled={disabled}
54
+ height={48}
56
55
  justifyContent="center"
56
+ rippleColor={theme.colors.background.grey800}
57
+ width="100%"
57
58
  {...rest}
58
59
  >
59
60
  {isLoading ? (
60
61
  <Loader color={theme.colors.background.grey800} />
61
62
  ) : (
62
63
  <>
63
- <Container position="absolute" left={17}>
64
+ <Container left={17} position="absolute">
64
65
  {variant === "apple" && <AppleLogo />}
65
66
  {variant === "google" && <GoogleLogo />}
66
67
  </Container>
67
68
  <Typography
68
69
  color={theme.colors.font.primary}
69
- fontSize="m"
70
70
  fontFamily={theme.fonts.sf500}
71
+ fontSize="m"
71
72
  {...labelStyle}
72
73
  >
73
74
  Continue with {capitalize(variant)}
@@ -1,18 +1,19 @@
1
1
  import * as React from "react";
2
- import PropTypes from "prop-types";
3
- import T from "react-native-toast-message";
4
- import { defaultToasterConfig } from "@config";
5
2
  import { useContext } from "react";
6
- import { ThemeContext } from "styled-components/native";
7
3
  import { useWindowDimensions } from "react-native";
8
- import CloseIcon from "react-native-remix-icon";
4
+
5
+ import PropTypes from "prop-types";
9
6
  import DeviceInfo from "react-native-device-info";
7
+ import CloseIcon from "react-native-remix-icon";
8
+ import T from "react-native-toast-message";
9
+ import { ThemeContext } from "styled-components/native";
10
10
 
11
+ import ErrorIcon from "@assets/icons/error.svg";
12
+ import InfoIcon from "@assets/icons/info.svg";
11
13
  import SuccessIcon from "@assets/icons/success.svg";
12
14
  import WarningIcon from "@assets/icons/warning.svg";
13
- import InfoIcon from "@assets/icons/info.svg";
14
- import ErrorIcon from "@assets/icons/error.svg";
15
15
  import { Container, Typography, Touchable } from "@components";
16
+ import { defaultToasterConfig } from "@config";
16
17
 
17
18
  const ToastComponent = ({ type, text1, text2, hide }) => {
18
19
  const theme = useContext(ThemeContext);
@@ -28,60 +29,62 @@ const ToastComponent = ({ type, text1, text2, hide }) => {
28
29
  case "error":
29
30
  return <ErrorIcon />;
30
31
  }
32
+
33
+ return null;
31
34
  };
35
+
32
36
  return (
33
37
  <Container
34
- width={width - 20}
35
- minHeight={60}
36
- borderRadius={16}
38
+ alignItems="center"
37
39
  bg={theme.colors.background.secondary}
40
+ borderRadius={16}
38
41
  flexDirection="row"
39
- alignItems="center"
40
- px={10}
41
- mx={10}
42
+ minHeight={60}
42
43
  mt={DeviceInfo.hasDynamicIsland() ? 10 : 0}
44
+ mx={10}
45
+ px={10}
46
+ width={width - 20}
43
47
  >
44
48
  <Container
45
- height={42}
46
- width={42}
47
- borderRadius={10}
48
- bg={theme.colors.toast[type]}
49
49
  alignItems="center"
50
+ bg={theme.colors.toast[type]}
51
+ borderRadius={10}
52
+ height={42}
50
53
  justifyContent="center"
54
+ width={42}
51
55
  >
52
56
  <Icon />
53
57
  </Container>
54
-
55
58
  <Container flex={1} ml={10} py={3}>
56
59
  {text1 && (
57
60
  <Typography
61
+ fontColor={theme.colors.font.primary}
58
62
  fontFamily={theme.fonts.sf600}
59
63
  fontSize="l"
60
- fontColor={theme.colors.font.primary}
61
64
  >
62
65
  {text1}
63
66
  </Typography>
64
67
  )}
65
68
  {text2 && (
66
69
  <Typography
70
+ fontColor={theme.colors.font.secondary}
67
71
  fontFamily={theme.fonts.sf400}
68
72
  fontSize="xs"
69
- fontColor={theme.colors.font.secondary}
70
73
  >
71
74
  {text2}
72
75
  </Typography>
73
76
  )}
74
77
  </Container>
75
78
  <Touchable
76
- onPress={hide}
77
79
  hitSlop={{
78
80
  top: 5,
79
81
  right: 5,
80
82
  bottom: 5,
81
83
  left: 5,
82
84
  }}
85
+ onPress={hide}
83
86
  >
84
- <CloseIcon name="ri-close-line" color={theme.colors.font.grey500} />
87
+ <CloseIcon color={theme.colors.font.grey500} name="ri-close-line" />
85
88
  </Touchable>
86
89
  </Container>
87
90
  );
@@ -1,8 +1,9 @@
1
1
  import React, { useContext, useEffect, useRef } from "react";
2
- import { ThemeContext } from "styled-components/native";
3
2
  import { Animated } from "react-native";
3
+
4
4
  import PropTypes from "prop-types";
5
5
  import Icon from "react-native-remix-icon";
6
+ import { ThemeContext } from "styled-components/native";
6
7
 
7
8
  import { Container, Touchable } from "@components";
8
9
 
@@ -39,7 +40,6 @@ export const ToggleSwitch = ({ value, onValueChange, disabled }) => {
39
40
 
40
41
  useEffect(() => {
41
42
  startAnimation();
42
- // eslint-disable-next-line react-hooks/exhaustive-deps
43
43
  }, [value]);
44
44
 
45
45
  const startAnimation = () => {
@@ -53,35 +53,36 @@ export const ToggleSwitch = ({ value, onValueChange, disabled }) => {
53
53
  const containerBg = value
54
54
  ? theme.colors.background.purple500
55
55
  : "background.grey300";
56
+
56
57
  const iconColor = value
57
58
  ? theme.colors.background.purple500
58
59
  : theme.colors.font.grey500;
59
60
 
60
61
  return (
61
62
  <Touchable
63
+ bg={containerBg}
64
+ borderRadius={70}
62
65
  disabled={disabled}
63
- onPress={() => onValueChange(!value)}
64
- width={44}
65
66
  height={24}
66
- bg={containerBg}
67
67
  justifyContent="center"
68
- px={1}
69
- borderRadius={70}
70
68
  opacity={disabled ? 0.5 : 1}
69
+ px={1}
70
+ width={44}
71
+ onPress={() => onValueChange(!value)}
71
72
  >
72
73
  <Animated.View style={{ transform: [{ translateX: animatedPosition }] }}>
73
74
  <Container
75
+ alignItems="center"
74
76
  bg="background.white"
75
- width={16}
76
- height={16}
77
77
  borderRadius={8}
78
+ height={16}
78
79
  justifyContent="center"
79
- alignItems="center"
80
+ width={16}
80
81
  >
81
82
  <Icon
83
+ color={iconColor}
82
84
  name={`ri-${value ? "check" : "close"}-line`}
83
85
  size={12}
84
- color={iconColor}
85
86
  />
86
87
  </Container>
87
88
  </Animated.View>
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect, useState } from "react";
2
2
  import { ScrollView, StyleSheet } from "react-native";
3
+
3
4
  import PropTypes from "prop-types";
4
5
 
5
6
  import { Container, Touchable, Typography } from "@components";
@@ -58,7 +59,6 @@ export const TopBar = ({
58
59
 
59
60
  useEffect(() => {
60
61
  onActiveTabChange(selectedIndex);
61
- // eslint-disable-next-line react-hooks/exhaustive-deps
62
62
  }, [selectedIndex]);
63
63
 
64
64
  useEffect(() => {
@@ -73,8 +73,9 @@ export const TopBar = ({
73
73
  <ScrollView horizontal showsHorizontalScrollIndicator={false}>
74
74
  {data.map((item, index) => (
75
75
  <Touchable
76
+ alignItems="center"
77
+ justifyContent="center"
76
78
  key={index}
77
- onPress={() => setSelectedIndex(index)}
78
79
  style={
79
80
  selectedIndex === index
80
81
  ? {
@@ -86,8 +87,7 @@ export const TopBar = ({
86
87
  ...inActiveTabContainerStyle,
87
88
  }
88
89
  }
89
- justifyContent="center"
90
- alignItems="center"
90
+ onPress={() => setSelectedIndex(index)}
91
91
  >
92
92
  <Typography
93
93
  style={
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
- import PropTypes from "prop-types";
2
+
3
3
  import propTypes from "@styled-system/prop-types";
4
+ import PropTypes from "prop-types";
4
5
  import Ripple from "react-native-material-ripple";
5
6
  import styled from "styled-components/native";
6
7
  import {
@@ -11,6 +12,7 @@ import {
11
12
  color,
12
13
  layout,
13
14
  } from "styled-system";
15
+
14
16
  import { getShadowStyles } from "../utils/utils";
15
17
 
16
18
  const StyledRipple = styled(Ripple)`
@@ -61,13 +63,14 @@ const StyledRipple = styled(Ripple)`
61
63
  export const Touchable = React.forwardRef((props, ref) => {
62
64
  const { children, elevation, ...rest } = props;
63
65
  const shadowStyles = elevation ? getShadowStyles(elevation) : {};
66
+
64
67
  return (
65
68
  <StyledRipple
66
- rippleOpacity={0.09}
67
- rippleDuration={600}
69
+ ref={ref}
68
70
  rippleContainerBorderRadius={rest.borderRadius ? rest.borderRadius : 0}
71
+ rippleDuration={600}
72
+ rippleOpacity={0.09}
69
73
  style={shadowStyles}
70
- ref={ref}
71
74
  {...rest}
72
75
  >
73
76
  {children}
@@ -86,3 +89,5 @@ Touchable.propTypes = {
86
89
  children: PropTypes.node,
87
90
  elevation: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
88
91
  };
92
+
93
+ Touchable.displayName = "Touchable";
@@ -1,4 +1,7 @@
1
1
  import * as React from "react";
2
+
3
+ import propTypes from "@styled-system/prop-types";
4
+ import PropTypes from "prop-types";
2
5
  import styled from "styled-components/native";
3
6
  import {
4
7
  space,
@@ -10,8 +13,6 @@ import {
10
13
  position,
11
14
  system,
12
15
  } from "styled-system";
13
- import propTypes from "@styled-system/prop-types";
14
- import PropTypes from "prop-types";
15
16
 
16
17
  export const Text = styled.Text`
17
18
  ${textStyle}
@@ -73,9 +74,9 @@ export const Text = styled.Text`
73
74
  * @extends StyledSystems props /styled-system
74
75
  */
75
76
 
76
- export const Typography = ({ children, ...rest }) => {
77
- return <Text {...rest}>{children}</Text>;
78
- };
77
+ export const Typography = ({ children, ...rest }) => (
78
+ <Text {...rest}>{children}</Text>
79
+ );
79
80
 
80
81
  Typography.propTypes = {
81
82
  ...propTypes.space,