@bigbinary/neetoui-rn 0.0.230 → 0.0.232

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 (78) 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/Divider.js +1 -1
  16. package/lib/components/FAB.js +1 -1
  17. package/lib/components/FlashList.js +1 -1
  18. package/lib/components/Input.js +1 -1
  19. package/lib/components/ListItem.js +1 -1
  20. package/lib/components/Loader.js +1 -1
  21. package/lib/components/MultiSelect.js +1 -1
  22. package/lib/components/NotificationPreferenceList.js +1 -1
  23. package/lib/components/OnBoarding.js +1 -1
  24. package/lib/components/OrganizationItem.js +1 -1
  25. package/lib/components/OtpInputs.js +1 -1
  26. package/lib/components/ParentView.js +1 -1
  27. package/lib/components/Popover.js +1 -1
  28. package/lib/components/RadioButton.js +1 -1
  29. package/lib/components/RichTextEditor.js +1 -1
  30. package/lib/components/SearchBar.js +1 -1
  31. package/lib/components/SegmentedTopBar.js +1 -1
  32. package/lib/components/Select.js +1 -1
  33. package/lib/components/SocialButton.js +1 -1
  34. package/lib/components/Toast.js +1 -1
  35. package/lib/components/ToggleSwitch.js +1 -1
  36. package/lib/components/TopBar.js +1 -1
  37. package/lib/theme/index.js +1 -1
  38. package/lib/utils/utils.js +1 -1
  39. package/package.json +2 -1
  40. package/src/components/Accordion.jsx +9 -9
  41. package/src/components/Alert.jsx +20 -17
  42. package/src/components/AnimatedImage.jsx +11 -5
  43. package/src/components/Avatar.jsx +5 -4
  44. package/src/components/Badge.jsx +6 -5
  45. package/src/components/BottomSheet.jsx +18 -13
  46. package/src/components/BottomTabBar.jsx +63 -51
  47. package/src/components/Button.jsx +17 -16
  48. package/src/components/ButtonGroup.jsx +5 -4
  49. package/src/components/Calendar.jsx +6 -5
  50. package/src/components/Card.jsx +4 -3
  51. package/src/components/Carousel.jsx +17 -15
  52. package/src/components/CheckBox.jsx +11 -9
  53. package/src/components/Chip.jsx +6 -5
  54. package/src/components/Divider.jsx +3 -2
  55. package/src/components/FAB.jsx +5 -4
  56. package/src/components/FlashList.jsx +12 -5
  57. package/src/components/Input.jsx +23 -29
  58. package/src/components/ListItem.jsx +5 -4
  59. package/src/components/Loader.jsx +4 -3
  60. package/src/components/MultiSelect.jsx +33 -25
  61. package/src/components/NotificationPreferenceList.jsx +12 -7
  62. package/src/components/OnBoarding.jsx +28 -8
  63. package/src/components/OrganizationItem.jsx +4 -3
  64. package/src/components/OtpInputs.jsx +11 -6
  65. package/src/components/ParentView.jsx +4 -3
  66. package/src/components/Popover.jsx +10 -9
  67. package/src/components/RadioButton.jsx +11 -9
  68. package/src/components/RichTextEditor.jsx +2 -0
  69. package/src/components/SearchBar.jsx +8 -7
  70. package/src/components/SegmentedTopBar.jsx +12 -11
  71. package/src/components/Select.jsx +31 -27
  72. package/src/components/SocialButton.jsx +6 -5
  73. package/src/components/Toast.jsx +20 -17
  74. package/src/components/ToggleSwitch.jsx +13 -10
  75. package/src/components/TopBar.jsx +7 -6
  76. package/src/components/Touchable.jsx +1 -1
  77. package/src/theme/index.js +15 -12
  78. package/src/utils/utils.js +4 -0
@@ -1,5 +1,5 @@
1
1
  import React, { useContext, useEffect } from "react";
2
- import { StyleSheet, Platform, TouchableWithoutFeedback } from "react-native";
2
+ import { StyleSheet, TouchableWithoutFeedback } from "react-native";
3
3
 
4
4
  import PropTypes from "prop-types";
5
5
  import Animated, {
@@ -10,6 +10,8 @@ import Animated, {
10
10
  Extrapolation,
11
11
  } from "react-native-reanimated";
12
12
  import Icon from "react-native-remix-icon";
13
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
14
+ import { moderateScale } from "react-native-size-matters";
13
15
  import { ThemeContext } from "styled-components/native";
14
16
 
15
17
  import { Container, Typography } from "@components";
@@ -58,10 +60,15 @@ const TabElement = ({
58
60
  <Container
59
61
  alignItems="center"
60
62
  borderColor="background.grey200"
61
- borderTopWidth={1}
63
+ borderTopWidth={moderateScale(1)}
62
64
  flex={1}
63
65
  >
64
- <Container alignItems="center" height={35} mb={1} width={48}>
66
+ <Container
67
+ alignItems="center"
68
+ height={moderateScale(35)}
69
+ mb={moderateScale(4)}
70
+ width={moderateScale(48)}
71
+ >
65
72
  <Animated.View style={[styles.iconContainer, animatedStyles]}>
66
73
  <Icon color={theme.colors.font.grey500} name={icon} size={size} />
67
74
  </Animated.View>
@@ -84,7 +91,7 @@ const TabElement = ({
84
91
  const styles = StyleSheet.create({
85
92
  iconContainer: {
86
93
  position: "absolute",
87
- margin: 10,
94
+ margin: moderateScale(10),
88
95
  },
89
96
  });
90
97
 
@@ -103,6 +110,7 @@ const styles = StyleSheet.create({
103
110
  * import { NavigationContainer } from '@react-navigation/native';
104
111
  * import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
105
112
  * import { ThemeContext } from "styled-components/native";
113
+ * import { moderateScale } from "react-native-size-matters";
106
114
  *
107
115
  * const Tab = createBottomTabNavigator();
108
116
  *
@@ -132,7 +140,7 @@ const styles = StyleSheet.create({
132
140
  * options={{
133
141
  * customTabBarProps: {
134
142
  * icon: "home-5-line",
135
- * size: 26,
143
+ * size: moderateScale(26),
136
144
  * },
137
145
  * }}
138
146
  * />
@@ -140,7 +148,7 @@ const styles = StyleSheet.create({
140
148
  * options={{
141
149
  * customTabBarProps: {
142
150
  * icon: "user-3-line",
143
- * size: 26,
151
+ * size: moderateScale(26),
144
152
  * },
145
153
  * }} />
146
154
  * </Tab.Navigator>
@@ -150,51 +158,55 @@ const styles = StyleSheet.create({
150
158
  *
151
159
  */
152
160
 
153
- export const BottomTabBar = ({ state, descriptors, navigation }) => (
154
- <Container
155
- bg="background.white"
156
- flexDirection="row"
157
- height={Platform.OS === "android" ? 63 : 83}
158
- >
159
- {state.routes.map(({ key, name }, index) => {
160
- const { options } = descriptors[key];
161
- const isFocused = state.index === index;
162
- const { icon, size } = options?.customTabBarProps || {};
163
- const { tabBarActiveTintColor, tabBarInactiveTintColor } = options;
164
- const onPress = () => {
165
- const event = navigation.emit({
166
- type: "tabPress",
167
- target: key,
168
- canPreventDefault: true,
169
- });
170
-
171
- if (!isFocused && !event.defaultPrevented) {
172
- navigation.navigate({ name, merge: true });
173
- }
174
- };
175
-
176
- const label =
177
- options.tabBarLabel !== undefined
178
- ? options.tabBarLabel
179
- : options.title !== undefined
180
- ? options.title
181
- : name;
182
-
183
- return (
184
- <TabElement
185
- icon={icon}
186
- isFocused={isFocused}
187
- key={index}
188
- label={label}
189
- size={size}
190
- tabBarActiveTintColor={tabBarActiveTintColor}
191
- tabBarInactiveTintColor={tabBarInactiveTintColor}
192
- onPress={onPress}
193
- />
194
- );
195
- })}
196
- </Container>
197
- );
161
+ export const BottomTabBar = ({ state, descriptors, navigation }) => {
162
+ const { bottom } = useSafeAreaInsets();
163
+
164
+ return (
165
+ <Container
166
+ bg="background.white"
167
+ flexDirection="row"
168
+ height={bottom === 0 ? moderateScale(63) : moderateScale(83)}
169
+ >
170
+ {state.routes.map(({ key, name }, index) => {
171
+ const { options } = descriptors[key];
172
+ const isFocused = state.index === index;
173
+ const { icon, size } = options?.customTabBarProps || {};
174
+ const { tabBarActiveTintColor, tabBarInactiveTintColor } = options;
175
+ const onPress = () => {
176
+ const event = navigation.emit({
177
+ type: "tabPress",
178
+ target: key,
179
+ canPreventDefault: true,
180
+ });
181
+
182
+ if (!isFocused && !event.defaultPrevented) {
183
+ navigation.navigate({ name, merge: true });
184
+ }
185
+ };
186
+
187
+ const label =
188
+ options.tabBarLabel !== undefined
189
+ ? options.tabBarLabel
190
+ : options.title !== undefined
191
+ ? options.title
192
+ : name;
193
+
194
+ return (
195
+ <TabElement
196
+ icon={icon}
197
+ isFocused={isFocused}
198
+ key={index}
199
+ label={label}
200
+ size={size}
201
+ tabBarActiveTintColor={tabBarActiveTintColor}
202
+ tabBarInactiveTintColor={tabBarInactiveTintColor}
203
+ onPress={onPress}
204
+ />
205
+ );
206
+ })}
207
+ </Container>
208
+ );
209
+ };
198
210
 
199
211
  TabElement.propTypes = {
200
212
  isFocused: PropTypes.bool,
@@ -2,6 +2,7 @@ import React, { useContext } from "react";
2
2
 
3
3
  import propTypes from "@styled-system/prop-types";
4
4
  import PropTypes from "prop-types";
5
+ import { moderateScale } from "react-native-size-matters";
5
6
  import { ThemeContext } from "styled-components/native";
6
7
 
7
8
  import { Typography, Touchable, Container, Loader } from "@components";
@@ -32,32 +33,32 @@ export const BUTTON_VARIANTS = Object.freeze({
32
33
  * export default function Main() {
33
34
  * return (
34
35
  * <Container>
35
- * <Button my={9} label="Button1" />
36
- * <Button my={9} disabled label="Disabled Button2" />
36
+ * <Button my={moderateScale(9)} label="Button1" />
37
+ * <Button my={moderateScale(9)} disabled label="Disabled Button2" />
37
38
  * <Button
38
- * my={9}
39
- * LeftIcon={() => <Icon name="ri-add-line" color="white" size={16} />}
39
+ * my={moderateScale(9)}
40
+ * LeftIcon={() => <Icon name="ri-add-line" color="white" size={moderateScale(16)} />}
40
41
  * label="Left Icon Button"
41
42
  * />
42
43
  * <Button
43
- * my={9}
44
- * RightIcon={() => <Icon name="ri-add-line" color="white" size={16} />}
44
+ * my={moderateScale(9)}
45
+ * RightIcon={() => <Icon name="ri-add-line" color="white" size={moderateScale(16)} />}
45
46
  * label="Right Icon Button"
46
47
  * />
47
- * <Button my={9} variant="text" label="Text Button" />
48
+ * <Button my={moderateScale(9)} variant="text" label="Text Button" />
48
49
  * <Button
49
- * my={9}
50
+ * my={moderateScale(9)}
50
51
  * variant="text"
51
52
  * LeftIcon={() => (
52
- * <Icon name="ri-add-line" color={theme.fonts.primary} size={16} />
53
+ * <Icon name="ri-add-line" color={theme.fonts.primary} size={moderateScale(16)} />
53
54
  * )}
54
55
  * label="Left Icon Text Button"
55
56
  * />
56
57
  * <Button
57
- * my={9}
58
+ * my={moderateScale(9)}
58
59
  * variant="text"
59
60
  * RightIcon={() => (
60
- * <Icon name="ri-add-line" color={theme.fonts.primary} size={16} />
61
+ * <Icon name="ri-add-line" color={theme.fonts.primary} size={moderateScale(16)} />
61
62
  * )}
62
63
  * label="Right Icon Text Button"
63
64
  * />
@@ -157,11 +158,11 @@ export const Button = ({
157
158
  alignItems="center"
158
159
  bg={getButtonColors().bg}
159
160
  borderColor={getButtonColors().border}
160
- borderRadius={8}
161
- borderWidth={1}
161
+ borderRadius={moderateScale(8)}
162
+ borderWidth={moderateScale(1)}
162
163
  disabled={disabled || isLoading}
163
164
  flexDirection="row"
164
- height={48}
165
+ height={moderateScale(48)}
165
166
  justifyContent="center"
166
167
  opacity={renderOpacity()}
167
168
  rippleColor={getButtonColors().ripple}
@@ -176,7 +177,7 @@ export const Button = ({
176
177
  color={color || getButtonColors().color}
177
178
  fontFamily={fontFamily || theme.fonts.sf500}
178
179
  fontSize={fontSize}
179
- mx={2}
180
+ mx={moderateScale(2)}
180
181
  textAlign="center"
181
182
  {...labelStyle}
182
183
  >
@@ -191,7 +192,7 @@ export const Button = ({
191
192
  color={color || getButtonColors().color}
192
193
  fontFamily={fontFamily || theme.fonts.sf500}
193
194
  fontSize={fontSize}
194
- mx={2}
195
+ mx={moderateScale(2)}
195
196
  textAlign="center"
196
197
  {...labelStyle}
197
198
  >
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
 
3
3
  import PropTypes from "prop-types";
4
+ import { moderateScale } from "react-native-size-matters";
4
5
 
5
6
  import { Container, Typography, Touchable } from "@components";
6
7
 
@@ -45,18 +46,18 @@ export const ButtonGroup = ({
45
46
  alignSelf="center"
46
47
  border="1px solid"
47
48
  borderColor={activeColor}
48
- borderRadius={2}
49
+ borderRadius={moderateScale(2)}
49
50
  flexDirection="row"
50
51
  justifyContent="space-between"
51
- my={3}
52
+ my={moderateScale(3)}
52
53
  {...wrapperStyle}
53
54
  >
54
55
  {buttonItems.map(item => (
55
56
  <Touchable
56
57
  bg={item === currentActiveBtn ? activeColor : inActiveColor}
57
58
  key={item}
58
- p={2}
59
- px={3}
59
+ p={moderateScale(2)}
60
+ px={moderateScale(3)}
60
61
  onPress={() => {
61
62
  if (item !== currentActiveBtn) {
62
63
  onPress(item);
@@ -3,6 +3,7 @@ import React, { useContext } from "react";
3
3
  import dayjs from "dayjs";
4
4
  import PropTypes from "prop-types";
5
5
  import { Calendar as RNCalender } from "react-native-calendars";
6
+ import { moderateScale } from "react-native-size-matters";
6
7
  import { ThemeContext } from "styled-components/native";
7
8
 
8
9
  /**
@@ -57,7 +58,7 @@ export const Calendar = ({ selectedDate, ...rest }) => {
57
58
  },
58
59
  "stylesheet.calendar.header": {
59
60
  week: {
60
- marginVertical: 10,
61
+ marginVertical: moderateScale(10),
61
62
  flexDirection: "row",
62
63
  justifyContent: "space-around",
63
64
  alignItems: "center",
@@ -81,10 +82,10 @@ export const Calendar = ({ selectedDate, ...rest }) => {
81
82
  base: {
82
83
  alignItems: "center",
83
84
  justifyContent: "center",
84
- height: 26,
85
- width: 26,
86
- borderRadius: 5,
87
- borderWidth: 1,
85
+ height: moderateScale(26),
86
+ width: moderateScale(26),
87
+ borderRadius: moderateScale(5),
88
+ borderWidth: moderateScale(1),
88
89
  borderColor: "transparent",
89
90
  },
90
91
  today: {
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
  import { StyleSheet, TouchableOpacity } from "react-native";
3
3
 
4
4
  import PropTypes from "prop-types";
5
+ import { moderateScale } from "react-native-size-matters";
5
6
  import styled from "styled-components/native";
6
7
  import { flexbox, space, border, color, layout } from "styled-system";
7
8
 
@@ -41,7 +42,7 @@ const StyledTouchableOpacity = styled(TouchableOpacity)`
41
42
  *
42
43
  * export default function Main() {
43
44
  * return (
44
- * <Card height="100px" width="100px" bg="background.danger" elevation={8}>
45
+ * <Card height="100px" width="100px" bg="background.danger" elevation={moderateScale(8)}>
45
46
  * <Typography fontSize="14px">Card</Typography>
46
47
  * </Card>
47
48
  * );
@@ -80,10 +81,10 @@ export const styles = StyleSheet.create({
80
81
  shadowColor: theme.colors.background.grey800,
81
82
  shadowOffset: {
82
83
  width: 0,
83
- height: 2,
84
+ height: moderateScale(2),
84
85
  },
85
86
  shadowOpacity: 0.25,
86
- shadowRadius: 3.84,
87
+ shadowRadius: moderateScale(3.84),
87
88
  elevation: 5,
88
89
  },
89
90
  });
@@ -2,6 +2,7 @@ import React, { useState } from "react";
2
2
  import { StyleSheet, Dimensions, useWindowDimensions } from "react-native";
3
3
 
4
4
  import PropTypes from "prop-types";
5
+ import { moderateScale } from "react-native-size-matters";
5
6
  import CarouselParent, { Pagination } from "react-native-snap-carousel";
6
7
 
7
8
  import { Container } from "@components";
@@ -27,6 +28,7 @@ const { width } = Dimensions.get("screen");
27
28
  * ## Usage
28
29
  * ```js
29
30
  * import * as React from "react";
31
+ * import { moderateScale } from "react-native-size-matters";
30
32
  * import { Carousel } from "@bigbinary/neetoui-rn";
31
33
  *
32
34
  * export default function Main() {
@@ -67,8 +69,8 @@ export const Carousel = ({
67
69
  dotContainerStyle={styles.dotContainerStyle}
68
70
  dotStyle={styles.dotStyle}
69
71
  dotsLength={itemArray.length}
70
- inactiveDotOpacity={1}
71
- inactiveDotScale={1}
72
+ inactiveDotOpacity={moderateScale(1)}
73
+ inactiveDotScale={moderateScale(1)}
72
74
  inactiveDotStyle={styles.inactiveDotStyle}
73
75
  />
74
76
  </Container>
@@ -77,26 +79,26 @@ export const Carousel = ({
77
79
 
78
80
  const styles = StyleSheet.create({
79
81
  image: {
80
- height: width / 1.8,
81
- width: width / 1.8,
82
+ height: width / moderateScale(1.8),
83
+ width: width / moderateScale(1.8),
82
84
  resizeMode: "contain",
83
- borderRadius: 20,
85
+ borderRadius: moderateScale(20),
84
86
  },
85
87
  indicator: {
86
- height: 12,
87
- width: 12,
88
- borderRadius: 10,
89
- marginVertical: 20,
90
- marginHorizontal: 5,
88
+ height: moderateScale(12),
89
+ width: moderateScale(12),
90
+ borderRadius: moderateScale(10),
91
+ marginVertical: moderateScale(20),
92
+ marginHorizontal: moderateScale(5),
91
93
  backgroundColor: "#49545C",
92
94
  borderColor: "#FFFFFF",
93
- borderWidth: 2,
95
+ borderWidth: moderateScale(2),
94
96
  },
95
97
  dotStyle: {
96
- width: 10,
97
- height: 10,
98
- borderRadius: 5,
99
- marginRight: 8,
98
+ width: moderateScale(10),
99
+ height: moderateScale(10),
100
+ borderRadius: moderateScale(5),
101
+ marginRight: moderateScale(8),
100
102
  backgroundColor: "#2F3941",
101
103
  },
102
104
  inactiveDotStyle: {
@@ -2,6 +2,7 @@ import React, { useContext } from "react";
2
2
 
3
3
  import Proptypes from "prop-types";
4
4
  import Icon from "react-native-remix-icon";
5
+ import { moderateScale } from "react-native-size-matters";
5
6
  import { ThemeContext } from "styled-components/native";
6
7
 
7
8
  import { Container, Typography, Touchable } from "@components";
@@ -25,6 +26,7 @@ import { Container, Typography, Touchable } from "@components";
25
26
  * ## Usage
26
27
  * ```js
27
28
  * import * as React from "react";
29
+ * import { moderateScale } from "react-native-size-matters";
28
30
  * import { Container, CheckBox } from "@bigbinary/neetoui-rn";
29
31
  *
30
32
  * export default function Main() {
@@ -33,18 +35,18 @@ import { Container, Typography, Touchable } from "@components";
33
35
  * return (
34
36
  * <Container>
35
37
  * <CheckBox
36
- * mt={2}
38
+ * mt={moderateScale(2)}
37
39
  * checked={checked1}
38
40
  * onSelect={() => setChecked1(prev => !prev)}
39
41
  * label={`Checkbox marked as ${!checked1 ? "un" : ""}checked`}
40
42
  * />
41
43
  * <CheckBox
42
- * mt={3}
44
+ * mt={moderateScale(3)}
43
45
  * checked={checked2}
44
46
  * onSelect={() => setChecked2(prev => !prev)}
45
47
  * label={`Checkbox marked as ${!checked2 ? "un" : ""}checked`}
46
48
  * />
47
- * <CheckBox mt={3} disabled label="Disabled checkbox" />
49
+ * <CheckBox mt={moderateScale(3)} disabled label="Disabled checkbox" />
48
50
  * </Container>
49
51
  * );
50
52
  * }
@@ -80,7 +82,7 @@ export const CheckBox = ({
80
82
 
81
83
  const unCheckedProps = {
82
84
  bg: theme.colors.background.white,
83
- borderWidth: 1,
85
+ borderWidth: moderateScale(1),
84
86
  borderColor: theme.colors.border.secondary,
85
87
  labelProps: {
86
88
  fontFamily: theme.fonts.sf400,
@@ -99,10 +101,10 @@ export const CheckBox = ({
99
101
  >
100
102
  <Container
101
103
  alignItems="center"
102
- borderRadius={3}
103
- height={16}
104
+ borderRadius={moderateScale(3)}
105
+ height={moderateScale(16)}
104
106
  justifyContent="center"
105
- width={16}
107
+ width={moderateScale(16)}
106
108
  {...(!checked && unCheckedProps)}
107
109
  {...(checked && checkedProps)}
108
110
  {...(disabled && disabledProps)}
@@ -112,7 +114,7 @@ export const CheckBox = ({
112
114
  <Icon
113
115
  color={theme.colors.font.white}
114
116
  name="ri-check-line"
115
- size={14}
117
+ size={moderateScale(14)}
116
118
  {...checkIconStyle}
117
119
  />
118
120
  )}
@@ -120,7 +122,7 @@ export const CheckBox = ({
120
122
  <Typography
121
123
  flex={1}
122
124
  fontSize="m"
123
- ml={2}
125
+ ml={moderateScale(8)}
124
126
  {...(checked && checkedProps.labelProps)}
125
127
  {...(!checked && unCheckedProps.labelProps)}
126
128
  {...(disabled && disabledProps.labelProps)}
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
 
3
3
  import PropTypes from "prop-types";
4
4
  import Icon from "react-native-remix-icon";
5
+ import { moderateScale } from "react-native-size-matters";
5
6
 
6
7
  import { Typography, Touchable } from "@components";
7
8
 
@@ -67,23 +68,23 @@ export const Chip = ({
67
68
  }) => (
68
69
  <Touchable
69
70
  alignItems="center"
70
- borderRadius={20}
71
+ borderRadius={moderateScale(20)}
71
72
  disabled={!onChipPress || isDisabled}
72
73
  flexDirection="row"
73
- p={2}
74
+ p={moderateScale(2)}
74
75
  onPress={onChipPress}
75
76
  {...(variant && variantStyleObj[variant])}
76
77
  {...(isDisabled && { opacity: 0.5 })}
77
78
  {...containerStyle}
78
79
  >
79
80
  {LeftIcon && <LeftIcon />}
80
- <Typography color={labelColor} fontFamily="sf400" mx={2}>
81
+ <Typography color={labelColor} fontFamily="sf400" mx={moderateScale(2)}>
81
82
  {label}
82
83
  </Typography>
83
84
  {onClose && (
84
85
  <Touchable
85
86
  bg={closeIconBackground}
86
- borderRadius={10}
87
+ borderRadius={moderateScale(10)}
87
88
  disabled={isDisabled}
88
89
  onPress={onClose}
89
90
  {...closeIconContainerStyle}
@@ -100,7 +101,7 @@ Chip.defaultProps = {
100
101
  closeIconBackground: "background.grey500",
101
102
  closeIconColor: "white",
102
103
  isDisabled: false,
103
- closeIconSize: 14,
104
+ closeIconSize: moderateScale(14),
104
105
  closeIcon: "ri-close-fill",
105
106
  };
106
107
 
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
 
3
3
  import propTypes from "@styled-system/prop-types";
4
4
  import PropTypes from "prop-types";
5
+ import { moderateScale } from "react-native-size-matters";
5
6
  import styled from "styled-components/native";
6
7
  import { flexbox, space, color, layout } from "styled-system";
7
8
 
@@ -21,7 +22,7 @@ import { flexbox, space, color, layout } from "styled-system";
21
22
  * export default function Main(){
22
23
  * return (
23
24
  * <Container>
24
- * <Divider orientation="vertical" thickness={1}/>
25
+ * <Divider orientation="vertical" thickness={moderateScale(1)}/>
25
26
  * </Container>
26
27
  * );
27
28
  * }
@@ -55,7 +56,7 @@ export const Divider = ({ thickness, orientation, bg, ...rest }) => {
55
56
  Divider.defaultProps = {
56
57
  bg: "background.grey400",
57
58
  orientation: "horizontal",
58
- thickness: 1,
59
+ thickness: moderateScale(1),
59
60
  };
60
61
 
61
62
  Divider.propTypes = {
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
 
3
3
  import propTypes from "@styled-system/prop-types";
4
4
  import PropTypes from "prop-types";
5
+ import { moderateScale } from "react-native-size-matters";
5
6
 
6
7
  import { Touchable } from "@components";
7
8
  import { theme } from "@theme";
@@ -50,10 +51,10 @@ export const FAB = ({ Icon, bg, disabled, variant, onPress, ...rest }) => {
50
51
  shadowColor: theme.colors.background.grey800,
51
52
  shadowOffset: {
52
53
  width: 0,
53
- height: 2,
54
+ height: moderateScale(2),
54
55
  },
55
56
  shadowOpacity: 0.25,
56
- shadowRadius: 3.84,
57
+ shadowRadius: moderateScale(3.84),
57
58
  elevation: 5,
58
59
  };
59
60
 
@@ -79,10 +80,10 @@ export const FAB = ({ Icon, bg, disabled, variant, onPress, ...rest }) => {
79
80
 
80
81
  FAB.defaultProps = {
81
82
  variant: "solid",
82
- size: 56,
83
+ size: moderateScale(56),
83
84
  alignItems: "center",
84
85
  justifyContent: "center",
85
- borderRadius: 28,
86
+ borderRadius: moderateScale(28),
86
87
  };
87
88
 
88
89
  FAB.propTypes = {
@@ -13,6 +13,7 @@ import Animated, {
13
13
  withSequence,
14
14
  withTiming,
15
15
  } from "react-native-reanimated";
16
+ import { moderateScale } from "react-native-size-matters";
16
17
  import { ThemeContext } from "styled-components/native";
17
18
 
18
19
  import { useRefreshByUser } from "@hooks";
@@ -25,12 +26,18 @@ const Placeholder = () => {
25
26
  <ContentLoader
26
27
  backgroundColor={theme.colors.lightgrey}
27
28
  foregroundColor={theme.colors.grey300}
28
- height="60"
29
- marginHorizontal={15}
30
- viewBox="0 0 400 50"
31
- width={400}
29
+ height={moderateScale(60)}
30
+ marginHorizontal={moderateScale(15)}
31
+ viewBox={`0 0 ${moderateScale(400)} ${moderateScale(50)}`}
32
+ width={moderateScale(400)}
32
33
  >
33
- <Rect height="50" rx="5" ry="5" width={width - 30} x="0" />
34
+ <Rect
35
+ height={moderateScale(50)}
36
+ rx={moderateScale(5)}
37
+ ry={moderateScale(5)}
38
+ width={width - moderateScale(30)}
39
+ x="0"
40
+ />
34
41
  </ContentLoader>
35
42
  );
36
43
  };