@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.
- package/lib/components/Accordion.js +1 -1
- package/lib/components/Alert.js +1 -1
- package/lib/components/AnimatedImage.js +1 -1
- package/lib/components/Avatar.js +1 -1
- package/lib/components/Badge.js +1 -1
- package/lib/components/BottomSheet.js +1 -1
- package/lib/components/BottomTabBar.js +1 -1
- package/lib/components/Button.js +1 -1
- package/lib/components/ButtonGroup.js +1 -1
- package/lib/components/Calendar.js +1 -1
- package/lib/components/Card.js +1 -1
- package/lib/components/Carousel.js +1 -1
- package/lib/components/CheckBox.js +1 -1
- package/lib/components/Chip.js +1 -1
- package/lib/components/Divider.js +1 -1
- package/lib/components/FAB.js +1 -1
- package/lib/components/FlashList.js +1 -1
- package/lib/components/Input.js +1 -1
- package/lib/components/ListItem.js +1 -1
- package/lib/components/Loader.js +1 -1
- package/lib/components/MultiSelect.js +1 -1
- package/lib/components/NotificationPreferenceList.js +1 -1
- package/lib/components/OnBoarding.js +1 -1
- package/lib/components/OrganizationItem.js +1 -1
- package/lib/components/OtpInputs.js +1 -1
- package/lib/components/ParentView.js +1 -1
- package/lib/components/Popover.js +1 -1
- package/lib/components/RadioButton.js +1 -1
- package/lib/components/RichTextEditor.js +1 -1
- package/lib/components/SearchBar.js +1 -1
- package/lib/components/SegmentedTopBar.js +1 -1
- package/lib/components/Select.js +1 -1
- package/lib/components/SocialButton.js +1 -1
- package/lib/components/Toast.js +1 -1
- package/lib/components/ToggleSwitch.js +1 -1
- package/lib/components/TopBar.js +1 -1
- package/lib/theme/index.js +1 -1
- package/lib/utils/utils.js +1 -1
- package/package.json +2 -1
- package/src/components/Accordion.jsx +9 -9
- package/src/components/Alert.jsx +20 -17
- package/src/components/AnimatedImage.jsx +11 -5
- package/src/components/Avatar.jsx +5 -4
- package/src/components/Badge.jsx +6 -5
- package/src/components/BottomSheet.jsx +18 -13
- package/src/components/BottomTabBar.jsx +63 -51
- package/src/components/Button.jsx +17 -16
- package/src/components/ButtonGroup.jsx +5 -4
- package/src/components/Calendar.jsx +6 -5
- package/src/components/Card.jsx +4 -3
- package/src/components/Carousel.jsx +17 -15
- package/src/components/CheckBox.jsx +11 -9
- package/src/components/Chip.jsx +6 -5
- package/src/components/Divider.jsx +3 -2
- package/src/components/FAB.jsx +5 -4
- package/src/components/FlashList.jsx +12 -5
- package/src/components/Input.jsx +23 -29
- package/src/components/ListItem.jsx +5 -4
- package/src/components/Loader.jsx +4 -3
- package/src/components/MultiSelect.jsx +33 -25
- package/src/components/NotificationPreferenceList.jsx +12 -7
- package/src/components/OnBoarding.jsx +28 -8
- package/src/components/OrganizationItem.jsx +4 -3
- package/src/components/OtpInputs.jsx +11 -6
- package/src/components/ParentView.jsx +4 -3
- package/src/components/Popover.jsx +10 -9
- package/src/components/RadioButton.jsx +11 -9
- package/src/components/RichTextEditor.jsx +2 -0
- package/src/components/SearchBar.jsx +8 -7
- package/src/components/SegmentedTopBar.jsx +12 -11
- package/src/components/Select.jsx +31 -27
- package/src/components/SocialButton.jsx +6 -5
- package/src/components/Toast.jsx +20 -17
- package/src/components/ToggleSwitch.jsx +13 -10
- package/src/components/TopBar.jsx +7 -6
- package/src/components/Touchable.jsx +1 -1
- package/src/theme/index.js +15 -12
- package/src/utils/utils.js +4 -0
package/src/components/Input.jsx
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from "react-native";
|
|
11
11
|
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
|
+
import { moderateScale } from "react-native-size-matters";
|
|
13
14
|
import styled, { ThemeContext } from "styled-components/native";
|
|
14
15
|
import {
|
|
15
16
|
flexbox,
|
|
@@ -27,6 +28,7 @@ import {
|
|
|
27
28
|
import { Button, Container } from "@components";
|
|
28
29
|
|
|
29
30
|
import { theme } from "../theme";
|
|
31
|
+
import { isAndroid } from "../utils/utils";
|
|
30
32
|
|
|
31
33
|
const TextInput = styled.TextInput`
|
|
32
34
|
${flexbox}
|
|
@@ -142,14 +144,6 @@ export const Input = ({
|
|
|
142
144
|
duration: 300,
|
|
143
145
|
useNativeDriver: false,
|
|
144
146
|
}).start();
|
|
145
|
-
|
|
146
|
-
!!label &&
|
|
147
|
-
inputRef.current &&
|
|
148
|
-
inputRef.current.setNativeProps({
|
|
149
|
-
style: {
|
|
150
|
-
top: isFocused ? 10 : 0,
|
|
151
|
-
},
|
|
152
|
-
});
|
|
153
147
|
};
|
|
154
148
|
|
|
155
149
|
const handleStyles = useCallback(isFocused => {
|
|
@@ -160,18 +154,20 @@ export const Input = ({
|
|
|
160
154
|
: isFocused
|
|
161
155
|
? colors.border.purple500
|
|
162
156
|
: colors.border.grey400,
|
|
163
|
-
borderWidth:
|
|
157
|
+
borderWidth:
|
|
158
|
+
errorMessage || isFocused ? moderateScale(1.5) : moderateScale(1),
|
|
164
159
|
});
|
|
165
160
|
}, []);
|
|
166
161
|
|
|
167
162
|
const labelStyles = {
|
|
163
|
+
paddingLeft: isAndroid() ? moderateScale(4) : 0,
|
|
168
164
|
fontSize: animatedController.interpolate({
|
|
169
165
|
inputRange: [0, 1],
|
|
170
|
-
outputRange: [17, 13],
|
|
166
|
+
outputRange: [moderateScale(17), moderateScale(13)],
|
|
171
167
|
}),
|
|
172
168
|
top: animatedController.interpolate({
|
|
173
169
|
inputRange: [0, 1],
|
|
174
|
-
outputRange: [
|
|
170
|
+
outputRange: [moderateScale(16), moderateScale(6)],
|
|
175
171
|
}),
|
|
176
172
|
};
|
|
177
173
|
|
|
@@ -195,21 +191,20 @@ export const Input = ({
|
|
|
195
191
|
<View
|
|
196
192
|
alignItems="center"
|
|
197
193
|
borderColor={errorMessage ? "border.danger" : "border.grey400"}
|
|
198
|
-
borderRadius={8}
|
|
199
|
-
borderWidth={noBorder ? 0 : 1}
|
|
194
|
+
borderRadius={moderateScale(8)}
|
|
195
|
+
borderWidth={noBorder ? 0 : moderateScale(1)}
|
|
200
196
|
flexDirection="row"
|
|
201
197
|
justifyContent="space-between"
|
|
202
|
-
ref={containerRef}
|
|
203
|
-
{...(!rest.inputProps?.multiline && { height: 58 })}
|
|
204
198
|
overflow="hidden"
|
|
199
|
+
ref={containerRef}
|
|
205
200
|
{...containerProps}
|
|
206
201
|
>
|
|
207
202
|
{!!PrefixIcon && (
|
|
208
|
-
<View pl={
|
|
203
|
+
<View pl={moderateScale(8)}>
|
|
209
204
|
<PrefixIcon />
|
|
210
205
|
</View>
|
|
211
206
|
)}
|
|
212
|
-
<View flex={1} left={10}>
|
|
207
|
+
<View flex={1} left={moderateScale(10)}>
|
|
213
208
|
{!!label && (
|
|
214
209
|
<AnimatedLabel
|
|
215
210
|
color={disabled ? "font.grey400" : "font.grey600"}
|
|
@@ -221,16 +216,15 @@ export const Input = ({
|
|
|
221
216
|
</AnimatedLabel>
|
|
222
217
|
)}
|
|
223
218
|
<TextInput
|
|
224
|
-
autoCapitalize="
|
|
219
|
+
autoCapitalize="sentences"
|
|
225
220
|
autoFocus={autoFocus}
|
|
226
221
|
color={disabled ? "font.grey500" : "font.primary"}
|
|
227
222
|
editable={!disabled}
|
|
228
|
-
fontSize={17}
|
|
223
|
+
fontSize={moderateScale(17)}
|
|
229
224
|
inputAccessoryViewID={label}
|
|
230
|
-
|
|
231
|
-
pb={
|
|
232
|
-
|
|
233
|
-
pt={1}
|
|
225
|
+
paddingVertical={0}
|
|
226
|
+
pb={moderateScale(8)}
|
|
227
|
+
pt={label ? moderateScale(22) : moderateScale(12)}
|
|
234
228
|
ref={inputRef}
|
|
235
229
|
returnKeyType={rest.inputProps?.multiline ? "default" : "done"}
|
|
236
230
|
textAlignVertical={textAlignVertical}
|
|
@@ -256,15 +250,15 @@ export const Input = ({
|
|
|
256
250
|
bg="background.white"
|
|
257
251
|
flexDirection="row"
|
|
258
252
|
justifyContent="flex-end"
|
|
259
|
-
p={2}
|
|
260
|
-
pr={20}
|
|
253
|
+
p={moderateScale(2)}
|
|
254
|
+
pr={moderateScale(20)}
|
|
261
255
|
width={width}
|
|
262
256
|
>
|
|
263
257
|
<Button
|
|
264
|
-
height={30}
|
|
258
|
+
height={moderateScale(30)}
|
|
265
259
|
label="Done"
|
|
266
260
|
labelStyle={styles.doneButtonStyle}
|
|
267
|
-
left={10}
|
|
261
|
+
left={moderateScale(10)}
|
|
268
262
|
variant="text"
|
|
269
263
|
onPress={() => {
|
|
270
264
|
Keyboard.dismiss();
|
|
@@ -275,14 +269,14 @@ export const Input = ({
|
|
|
275
269
|
)}
|
|
276
270
|
</View>
|
|
277
271
|
{!!SuffixIcon && (
|
|
278
|
-
<View px={2}>
|
|
272
|
+
<View px={moderateScale(2)}>
|
|
279
273
|
<SuffixIcon />
|
|
280
274
|
</View>
|
|
281
275
|
)}
|
|
282
276
|
</View>
|
|
283
277
|
</TouchableWithoutFeedback>
|
|
284
278
|
{!!errorMessage && (
|
|
285
|
-
<Typography color="font.danger" pt={2}>
|
|
279
|
+
<Typography color="font.danger" pt={moderateScale(2)}>
|
|
286
280
|
{errorMessage}
|
|
287
281
|
</Typography>
|
|
288
282
|
)}
|
|
@@ -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 { Typography, Container } from "@components";
|
|
7
8
|
|
|
@@ -21,7 +22,7 @@ import { Typography, Container } from "@components";
|
|
|
21
22
|
* return (
|
|
22
23
|
* <Container>
|
|
23
24
|
* <ListItem
|
|
24
|
-
* LeftComponent={() => <Typography mr={2}>📣</Typography>}
|
|
25
|
+
* LeftComponent={() => <Typography mr={moderateScale(2)}>📣</Typography>}
|
|
25
26
|
* label="Organization"
|
|
26
27
|
* value={() => <Typography>Bigbinary</Typography>}
|
|
27
28
|
* />
|
|
@@ -35,11 +36,11 @@ export const ListItem = ({ LeftComponent, label, RightComponent, ...rest }) => (
|
|
|
35
36
|
<Container
|
|
36
37
|
alignItems="center"
|
|
37
38
|
bg="background.secondary"
|
|
38
|
-
borderRadius={6}
|
|
39
|
+
borderRadius={moderateScale(6)}
|
|
39
40
|
flexDirection="row"
|
|
40
41
|
justifyContent="space-between"
|
|
41
|
-
px={16}
|
|
42
|
-
py={12}
|
|
42
|
+
px={moderateScale(16)}
|
|
43
|
+
py={moderateScale(12)}
|
|
43
44
|
width="100%"
|
|
44
45
|
{...rest}
|
|
45
46
|
>
|
|
@@ -10,6 +10,7 @@ import Animated, {
|
|
|
10
10
|
useAnimatedStyle,
|
|
11
11
|
interpolate,
|
|
12
12
|
} from "react-native-reanimated";
|
|
13
|
+
import { moderateScale } from "react-native-size-matters";
|
|
13
14
|
import Svg, { Circle } from "react-native-svg";
|
|
14
15
|
|
|
15
16
|
import { Container } from "@components";
|
|
@@ -17,9 +18,9 @@ import { theme } from "@theme";
|
|
|
17
18
|
|
|
18
19
|
// eslint-disable-next-line @bigbinary/neeto/no-dangling-constants
|
|
19
20
|
const LOADER_WIDTH = {
|
|
20
|
-
s:
|
|
21
|
-
m:
|
|
22
|
-
l:
|
|
21
|
+
s: parseInt(moderateScale(18)),
|
|
22
|
+
m: parseInt(moderateScale(24)),
|
|
23
|
+
l: parseInt(moderateScale(36)),
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
const AnimatedCircle = Animated.createAnimatedComponent(Circle);
|
|
@@ -9,6 +9,7 @@ import Animated, {
|
|
|
9
9
|
withTiming,
|
|
10
10
|
} from "react-native-reanimated";
|
|
11
11
|
import Icon from "react-native-remix-icon";
|
|
12
|
+
import { moderateScale } from "react-native-size-matters";
|
|
12
13
|
import styled, { ThemeContext } from "styled-components/native";
|
|
13
14
|
import {
|
|
14
15
|
flexbox,
|
|
@@ -82,19 +83,20 @@ const MultiSelectItem = ({
|
|
|
82
83
|
<Container
|
|
83
84
|
alignItems="center"
|
|
84
85
|
bg="background.secondary"
|
|
85
|
-
borderRadius={12}
|
|
86
|
+
borderRadius={moderateScale(12)}
|
|
86
87
|
flexDirection="row"
|
|
87
88
|
justifyContent="space-between"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
mr={moderateScale(4)}
|
|
90
|
+
mt={moderateScale(4)}
|
|
91
|
+
px={moderateScale(10)}
|
|
92
|
+
py={moderateScale(4)}
|
|
91
93
|
{...multiSelectedItemContainerStyle}
|
|
92
94
|
>
|
|
93
95
|
<Typography
|
|
94
96
|
color="font.grey800"
|
|
95
97
|
fontFamily="sf400"
|
|
96
98
|
fontSize="s"
|
|
97
|
-
mr={2}
|
|
99
|
+
mr={moderateScale(2)}
|
|
98
100
|
{...multiSelectedItemLabelStyle}
|
|
99
101
|
>
|
|
100
102
|
{label}
|
|
@@ -107,7 +109,7 @@ const MultiSelectItem = ({
|
|
|
107
109
|
<Icon
|
|
108
110
|
color={theme.colors.font.grey800}
|
|
109
111
|
name="ri-close-line"
|
|
110
|
-
size=
|
|
112
|
+
size={moderateScale(20)}
|
|
111
113
|
/>
|
|
112
114
|
</TouchableWithoutFeedback>
|
|
113
115
|
)}
|
|
@@ -235,16 +237,18 @@ export const MultiSelect = ({
|
|
|
235
237
|
const isOptionsEmpty = !options || options?.length === 0;
|
|
236
238
|
const isSearchedOptionsEmpty =
|
|
237
239
|
searchQuery.length > 0 && filteredOptions.length === 0;
|
|
238
|
-
const emptyOptionsPlaceholderHeight = 40;
|
|
239
|
-
const emptySearchedOptionsHeight = 40;
|
|
240
|
-
const searchInputHeight = 35;
|
|
240
|
+
const emptyOptionsPlaceholderHeight = moderateScale(40);
|
|
241
|
+
const emptySearchedOptionsHeight = moderateScale(40);
|
|
242
|
+
const searchInputHeight = moderateScale(35);
|
|
241
243
|
const multipleOptionsSelected = value?.length > 0;
|
|
242
|
-
const defaultDropdownItemHeight =
|
|
244
|
+
const defaultDropdownItemHeight =
|
|
245
|
+
itemContainerStyle?.height || moderateScale(32);
|
|
246
|
+
|
|
243
247
|
const dropdownHeight =
|
|
244
248
|
dropdownContainerStyle?.height ||
|
|
245
249
|
dropdownContainerStyle?.maxHeight ||
|
|
246
250
|
defaultDropdownItemHeight * Math.min(filteredOptions?.length, 6) +
|
|
247
|
-
(isSearchable ? searchInputHeight + 10 : 0) +
|
|
251
|
+
(isSearchable ? searchInputHeight + moderateScale(10) : 0) +
|
|
248
252
|
(isOptionsEmpty && !(isSearchedOptionsEmpty && showCreateOption)
|
|
249
253
|
? emptyOptionsPlaceholderHeight
|
|
250
254
|
: 0) +
|
|
@@ -278,7 +282,7 @@ export const MultiSelect = ({
|
|
|
278
282
|
);
|
|
279
283
|
|
|
280
284
|
return (
|
|
281
|
-
<Container py={12}>
|
|
285
|
+
<Container py={moderateScale(12)}>
|
|
282
286
|
<CheckBox
|
|
283
287
|
checked={itemIndex !== -1}
|
|
284
288
|
disabled={disabled}
|
|
@@ -344,11 +348,12 @@ export const MultiSelect = ({
|
|
|
344
348
|
>
|
|
345
349
|
<Container
|
|
346
350
|
borderColor={showDropdown ? "border.base" : "border.grey400"}
|
|
347
|
-
borderRadius={12}
|
|
348
|
-
borderWidth={1}
|
|
349
|
-
minHeight={58}
|
|
350
|
-
p={
|
|
351
|
-
pr={
|
|
351
|
+
borderRadius={moderateScale(12)}
|
|
352
|
+
borderWidth={moderateScale(1)}
|
|
353
|
+
minHeight={moderateScale(58)}
|
|
354
|
+
p={moderateScale(10)}
|
|
355
|
+
pr={moderateScale(8)}
|
|
356
|
+
pt={moderateScale(12)}
|
|
352
357
|
{...inputContainerStyle}
|
|
353
358
|
{...rest}
|
|
354
359
|
>
|
|
@@ -359,8 +364,11 @@ export const MultiSelect = ({
|
|
|
359
364
|
>
|
|
360
365
|
<AnimatedLabel
|
|
361
366
|
position="absolute"
|
|
362
|
-
style={[animatedStyles, { marginLeft: 5, ...labelStyle }]}
|
|
363
367
|
zIndex={1}
|
|
368
|
+
style={[
|
|
369
|
+
animatedStyles,
|
|
370
|
+
{ marginLeft: moderateScale(2), ...labelStyle },
|
|
371
|
+
]}
|
|
364
372
|
>
|
|
365
373
|
{label}
|
|
366
374
|
</AnimatedLabel>
|
|
@@ -370,7 +378,7 @@ export const MultiSelect = ({
|
|
|
370
378
|
flexDirection="row"
|
|
371
379
|
flexWrap="wrap"
|
|
372
380
|
maxWidth="85%"
|
|
373
|
-
mt={
|
|
381
|
+
mt={moderateScale(16)}
|
|
374
382
|
onStartShouldSetResponder={() => true}
|
|
375
383
|
>
|
|
376
384
|
{value?.slice(0, maxItemSize).map((item, index) => (
|
|
@@ -391,12 +399,12 @@ export const MultiSelect = ({
|
|
|
391
399
|
<Container
|
|
392
400
|
alignItems="center"
|
|
393
401
|
bg="background.secondary"
|
|
394
|
-
borderRadius={12}
|
|
402
|
+
borderRadius={moderateScale(12)}
|
|
395
403
|
flexDirection="row"
|
|
396
404
|
justifyContent="space-between"
|
|
397
|
-
m={1}
|
|
398
|
-
px={
|
|
399
|
-
py={1}
|
|
405
|
+
m={moderateScale(1)}
|
|
406
|
+
px={moderateScale(3)}
|
|
407
|
+
py={moderateScale(1)}
|
|
400
408
|
{...moreItemLabelContainerStyle}
|
|
401
409
|
>
|
|
402
410
|
<Typography {...moreItemLabelStyle}>
|
|
@@ -408,14 +416,14 @@ export const MultiSelect = ({
|
|
|
408
416
|
))}
|
|
409
417
|
</Container>
|
|
410
418
|
)}
|
|
411
|
-
<Container mt={10}>
|
|
419
|
+
<Container mt={moderateScale(10)}>
|
|
412
420
|
{isLoading ? (
|
|
413
421
|
<Loader color={theme.colors.background.base} />
|
|
414
422
|
) : (
|
|
415
423
|
<Icon
|
|
416
424
|
color="grey"
|
|
417
425
|
name={`arrow-${showDropdown ? "up" : "down"}-s-line`}
|
|
418
|
-
size=
|
|
426
|
+
size={moderateScale(20)}
|
|
419
427
|
/>
|
|
420
428
|
)}
|
|
421
429
|
</Container>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 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, Divider, ToggleSwitch } from "@components";
|
|
6
7
|
|
|
@@ -57,7 +58,7 @@ import { Container, Typography, Divider, ToggleSwitch } from "@components";
|
|
|
57
58
|
* LeftIcon: () => (
|
|
58
59
|
* <Icon
|
|
59
60
|
* name="ri-notification-2-line"
|
|
60
|
-
* size={20}
|
|
61
|
+
* size={moderateScale(20)}
|
|
61
62
|
* color={theme.colors.font.secondary}
|
|
62
63
|
* />
|
|
63
64
|
* ),
|
|
@@ -83,29 +84,33 @@ export const NotificationPreferenceList = ({
|
|
|
83
84
|
labelProps,
|
|
84
85
|
...rest
|
|
85
86
|
}) => (
|
|
86
|
-
<Container
|
|
87
|
+
<Container
|
|
88
|
+
bg="background.secondary"
|
|
89
|
+
borderRadius={moderateScale(8)}
|
|
90
|
+
{...rest}
|
|
91
|
+
>
|
|
87
92
|
{data?.map((item, index) => {
|
|
88
93
|
const { label, enabled, onSwitch, LeftIcon } = item;
|
|
89
94
|
const isLastItem = index === data.length - 1;
|
|
90
95
|
|
|
91
96
|
return (
|
|
92
|
-
<Container key={index} px={12} {...itemWrapperProps}>
|
|
97
|
+
<Container key={index} px={moderateScale(12)} {...itemWrapperProps}>
|
|
93
98
|
<Container
|
|
94
99
|
alignItems="center"
|
|
95
100
|
flexDirection="row"
|
|
96
101
|
justifyContent="space-between"
|
|
97
|
-
py={15}
|
|
102
|
+
py={moderateScale(15)}
|
|
98
103
|
{...itemContainerProps}
|
|
99
104
|
>
|
|
100
105
|
<Container
|
|
101
106
|
alignItems="center"
|
|
102
107
|
flexDirection="row"
|
|
103
|
-
pr={15}
|
|
108
|
+
pr={moderateScale(15)}
|
|
104
109
|
width="85%"
|
|
105
110
|
{...labelContainerProps}
|
|
106
111
|
>
|
|
107
112
|
{LeftIcon && (
|
|
108
|
-
<Container mr={10}>
|
|
113
|
+
<Container mr={moderateScale(10)}>
|
|
109
114
|
<LeftIcon />
|
|
110
115
|
</Container>
|
|
111
116
|
)}
|
|
@@ -119,7 +124,7 @@ export const NotificationPreferenceList = ({
|
|
|
119
124
|
</Typography>
|
|
120
125
|
</Container>
|
|
121
126
|
<ToggleSwitch
|
|
122
|
-
mt={4}
|
|
127
|
+
mt={moderateScale(4)}
|
|
123
128
|
value={enabled}
|
|
124
129
|
onValueChange={() => onSwitch(item, index)}
|
|
125
130
|
/>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useRef, useState } from "react";
|
|
2
|
-
import { Platform } from "react-native";
|
|
3
2
|
|
|
4
3
|
import PropTypes from "prop-types";
|
|
4
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
5
|
+
import { moderateScale } from "react-native-size-matters";
|
|
5
6
|
|
|
6
7
|
import { Button, Carousel, Container, Typography } from "@components";
|
|
7
8
|
|
|
@@ -24,6 +25,7 @@ import { Button, Carousel, Container, Typography } from "@components";
|
|
|
24
25
|
* ## Usage
|
|
25
26
|
* ```js
|
|
26
27
|
* import * as React from "react";
|
|
28
|
+
* import { moderateScale } from "react-native-size-matters";
|
|
27
29
|
* import { OnBoarding } from "@bigbinary/neetoui-rn";
|
|
28
30
|
*
|
|
29
31
|
* export default function Main() {
|
|
@@ -47,10 +49,11 @@ export const OnBoarding = ({
|
|
|
47
49
|
appLogo: AppLogo,
|
|
48
50
|
slides,
|
|
49
51
|
onComplete,
|
|
50
|
-
logoWidth = 150,
|
|
52
|
+
logoWidth = moderateScale(150),
|
|
51
53
|
}) => {
|
|
52
54
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
53
55
|
const onBoardingRef = useRef();
|
|
56
|
+
const { bottom } = useSafeAreaInsets();
|
|
54
57
|
|
|
55
58
|
const handleOnPress = () => {
|
|
56
59
|
if (activeIndex !== slides.length - 1) {
|
|
@@ -61,12 +64,26 @@ export const OnBoarding = ({
|
|
|
61
64
|
|
|
62
65
|
const renderItem = ({ item }) => (
|
|
63
66
|
<Container flex={1} justifyContent="space-between">
|
|
64
|
-
<Container
|
|
65
|
-
|
|
67
|
+
<Container
|
|
68
|
+
alignItems="center"
|
|
69
|
+
flex={1}
|
|
70
|
+
justifyContent="center"
|
|
71
|
+
mx={moderateScale(24)}
|
|
72
|
+
my={moderateScale(12)}
|
|
73
|
+
>
|
|
66
74
|
{item.illustration}
|
|
67
75
|
</Container>
|
|
68
|
-
<Container
|
|
69
|
-
|
|
76
|
+
<Container
|
|
77
|
+
alignItems="center"
|
|
78
|
+
mx={moderateScale(24)}
|
|
79
|
+
my={moderateScale(12)}
|
|
80
|
+
>
|
|
81
|
+
<Typography
|
|
82
|
+
color="font.grey800"
|
|
83
|
+
fontFamily="sf700"
|
|
84
|
+
fontSize="4xl"
|
|
85
|
+
textAlign="center"
|
|
86
|
+
>
|
|
70
87
|
{item.title}
|
|
71
88
|
</Typography>
|
|
72
89
|
<Typography
|
|
@@ -86,7 +103,7 @@ export const OnBoarding = ({
|
|
|
86
103
|
<Container alignItems="center">
|
|
87
104
|
<AppLogo width={logoWidth} />
|
|
88
105
|
</Container>
|
|
89
|
-
<Container alignItems="center" flex={1}
|
|
106
|
+
<Container alignItems="center" flex={1}>
|
|
90
107
|
<Carousel
|
|
91
108
|
carouselRef={onBoardingRef}
|
|
92
109
|
itemArray={slides}
|
|
@@ -96,7 +113,10 @@ export const OnBoarding = ({
|
|
|
96
113
|
}}
|
|
97
114
|
/>
|
|
98
115
|
</Container>
|
|
99
|
-
<Container
|
|
116
|
+
<Container
|
|
117
|
+
mb={bottom === 0 ? moderateScale(16) : 0}
|
|
118
|
+
mx={moderateScale(24)}
|
|
119
|
+
>
|
|
100
120
|
<Button
|
|
101
121
|
label={activeIndex !== slides.length - 1 ? "Next" : "Get Started"}
|
|
102
122
|
onPress={handleOnPress}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 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 } from "@components";
|
|
6
7
|
|
|
@@ -38,10 +39,10 @@ export const OrganizationItem = ({
|
|
|
38
39
|
}) => (
|
|
39
40
|
<Container
|
|
40
41
|
bg="background.secondary"
|
|
41
|
-
borderRadius={6}
|
|
42
|
+
borderRadius={moderateScale(6)}
|
|
42
43
|
justifyContent="space-between"
|
|
43
|
-
px={12}
|
|
44
|
-
py={12}
|
|
44
|
+
px={moderateScale(12)}
|
|
45
|
+
py={moderateScale(12)}
|
|
45
46
|
width="100%"
|
|
46
47
|
{...rest}
|
|
47
48
|
>
|
|
@@ -2,6 +2,7 @@ import React, { useEffect } from "react";
|
|
|
2
2
|
import { InteractionManager, Keyboard } 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 {
|
|
7
8
|
flexbox,
|
|
@@ -35,13 +36,13 @@ const styles = {
|
|
|
35
36
|
position: "absolute",
|
|
36
37
|
},
|
|
37
38
|
defaultContainerStyles: {
|
|
38
|
-
margin: 2,
|
|
39
|
-
borderRadius: 8,
|
|
39
|
+
margin: moderateScale(2),
|
|
40
|
+
borderRadius: moderateScale(8),
|
|
40
41
|
backgroundColor: theme.colors.background.white,
|
|
41
42
|
justifyContent: "center",
|
|
42
43
|
alignItems: "center",
|
|
43
|
-
minHeight: 42,
|
|
44
|
-
minWidth: 42,
|
|
44
|
+
minHeight: moderateScale(42),
|
|
45
|
+
minWidth: moderateScale(42),
|
|
45
46
|
},
|
|
46
47
|
defaultTextStyles: {
|
|
47
48
|
fontSize: theme.fontSizes.xl,
|
|
@@ -67,7 +68,7 @@ const styles = {
|
|
|
67
68
|
* return (
|
|
68
69
|
* <Container flex={1} justifyContent="center" alignItems="center">
|
|
69
70
|
* <OtpInputs code={code} numberOfInputs={6} handleChange={setCode} />
|
|
70
|
-
* <Typography py={10} fontSize="xl">
|
|
71
|
+
* <Typography py={moderateScale(10)} fontSize="xl">
|
|
71
72
|
* {`Your entered OTP is ${code}`}
|
|
72
73
|
* </Typography>
|
|
73
74
|
* </Container>
|
|
@@ -108,13 +109,17 @@ export const OtpInputs = ({
|
|
|
108
109
|
.fill()
|
|
109
110
|
.map((_number, index) => (
|
|
110
111
|
<Container
|
|
111
|
-
borderWidth={code.length - 1 === index ? 1.5 : 1}
|
|
112
112
|
key={index}
|
|
113
113
|
borderColor={
|
|
114
114
|
code.length - 1 === index
|
|
115
115
|
? theme.colors.border.purple500
|
|
116
116
|
: theme.colors.border.secondary
|
|
117
117
|
}
|
|
118
|
+
borderWidth={
|
|
119
|
+
code.length - 1 === index
|
|
120
|
+
? moderateScale(1.5)
|
|
121
|
+
: moderateScale(1)
|
|
122
|
+
}
|
|
118
123
|
{...styles.defaultContainerStyles}
|
|
119
124
|
{...containerStyles}
|
|
120
125
|
>
|
|
@@ -13,12 +13,13 @@ import { Container } from "@components";
|
|
|
13
13
|
import { useKeyboard } from "../hooks/useKeyboard";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*ParentView wraps the
|
|
16
|
+
*ParentView wraps the children with SafeAreaView.
|
|
17
17
|
*
|
|
18
18
|
* ## Usage
|
|
19
19
|
* ```js
|
|
20
|
-
*import * as React from "react";
|
|
21
|
-
*import {
|
|
20
|
+
* import * as React from "react";
|
|
21
|
+
* import { moderateScale } from "react-native-size-matters";
|
|
22
|
+
* import { Typography, ParentView } from "@bigbinary/neetoui-rn";
|
|
22
23
|
*
|
|
23
24
|
*export default function Main() {
|
|
24
25
|
* return (
|
|
@@ -3,6 +3,7 @@ import { StyleSheet } from "react-native";
|
|
|
3
3
|
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import OriginalPopover from "react-native-popover-view";
|
|
6
|
+
import { moderateScale } from "react-native-size-matters";
|
|
6
7
|
import styled from "styled-components/native";
|
|
7
8
|
import { flexbox, space, border, color, layout } from "styled-system";
|
|
8
9
|
|
|
@@ -23,8 +24,8 @@ const PopOverItem = ({ item, onPress, fontFamily, fontSize }) => {
|
|
|
23
24
|
<TouchableOpacity
|
|
24
25
|
alignItems="center"
|
|
25
26
|
flexDirection="row"
|
|
26
|
-
p={2}
|
|
27
|
-
px={3}
|
|
27
|
+
p={moderateScale(2)}
|
|
28
|
+
px={moderateScale(3)}
|
|
28
29
|
onPress={onPress}
|
|
29
30
|
>
|
|
30
31
|
<Icon />
|
|
@@ -32,7 +33,7 @@ const PopOverItem = ({ item, onPress, fontFamily, fontSize }) => {
|
|
|
32
33
|
fontColor="font.primary"
|
|
33
34
|
fontFamily={fontFamily}
|
|
34
35
|
fontSize={fontSize}
|
|
35
|
-
px={2}
|
|
36
|
+
px={moderateScale(2)}
|
|
36
37
|
{...labelProps}
|
|
37
38
|
>
|
|
38
39
|
{label}
|
|
@@ -88,7 +89,7 @@ PopOverItem.propTypes = {
|
|
|
88
89
|
* return (
|
|
89
90
|
* <Icon
|
|
90
91
|
* name="ri-search-line"
|
|
91
|
-
* size={20}
|
|
92
|
+
* size={moderateScale(20)}
|
|
92
93
|
* color={theme.colors.background.grey800}
|
|
93
94
|
* />
|
|
94
95
|
* );
|
|
@@ -103,7 +104,7 @@ PopOverItem.propTypes = {
|
|
|
103
104
|
* return (
|
|
104
105
|
* <Icon
|
|
105
106
|
* name="ri-search-line"
|
|
106
|
-
* size={20}
|
|
107
|
+
* size={moderateScale(20)}
|
|
107
108
|
* color={theme.colors.background.grey800}
|
|
108
109
|
* />
|
|
109
110
|
* );
|
|
@@ -116,10 +117,10 @@ PopOverItem.propTypes = {
|
|
|
116
117
|
*
|
|
117
118
|
* return (
|
|
118
119
|
* <Container flex={1} alignItems="center" justifyContent="center">
|
|
119
|
-
* <Container p={2}>
|
|
120
|
+
* <Container p={moderateScale(2)}>
|
|
120
121
|
* <Popover data={data} from={<Button label="With Data" />} />
|
|
121
122
|
* </Container>
|
|
122
|
-
* <Container p={2}>
|
|
123
|
+
* <Container p={moderateScale(2)}>
|
|
123
124
|
* <Popover from={<Button label="With Custom Popup Content" />}>
|
|
124
125
|
*
|
|
125
126
|
* <Container bg="background.white" flex={1}>
|
|
@@ -128,7 +129,7 @@ PopOverItem.propTypes = {
|
|
|
128
129
|
* </Popover>
|
|
129
130
|
* </Container>
|
|
130
131
|
*
|
|
131
|
-
* <Container p={2}>
|
|
132
|
+
* <Container p={moderateScale(2)}>
|
|
132
133
|
* <Popover
|
|
133
134
|
* data={data}
|
|
134
135
|
* from={<Button label="With Custom Popup Content and data" />}
|
|
@@ -200,5 +201,5 @@ Popover.propTypes = {
|
|
|
200
201
|
};
|
|
201
202
|
|
|
202
203
|
const styles = StyleSheet.create({
|
|
203
|
-
popoverStyle: { borderRadius: 15, padding: 5 },
|
|
204
|
+
popoverStyle: { borderRadius: moderateScale(15), padding: moderateScale(5) },
|
|
204
205
|
});
|