@bigbinary/neetoui-rn 0.0.222 → 0.0.224
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/README.md +1 -1
- 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/Container.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/FlatList.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/ScrollView.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/components/Touchable.js +1 -1
- package/lib/components/Typography.js +1 -1
- package/lib/config/toasterConfig.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +11 -7
- package/src/components/{Accordion.js → Accordion.jsx} +11 -12
- package/src/components/{Alert.js → Alert.jsx} +30 -29
- package/src/components/{AnimatedImage.js → AnimatedImage.jsx} +52 -55
- package/src/components/{Avatar.js → Avatar.jsx} +36 -39
- package/src/components/{Badge.js → Badge.jsx} +19 -20
- package/src/components/{BottomSheet.js → BottomSheet.jsx} +81 -87
- package/src/components/{BottomTabBar.js → BottomTabBar.jsx} +71 -77
- package/src/components/{Button.js → Button.jsx} +18 -15
- package/src/components/{ButtonGroup.js → ButtonGroup.jsx} +35 -38
- package/src/components/{Calendar.js → Calendar.jsx} +3 -2
- package/src/components/{Card.js → Card.jsx} +5 -2
- package/src/components/{Carousel.js → Carousel.jsx} +6 -6
- package/src/components/{CheckBox.js → CheckBox.jsx} +12 -8
- package/src/components/{Chip.js → Chip.jsx} +30 -31
- package/src/components/{Container.js → Container.jsx} +6 -5
- package/src/components/{Divider.js → Divider.jsx} +3 -2
- package/src/components/{FAB.js → FAB.jsx} +3 -2
- package/src/components/{FlashList.js → FlashList.jsx} +54 -53
- package/src/components/FlatList.js +1 -1
- package/src/components/{Input.js → Input.jsx} +43 -43
- package/src/components/{ListItem.js → ListItem.jsx} +24 -25
- package/src/components/{Loader.js → Loader.jsx} +11 -9
- package/src/components/{MultiSelect.js → MultiSelect.jsx} +62 -68
- package/src/components/{NotificationPreferenceList.js → NotificationPreferenceList.jsx} +43 -43
- package/src/components/{OnBoarding.js → OnBoarding.jsx} +24 -27
- package/src/components/{OrganizationItem.js → OrganizationItem.jsx} +11 -9
- package/src/components/{OtpInputs.js → OtpInputs.jsx} +35 -34
- package/src/components/{ParentView.js → ParentView.jsx} +5 -3
- package/src/components/{Popover.js → Popover.jsx} +21 -22
- package/src/components/{RadioButton.js → RadioButton.jsx} +10 -6
- package/src/components/{RichTextEditor.js → RichTextEditor.jsx} +32 -34
- package/src/components/ScrollView.js +1 -1
- package/src/components/{SearchBar.js → SearchBar.jsx} +22 -22
- package/src/components/{SegmentedTopBar.js → SegmentedTopBar.jsx} +15 -17
- package/src/components/{Select.js → Select.jsx} +33 -30
- package/src/components/{SocialButton.js → SocialButton.jsx} +9 -8
- package/src/components/{Toast.js → Toast.jsx} +25 -20
- package/src/components/{ToggleSwitch.js → ToggleSwitch.jsx} +12 -11
- package/src/components/{TopBar.js → TopBar.jsx} +4 -4
- package/src/components/{Touchable.js → Touchable.jsx} +9 -4
- package/src/components/{Typography.js → Typography.jsx} +6 -5
- package/src/config/{toasterConfig.js → toasterConfig.jsx} +23 -24
- package/src/hooks/useDebounce.js +1 -0
- package/src/hooks/useKeyboard.js +1 -0
- package/src/index.js +2 -2
- package/src/theme/index.js +1 -1
- package/src/utils/utils.js +2 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useRef, useState } from "react";
|
|
2
2
|
import { Platform } from "react-native";
|
|
3
|
+
|
|
3
4
|
import PropTypes from "prop-types";
|
|
4
5
|
|
|
5
6
|
import { Button, Carousel, Container, Typography } from "@components";
|
|
@@ -58,48 +59,44 @@ export const OnBoarding = ({
|
|
|
58
59
|
} else onComplete();
|
|
59
60
|
};
|
|
60
61
|
|
|
61
|
-
const renderItem = ({ item }) =>
|
|
62
|
-
|
|
63
|
-
<Container
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{item.illustration}
|
|
67
|
-
</Container>
|
|
68
|
-
<Container alignItems="center" mx={24} my={12}>
|
|
69
|
-
<Typography fontFamily="sf700" fontSize="4xl" color="font.grey800">
|
|
70
|
-
{item.title}
|
|
71
|
-
</Typography>
|
|
72
|
-
<Typography
|
|
73
|
-
fontFamily="sf400"
|
|
74
|
-
fontSize="l"
|
|
75
|
-
color="font.grey500"
|
|
76
|
-
textAlign="center"
|
|
77
|
-
>
|
|
78
|
-
{item.description}
|
|
79
|
-
</Typography>
|
|
80
|
-
</Container>
|
|
62
|
+
const renderItem = ({ item }) => (
|
|
63
|
+
<Container flex={1} justifyContent="space-between">
|
|
64
|
+
<Container />
|
|
65
|
+
<Container alignItems="center" mx={24} my={12}>
|
|
66
|
+
{item.illustration}
|
|
81
67
|
</Container>
|
|
82
|
-
|
|
83
|
-
|
|
68
|
+
<Container alignItems="center" mx={24} my={12}>
|
|
69
|
+
<Typography color="font.grey800" fontFamily="sf700" fontSize="4xl">
|
|
70
|
+
{item.title}
|
|
71
|
+
</Typography>
|
|
72
|
+
<Typography
|
|
73
|
+
color="font.grey500"
|
|
74
|
+
fontFamily="sf400"
|
|
75
|
+
fontSize="l"
|
|
76
|
+
textAlign="center"
|
|
77
|
+
>
|
|
78
|
+
{item.description}
|
|
79
|
+
</Typography>
|
|
80
|
+
</Container>
|
|
81
|
+
</Container>
|
|
82
|
+
);
|
|
84
83
|
|
|
85
84
|
return (
|
|
86
85
|
<Container bg="background.white" flex={1}>
|
|
87
86
|
<Container alignItems="center">
|
|
88
87
|
<AppLogo width={logoWidth} />
|
|
89
88
|
</Container>
|
|
90
|
-
|
|
91
|
-
<Container flex={1} justifyContent="center" alignItems="center">
|
|
89
|
+
<Container alignItems="center" flex={1} justifyContent="center">
|
|
92
90
|
<Carousel
|
|
93
91
|
carouselRef={onBoardingRef}
|
|
94
92
|
itemArray={slides}
|
|
93
|
+
renderItem={renderItem}
|
|
95
94
|
onSnapToItem={index => {
|
|
96
95
|
setActiveIndex(index);
|
|
97
96
|
}}
|
|
98
|
-
renderItem={renderItem}
|
|
99
97
|
/>
|
|
100
98
|
</Container>
|
|
101
|
-
|
|
102
|
-
<Container mx={24} mb={Platform.OS === "android" ? 10 : 0}>
|
|
99
|
+
<Container mb={Platform.OS === "android" ? 10 : 0} mx={24}>
|
|
103
100
|
<Button
|
|
104
101
|
label={activeIndex !== slides.length - 1 ? "Next" : "Get Started"}
|
|
105
102
|
onPress={handleOnPress}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useContext } from "react";
|
|
2
|
+
|
|
2
3
|
import PropTypes from "prop-types";
|
|
3
4
|
import Icon from "react-native-remix-icon";
|
|
5
|
+
import { ThemeContext } from "styled-components/native";
|
|
4
6
|
|
|
5
7
|
import { Container, Typography } from "@components";
|
|
6
|
-
import { ThemeContext } from "styled-components/native";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
*
|
|
@@ -38,43 +39,44 @@ export const OrganizationItem = ({
|
|
|
38
39
|
...rest
|
|
39
40
|
}) => {
|
|
40
41
|
const theme = useContext(ThemeContext);
|
|
42
|
+
|
|
41
43
|
return (
|
|
42
44
|
<Container
|
|
43
45
|
bg="background.secondary"
|
|
44
|
-
width="100%"
|
|
45
|
-
px={16}
|
|
46
|
-
py={12}
|
|
47
46
|
borderRadius={6}
|
|
48
47
|
justifyContent="space-between"
|
|
48
|
+
px={16}
|
|
49
|
+
py={12}
|
|
50
|
+
width="100%"
|
|
49
51
|
{...rest}
|
|
50
52
|
>
|
|
51
53
|
<Container
|
|
52
|
-
flexDirection="row"
|
|
53
54
|
alignItems="center"
|
|
55
|
+
flexDirection="row"
|
|
54
56
|
{...labelContainerProps}
|
|
55
57
|
>
|
|
56
58
|
<Container mr={9} {...iconContainerProps}>
|
|
57
59
|
<Icon
|
|
58
|
-
size={20}
|
|
59
60
|
color={theme.colors.font.grey800}
|
|
60
61
|
name="building-line"
|
|
62
|
+
size={20}
|
|
61
63
|
{...iconProps}
|
|
62
64
|
/>
|
|
63
65
|
</Container>
|
|
64
66
|
<Typography
|
|
65
67
|
color="font.grey800"
|
|
66
|
-
fontSize="l"
|
|
67
68
|
fontFamily="sf500"
|
|
69
|
+
fontSize="l"
|
|
68
70
|
{...labelProps}
|
|
69
71
|
>
|
|
70
72
|
{label || "Organization"}
|
|
71
73
|
</Typography>
|
|
72
74
|
</Container>
|
|
73
75
|
<Typography
|
|
74
|
-
ml={29}
|
|
75
76
|
color="font.grey"
|
|
76
|
-
fontSize="m"
|
|
77
77
|
fontFamily="sf500"
|
|
78
|
+
fontSize="m"
|
|
79
|
+
ml={29}
|
|
78
80
|
mt="8px"
|
|
79
81
|
{...nameProps}
|
|
80
82
|
>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
2
|
import { InteractionManager, Keyboard } from "react-native";
|
|
3
|
+
|
|
3
4
|
import PropTypes from "prop-types";
|
|
5
|
+
import styled from "styled-components/native";
|
|
4
6
|
import {
|
|
5
7
|
flexbox,
|
|
6
8
|
space,
|
|
@@ -9,11 +11,11 @@ import {
|
|
|
9
11
|
typography,
|
|
10
12
|
color,
|
|
11
13
|
} from "styled-system";
|
|
12
|
-
import styled from "styled-components/native";
|
|
13
14
|
|
|
14
|
-
import { theme } from "../theme";
|
|
15
15
|
import { Container, Typography } from "@components";
|
|
16
16
|
|
|
17
|
+
import { theme } from "../theme";
|
|
18
|
+
|
|
17
19
|
const TextInput = styled.TextInput`
|
|
18
20
|
${flexbox}
|
|
19
21
|
${space}
|
|
@@ -94,60 +96,59 @@ export const OtpInputs = ({
|
|
|
94
96
|
return (
|
|
95
97
|
<Container>
|
|
96
98
|
<Container
|
|
99
|
+
alignItems="center"
|
|
100
|
+
flexDirection="row"
|
|
101
|
+
justifyContent="center"
|
|
97
102
|
onTouchEnd={() => {
|
|
98
103
|
Keyboard.dismiss();
|
|
99
104
|
inputRef && inputRef.current.focus();
|
|
100
105
|
}}
|
|
101
|
-
flexDirection="row"
|
|
102
|
-
alignItems="center"
|
|
103
|
-
justifyContent="center"
|
|
104
106
|
>
|
|
105
107
|
{Array(numberOfInputs)
|
|
106
108
|
.fill()
|
|
107
|
-
.map((
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
.map((_number, index) => (
|
|
110
|
+
<Container
|
|
111
|
+
borderWidth={code.length - 1 === index ? 1.5 : 1}
|
|
112
|
+
key={index}
|
|
113
|
+
borderColor={
|
|
114
|
+
code.length - 1 === index
|
|
115
|
+
? theme.colors.border.purple500
|
|
116
|
+
: theme.colors.border.secondary
|
|
117
|
+
}
|
|
118
|
+
{...styles.defaultContainerStyles}
|
|
119
|
+
{...containerStyles}
|
|
120
|
+
>
|
|
121
|
+
<Typography
|
|
122
|
+
accessibilityLabel="otp"
|
|
123
|
+
color={
|
|
124
|
+
error ? theme.colors.font.danger : theme.colors.font.purple500
|
|
115
125
|
}
|
|
116
|
-
|
|
117
|
-
{...
|
|
118
|
-
{...containerStyles}
|
|
126
|
+
{...styles.defaultTextStyles}
|
|
127
|
+
{...textStyles}
|
|
119
128
|
>
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
? theme.colors.font.danger
|
|
125
|
-
: theme.colors.font.purple500
|
|
126
|
-
}
|
|
127
|
-
{...styles.defaultTextStyles}
|
|
128
|
-
{...textStyles}
|
|
129
|
-
>
|
|
130
|
-
{code[index] || ""}
|
|
131
|
-
</Typography>
|
|
132
|
-
</Container>
|
|
133
|
-
);
|
|
134
|
-
})}
|
|
129
|
+
{code[index] || ""}
|
|
130
|
+
</Typography>
|
|
131
|
+
</Container>
|
|
132
|
+
))}
|
|
135
133
|
<TextInput
|
|
134
|
+
autoFocus
|
|
136
135
|
keyboardType="phone-pad"
|
|
136
|
+
ref={inputRef}
|
|
137
137
|
selectionColor="transparent"
|
|
138
|
-
|
|
138
|
+
value={code || ""}
|
|
139
139
|
onChangeText={value => {
|
|
140
140
|
if (!isNaN(value)) {
|
|
141
141
|
if (value.length <= numberOfInputs) {
|
|
142
142
|
handleChange && handleChange(value);
|
|
143
143
|
}
|
|
144
|
+
|
|
144
145
|
if (value.length >= numberOfInputs) {
|
|
145
146
|
return Keyboard.dismiss();
|
|
146
147
|
}
|
|
147
148
|
}
|
|
149
|
+
|
|
150
|
+
return null;
|
|
148
151
|
}}
|
|
149
|
-
ref={inputRef}
|
|
150
|
-
value={code || ""}
|
|
151
152
|
{...styles.inputStyles}
|
|
152
153
|
/>
|
|
153
154
|
</Container>
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React, { useContext } from "react";
|
|
2
2
|
import { Keyboard, StatusBar } from "react-native";
|
|
3
|
+
|
|
3
4
|
import PropTypes from "prop-types";
|
|
4
|
-
import { ThemeContext } from "styled-components/native";
|
|
5
5
|
import {
|
|
6
6
|
SafeAreaView,
|
|
7
7
|
useSafeAreaInsets,
|
|
8
8
|
} from "react-native-safe-area-context";
|
|
9
|
+
import { ThemeContext } from "styled-components/native";
|
|
9
10
|
|
|
10
11
|
import { Container } from "@components";
|
|
12
|
+
|
|
11
13
|
import { useKeyboard } from "../hooks/useKeyboard";
|
|
12
14
|
|
|
13
15
|
/**
|
|
@@ -68,7 +70,7 @@ export const ParentView = ({
|
|
|
68
70
|
{...safeAreaViewProps}
|
|
69
71
|
style={{ backgroundColor: statusBarColor }}
|
|
70
72
|
>
|
|
71
|
-
<StatusBar
|
|
73
|
+
<StatusBar backgroundColor={statusBarColor} barStyle={barStyle} />
|
|
72
74
|
<Container
|
|
73
75
|
{...(shouldDismissKeyboardOnTap
|
|
74
76
|
? {
|
|
@@ -84,8 +86,8 @@ export const ParentView = ({
|
|
|
84
86
|
},
|
|
85
87
|
}
|
|
86
88
|
: {})}
|
|
87
|
-
flex={1}
|
|
88
89
|
backgroundColor={newBackgroundColor}
|
|
90
|
+
flex={1}
|
|
89
91
|
{...rest}
|
|
90
92
|
{...(bottomInset && { pb: insets.bottom })}
|
|
91
93
|
>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useRef } from "react";
|
|
2
|
-
import
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
|
|
3
4
|
import PropTypes from "prop-types";
|
|
5
|
+
import OriginalPopover from "react-native-popover-view";
|
|
4
6
|
import styled from "styled-components/native";
|
|
5
|
-
import { StyleSheet } from "react-native";
|
|
6
7
|
import { flexbox, space, border, color, layout } from "styled-system";
|
|
7
8
|
|
|
8
9
|
import { Typography } from "@components";
|
|
@@ -20,18 +21,18 @@ const PopOverItem = ({ item, onPress, fontFamily, fontSize }) => {
|
|
|
20
21
|
|
|
21
22
|
return (
|
|
22
23
|
<TouchableOpacity
|
|
23
|
-
|
|
24
|
+
alignItems="center"
|
|
24
25
|
flexDirection="row"
|
|
25
26
|
p={2}
|
|
26
27
|
px={3}
|
|
27
|
-
|
|
28
|
+
onPress={onPress}
|
|
28
29
|
>
|
|
29
30
|
<Icon />
|
|
30
31
|
<Typography
|
|
31
|
-
px={2}
|
|
32
|
-
fontSize={fontSize}
|
|
33
32
|
fontColor="font.primary"
|
|
34
33
|
fontFamily={fontFamily}
|
|
34
|
+
fontSize={fontSize}
|
|
35
|
+
px={2}
|
|
35
36
|
{...labelProps}
|
|
36
37
|
>
|
|
37
38
|
{label}
|
|
@@ -155,28 +156,26 @@ export const Popover = ({
|
|
|
155
156
|
|
|
156
157
|
return (
|
|
157
158
|
<OriginalPopover
|
|
158
|
-
ref={popoverRef}
|
|
159
159
|
popoverStyle={styles.popoverStyle}
|
|
160
|
+
ref={popoverRef}
|
|
161
|
+
onCloseComplete={() => onPressItemRef.current()}
|
|
160
162
|
onOpenStart={() => {
|
|
161
163
|
onPressItemRef.current = () => {};
|
|
162
164
|
}}
|
|
163
|
-
onCloseComplete={() => onPressItemRef.current()}
|
|
164
165
|
{...rest}
|
|
165
166
|
>
|
|
166
|
-
{data?.map((item, index) =>
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
);
|
|
179
|
-
})}
|
|
167
|
+
{data?.map((item, index) => (
|
|
168
|
+
<PopOverItem
|
|
169
|
+
fontFamily={fontFamily}
|
|
170
|
+
fontSize={fontSize}
|
|
171
|
+
item={item}
|
|
172
|
+
key={index}
|
|
173
|
+
onPress={() => {
|
|
174
|
+
popoverRef?.current?.setState({ isVisible: false });
|
|
175
|
+
onPressItemRef.current = item.onPress;
|
|
176
|
+
}}
|
|
177
|
+
/>
|
|
178
|
+
))}
|
|
180
179
|
{children}
|
|
181
180
|
</OriginalPopover>
|
|
182
181
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from "react";
|
|
2
|
+
|
|
2
3
|
import Proptypes from "prop-types";
|
|
3
4
|
import { ThemeContext } from "styled-components/native";
|
|
4
5
|
|
|
@@ -67,6 +68,7 @@ export const RadioButton = ({
|
|
|
67
68
|
color: theme.colors.font.grey400,
|
|
68
69
|
},
|
|
69
70
|
};
|
|
71
|
+
|
|
70
72
|
const selectedProps = {
|
|
71
73
|
borderWidth: 4,
|
|
72
74
|
borderColor: theme.colors.background.base,
|
|
@@ -75,6 +77,7 @@ export const RadioButton = ({
|
|
|
75
77
|
color: theme.colors.font.primary,
|
|
76
78
|
},
|
|
77
79
|
};
|
|
80
|
+
|
|
78
81
|
const unselectedProps = {
|
|
79
82
|
borderWidth: 2,
|
|
80
83
|
borderColor: theme.colors.border.secondary,
|
|
@@ -83,28 +86,29 @@ export const RadioButton = ({
|
|
|
83
86
|
color: theme.colors.font.secondary,
|
|
84
87
|
},
|
|
85
88
|
};
|
|
89
|
+
|
|
86
90
|
return (
|
|
87
91
|
<Touchable
|
|
92
|
+
alignItems="center"
|
|
88
93
|
disabled={disabled}
|
|
89
|
-
onPress={onSelect}
|
|
90
94
|
flexDirection="row"
|
|
91
|
-
|
|
95
|
+
onPress={onSelect}
|
|
92
96
|
{...rest}
|
|
93
97
|
>
|
|
94
98
|
<Container
|
|
99
|
+
bg={theme.colors.background.white}
|
|
100
|
+
borderRadius={8}
|
|
95
101
|
height={16}
|
|
96
102
|
width={16}
|
|
97
|
-
borderRadius={8}
|
|
98
|
-
bg={theme.colors.background.white}
|
|
99
103
|
{...(selected && selectedProps)}
|
|
100
104
|
{...(!selected && unselectedProps)}
|
|
101
105
|
{...(disabled && disabledProps)}
|
|
102
106
|
{...radioButtonStyle}
|
|
103
107
|
/>
|
|
104
108
|
<Typography
|
|
105
|
-
ml={2}
|
|
106
|
-
fontSize="m"
|
|
107
109
|
flex={1}
|
|
110
|
+
fontSize="m"
|
|
111
|
+
ml={2}
|
|
108
112
|
{...(selected && selectedProps.labelProps)}
|
|
109
113
|
{...(!selected && unselectedProps.labelProps)}
|
|
110
114
|
{...(disabled && disabledProps.labelProps)}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React, { useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import PropTypes from "prop-types";
|
|
2
4
|
import {
|
|
3
5
|
RichEditor,
|
|
4
6
|
RichToolbar,
|
|
5
7
|
actions,
|
|
6
8
|
} from "react-native-pell-rich-editor";
|
|
7
|
-
import PropTypes from "prop-types";
|
|
8
9
|
import styled from "styled-components/native";
|
|
9
10
|
import { space, flexbox, border, layout } from "styled-system";
|
|
10
11
|
|
|
11
|
-
import { useKeyboard } from "@hooks";
|
|
12
12
|
import { Container } from "@components";
|
|
13
|
+
import { useKeyboard } from "@hooks";
|
|
13
14
|
|
|
14
15
|
export const ScrollView = styled.ScrollView.attrs(() => ({
|
|
15
16
|
keyboardShouldPersistTaps: "handled",
|
|
@@ -82,7 +83,7 @@ export const RichTextEditor = ({
|
|
|
82
83
|
}) => {
|
|
83
84
|
const richTextRef = useRef();
|
|
84
85
|
const keyboardHeight = useKeyboard();
|
|
85
|
-
const [toolbarVisible,
|
|
86
|
+
const [toolbarVisible, setToolbarVisible] = useState(false);
|
|
86
87
|
const showToolbar = keyboardHeight > 0 && toolbarVisible;
|
|
87
88
|
|
|
88
89
|
const computeToolbarActions = () => {
|
|
@@ -95,37 +96,34 @@ export const RichTextEditor = ({
|
|
|
95
96
|
};
|
|
96
97
|
|
|
97
98
|
return (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
{children}
|
|
127
|
-
</ScrollView>
|
|
128
|
-
</>
|
|
99
|
+
<ScrollView {...rest?.editorWrapperStyle}>
|
|
100
|
+
{showToolbar && (
|
|
101
|
+
<Container width="100%" {...rest?.toolbarWrapperStyle}>
|
|
102
|
+
<RichToolbar
|
|
103
|
+
actions={computeToolbarActions()}
|
|
104
|
+
editor={richTextRef}
|
|
105
|
+
{...toolBarProps}
|
|
106
|
+
/>
|
|
107
|
+
</Container>
|
|
108
|
+
)}
|
|
109
|
+
<RichEditor
|
|
110
|
+
androidLayerType="software"
|
|
111
|
+
placeholder={placeholderText}
|
|
112
|
+
ref={richTextRef}
|
|
113
|
+
useContainer={false}
|
|
114
|
+
onChange={onChange}
|
|
115
|
+
onBlur={() => {
|
|
116
|
+
setToolbarVisible(false);
|
|
117
|
+
editorProps?.onBlurFn();
|
|
118
|
+
}}
|
|
119
|
+
onFocus={() => {
|
|
120
|
+
setToolbarVisible(true);
|
|
121
|
+
editorProps?.onFocusFn();
|
|
122
|
+
}}
|
|
123
|
+
{...editorProps}
|
|
124
|
+
/>
|
|
125
|
+
{children}
|
|
126
|
+
</ScrollView>
|
|
129
127
|
);
|
|
130
128
|
};
|
|
131
129
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
/* eslint-disable react-native/no-inline-styles */
|
|
2
1
|
import React, { useEffect, useRef, useState } from "react";
|
|
3
2
|
import { Animated, TouchableWithoutFeedback } from "react-native";
|
|
3
|
+
|
|
4
|
+
import PropTypes from "prop-types";
|
|
5
|
+
import Icon from "react-native-remix-icon";
|
|
6
|
+
import styled from "styled-components/native";
|
|
4
7
|
import {
|
|
5
8
|
flexbox,
|
|
6
9
|
space,
|
|
@@ -9,9 +12,6 @@ import {
|
|
|
9
12
|
typography,
|
|
10
13
|
color,
|
|
11
14
|
} from "styled-system";
|
|
12
|
-
import styled from "styled-components/native";
|
|
13
|
-
import PropTypes from "prop-types";
|
|
14
|
-
import Icon from "react-native-remix-icon";
|
|
15
15
|
|
|
16
16
|
import { Container, Button } from "@components";
|
|
17
17
|
import { useDebounce } from "@hooks";
|
|
@@ -98,7 +98,7 @@ export const SearchBar = ({
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
return (
|
|
101
|
-
<Container
|
|
101
|
+
<Container alignItems="center" flexDirection="row">
|
|
102
102
|
<TouchableWithoutFeedback
|
|
103
103
|
onPress={() => {
|
|
104
104
|
if (!inputRef?.current?.isFocused()) {
|
|
@@ -107,39 +107,39 @@ export const SearchBar = ({
|
|
|
107
107
|
}}
|
|
108
108
|
>
|
|
109
109
|
<Container
|
|
110
|
-
|
|
111
|
-
flex={1}
|
|
112
|
-
borderWidth={1}
|
|
110
|
+
alignItems="center"
|
|
113
111
|
borderColor={theme.colors.border.grey400}
|
|
114
112
|
borderRadius={8}
|
|
113
|
+
borderWidth={1}
|
|
114
|
+
flex={1}
|
|
115
115
|
flexDirection="row"
|
|
116
|
-
|
|
116
|
+
height={42}
|
|
117
117
|
{...containerProps}
|
|
118
118
|
>
|
|
119
119
|
<Container px={10}>
|
|
120
120
|
<Icon
|
|
121
|
+
color={theme.colors.font.grey600}
|
|
121
122
|
name="ri-search-line"
|
|
122
123
|
size={20}
|
|
123
|
-
color={theme.colors.font.grey600}
|
|
124
124
|
/>
|
|
125
125
|
</Container>
|
|
126
126
|
<TextInput
|
|
127
|
+
autoCapitalize="none"
|
|
128
|
+
color="font.primary"
|
|
129
|
+
flex={1}
|
|
130
|
+
fontSize={16}
|
|
131
|
+
placeholder={placeholder}
|
|
132
|
+
placeholderTextColor={theme.colors.font.grey600}
|
|
127
133
|
ref={inputRef}
|
|
134
|
+
returnKeyType="search"
|
|
128
135
|
value={searchText}
|
|
129
136
|
onChangeText={setSearchText}
|
|
130
|
-
onFocus={() => {
|
|
131
|
-
animateSearchInput(1);
|
|
132
|
-
}}
|
|
133
137
|
onBlur={() => {
|
|
134
138
|
if (!searchText) animateSearchInput(0);
|
|
135
139
|
}}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
placeholderTextColor={theme.colors.font.grey600}
|
|
140
|
-
color="font.primary"
|
|
141
|
-
autoCapitalize="none"
|
|
142
|
-
returnKeyType="search"
|
|
140
|
+
onFocus={() => {
|
|
141
|
+
animateSearchInput(1);
|
|
142
|
+
}}
|
|
143
143
|
{...searchbarProps}
|
|
144
144
|
/>
|
|
145
145
|
</Container>
|
|
@@ -155,10 +155,10 @@ export const SearchBar = ({
|
|
|
155
155
|
>
|
|
156
156
|
<Button
|
|
157
157
|
height={20}
|
|
158
|
-
variant="text"
|
|
159
158
|
label="Cancel"
|
|
160
|
-
onPress={onCancelHandle}
|
|
161
159
|
labelStyle={{ mx: 0 }}
|
|
160
|
+
variant="text"
|
|
161
|
+
onPress={onCancelHandle}
|
|
162
162
|
/>
|
|
163
163
|
</Animated.View>
|
|
164
164
|
)}
|