@holper/react-native-holper-storybook 0.6.101 → 0.7.0
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/.expo/README.md +8 -0
- package/.nvmrc +1 -0
- package/.prettierignore +5 -0
- package/.storybook/index.jsx +11 -0
- package/.storybook/main.js +8 -0
- package/.storybook/preview.jsx +51 -0
- package/.storybook/storybook.requires.js +43 -0
- package/.yarn/releases/yarn-4.5.0.cjs +925 -0
- package/.yarnrc.yml +3 -0
- package/App.jsx +29 -0
- package/LICENSE +21 -0
- package/{readme.md → README.md} +18 -19
- package/app.config.js +77 -0
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/fonts/Poppins-Bold.ttf +0 -0
- package/assets/fonts/Poppins-Regular.ttf +0 -0
- package/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash.png +0 -0
- package/babel.config.js +7 -0
- package/build.sh +11 -0
- package/components/Button/index.tsx +66 -0
- package/{lib/components/Button/style.js → components/Button/style.ts} +8 -7
- package/components/Card/index.tsx +33 -0
- package/{lib/components/Card/style.js → components/Card/style.ts} +5 -4
- package/{lib/components/ConfirmationModal/index.js → components/ConfirmationModal/index.tsx} +25 -79
- package/{lib/components/ConfirmationModal/style.js → components/ConfirmationModal/style.tsx} +14 -13
- package/{lib/components/Container/index.js → components/Container/index.tsx} +7 -28
- package/{lib/components/Container/style.js → components/Container/style.ts} +6 -5
- package/{lib/components/CustomChatView/index.js → components/CustomChatView/index.tsx} +22 -30
- package/{lib/components/CustomChatView/style.js → components/CustomChatView/style.ts} +1 -1
- package/components/DeckSwiper/index.tsx +90 -0
- package/{lib/components/DeckSwiper/style.js → components/DeckSwiper/style.ts} +13 -12
- package/components/DonutCountdown/index.tsx +86 -0
- package/components/DonutCountdown/style.ts +8 -0
- package/components/FloatingContainer/index.tsx +35 -0
- package/{lib/components/FloatingContainer/style.js → components/FloatingContainer/style.ts} +7 -6
- package/components/Footer/index.tsx +35 -0
- package/{lib/components/Footer/style.js → components/Footer/style.ts} +4 -3
- package/components/Header/index.tsx +21 -0
- package/{lib/components/Header/style.js → components/Header/style.ts} +4 -3
- package/{lib/components/ImagePicker/index.js → components/ImagePicker/index.tsx} +3 -12
- package/components/ImageResponsive/index.tsx +24 -0
- package/components/ImageResponsive/style.ts +9 -0
- package/components/ImageViewer/index.tsx +36 -0
- package/{lib/components/ImageViewer/style.js → components/ImageViewer/style.ts} +11 -10
- package/{lib/components/Input/index.js → components/Input/index.tsx} +6 -33
- package/{lib/components/Input/style.js → components/Input/style.ts} +7 -18
- package/{lib/components/InputPin/index.js → components/InputPin/index.tsx} +6 -13
- package/{lib/components/InputPin/style.js → components/InputPin/style.ts} +7 -6
- package/components/MenuItem/index.tsx +25 -0
- package/{lib/components/MenuItem/style.js → components/MenuItem/style.ts} +9 -7
- package/{lib/components/NavigationTitle/index.js → components/NavigationTitle/index.tsx} +9 -30
- package/{lib/components/NavigationTitle/style.js → components/NavigationTitle/style.ts} +12 -11
- package/components/Notification/index.tsx +44 -0
- package/{lib/components/Notification/style.js → components/Notification/style.ts} +13 -11
- package/components/PreventDoubleClick/index.tsx +28 -0
- package/components/Select/index.tsx +51 -0
- package/components/Select/style.ts +64 -0
- package/{lib/components/SwipeablePanel/index.js → components/SwipeablePanel/index.tsx} +58 -85
- package/{lib/components/SwipeablePanel/style.js → components/SwipeablePanel/style.ts} +15 -14
- package/components/Switch/index.tsx +30 -0
- package/components/TakePicture/confirmPictureModal.tsx +37 -0
- package/components/TakePicture/index.tsx +148 -0
- package/{lib/components/TakePicture/style.js → components/TakePicture/style.ts} +4 -4
- package/components/Text/index.tsx +33 -0
- package/{lib/components/Text/style.js → components/Text/style.ts} +4 -2
- package/{lib/components/Textarea/index.js → components/Textarea/index.tsx} +5 -24
- package/{lib/components/Textarea/style.js → components/Textarea/style.ts} +5 -4
- package/components/TimeOutButton/index.tsx +67 -0
- package/{lib/components/TimeOutButton/style.js → components/TimeOutButton/style.ts} +4 -3
- package/components/Toast/index.tsx +34 -0
- package/components/Toast/style.ts +12 -0
- package/{lib/components/UploadDocument/index.js → components/UploadDocument/index.tsx} +49 -105
- package/{lib/components/UploadDocument/style.js → components/UploadDocument/style.ts} +16 -15
- package/components/VirtualKeyboard/index.tsx +75 -0
- package/{lib/components/VirtualKeyboard/style.js → components/VirtualKeyboard/style.ts} +9 -8
- package/components/index.ts +29 -0
- package/{lib/configs/constants.js → configs/constants.ts} +50 -48
- package/configs/types.ts +326 -0
- package/eas.json +27 -0
- package/eslint.config.mjs +205 -0
- package/hooks/index.ts +2 -0
- package/{lib/hooks/useDebounce.js → hooks/useDebounce.tsx} +6 -4
- package/hooks/useLoadFonts.tsx +13 -0
- package/index.js +3 -2
- package/lib/components/Button/index.tsx +66 -0
- package/lib/components/Button/style.ts +111 -0
- package/lib/components/Card/index.tsx +33 -0
- package/lib/components/Card/style.ts +34 -0
- package/lib/components/ConfirmationModal/index.tsx +104 -0
- package/lib/components/ConfirmationModal/style.tsx +53 -0
- package/lib/components/Container/index.tsx +33 -0
- package/lib/components/Container/style.ts +13 -0
- package/lib/components/CustomChatView/index.tsx +65 -0
- package/lib/components/CustomChatView/style.ts +10 -0
- package/lib/components/DeckSwiper/index.tsx +90 -0
- package/lib/components/DeckSwiper/style.ts +59 -0
- package/lib/components/DonutCountdown/index.tsx +86 -0
- package/lib/components/DonutCountdown/style.ts +8 -0
- package/lib/components/FloatingContainer/index.tsx +35 -0
- package/lib/components/FloatingContainer/style.ts +25 -0
- package/lib/components/Footer/index.tsx +35 -0
- package/lib/components/Footer/style.ts +40 -0
- package/lib/components/Header/index.tsx +21 -0
- package/lib/components/Header/style.ts +34 -0
- package/lib/components/ImagePicker/index.tsx +18 -0
- package/lib/components/ImageResponsive/index.tsx +24 -0
- package/lib/components/ImageResponsive/style.ts +9 -0
- package/lib/components/ImageViewer/index.tsx +36 -0
- package/lib/components/ImageViewer/style.ts +38 -0
- package/lib/components/Input/index.tsx +62 -0
- package/lib/components/Input/style.ts +91 -0
- package/lib/components/InputPin/index.tsx +21 -0
- package/lib/components/InputPin/style.ts +22 -0
- package/lib/components/MenuItem/index.tsx +25 -0
- package/lib/components/MenuItem/style.ts +44 -0
- package/lib/components/NavigationTitle/index.tsx +53 -0
- package/lib/components/NavigationTitle/style.ts +49 -0
- package/lib/components/Notification/index.tsx +44 -0
- package/lib/components/Notification/style.ts +50 -0
- package/lib/components/PreventDoubleClick/index.tsx +28 -0
- package/lib/components/Select/index.tsx +51 -0
- package/lib/components/Select/style.ts +64 -0
- package/lib/components/SwipeablePanel/index.tsx +208 -0
- package/lib/components/SwipeablePanel/style.ts +81 -0
- package/lib/components/Switch/index.tsx +30 -0
- package/lib/components/TakePicture/confirmPictureModal.tsx +37 -0
- package/lib/components/TakePicture/index.tsx +148 -0
- package/lib/components/TakePicture/style.ts +95 -0
- package/lib/components/Text/index.tsx +33 -0
- package/lib/components/Text/style.ts +101 -0
- package/lib/components/Textarea/index.tsx +26 -0
- package/lib/components/Textarea/style.ts +38 -0
- package/lib/components/TimeOutButton/index.tsx +67 -0
- package/lib/components/TimeOutButton/style.ts +42 -0
- package/lib/components/Toast/index.tsx +34 -0
- package/lib/components/Toast/style.ts +12 -0
- package/lib/components/UploadDocument/index.tsx +179 -0
- package/lib/components/UploadDocument/style.ts +57 -0
- package/lib/components/VirtualKeyboard/index.tsx +75 -0
- package/lib/components/VirtualKeyboard/style.ts +25 -0
- package/lib/components/index.ts +29 -0
- package/lib/configs/constants.ts +273 -0
- package/lib/configs/types.ts +326 -0
- package/lib/hooks/index.ts +2 -0
- package/lib/hooks/useDebounce.tsx +24 -0
- package/lib/hooks/useLoadFonts.tsx +13 -0
- package/lib/index.js +3 -2
- package/metro.config.js +11 -0
- package/package.json +72 -63
- package/prettier.config.mjs +23 -0
- package/stories/Button.stories.tsx +181 -0
- package/stories/Card.stories.tsx +22 -0
- package/stories/Colors.stories.tsx +57 -0
- package/stories/ConfirmationModal.stories.tsx +142 -0
- package/stories/Container.stories.tsx +105 -0
- package/stories/DeckSwiper.stories.tsx +43 -0
- package/stories/DonutCountdown.stories.tsx +134 -0
- package/stories/FloatingContainer.stories.tsx +139 -0
- package/stories/Footer.stories.tsx +65 -0
- package/stories/Header.stories.tsx +37 -0
- package/stories/ImagePicker.stories.tsx +14 -0
- package/stories/ImageResponsive.stories.tsx +18 -0
- package/stories/ImageViewer.stories.tsx +24 -0
- package/stories/Input.stories.tsx +119 -0
- package/stories/InputPin.stories.tsx +40 -0
- package/stories/Menu.stories.tsx +53 -0
- package/stories/MenuItem.stories.tsx +30 -0
- package/stories/NavigationTitle.stories.tsx +51 -0
- package/stories/Notification.stories.tsx +58 -0
- package/stories/Select.stories.tsx +270 -0
- package/stories/SwipeablePanel.stories.tsx +360 -0
- package/stories/Switch.stories.tsx +36 -0
- package/stories/TakePicture.stories.tsx +59 -0
- package/stories/Text.stories.tsx +61 -0
- package/stories/Textarea.stories.tsx +48 -0
- package/stories/TimeOutButton.stories.tsx +55 -0
- package/stories/Toast.stories.tsx +37 -0
- package/stories/UploadDocument.stories.tsx +179 -0
- package/stories/VirtualKeyboard.stories.tsx +14 -0
- package/tsconfig.json +21 -0
- package/utilities/ScrollView.tsx +19 -0
- package/utilities/index.ts +2 -0
- package/utilities/utils.ts +29 -0
- package/lib/components/Button/index.js +0 -104
- package/lib/components/Card/index.js +0 -49
- package/lib/components/DeckSwiper/index.js +0 -118
- package/lib/components/FlashMessage/index.js +0 -81
- package/lib/components/FloatingContainer/index.js +0 -69
- package/lib/components/Footer/index.js +0 -61
- package/lib/components/Header/index.js +0 -45
- package/lib/components/ImageResponsive/index.js +0 -39
- package/lib/components/ImageResponsive/style.js +0 -7
- package/lib/components/ImageViewer/index.js +0 -62
- package/lib/components/MenuItem/index.js +0 -44
- package/lib/components/Notification/index.js +0 -80
- package/lib/components/PreventDoubleClick/index.js +0 -21
- package/lib/components/Select/index.js +0 -89
- package/lib/components/Select/style.js +0 -81
- package/lib/components/Switch/index.js +0 -57
- package/lib/components/TakePicture/confirmPictureModal.js +0 -64
- package/lib/components/TakePicture/index.js +0 -198
- package/lib/components/Text/index.js +0 -75
- package/lib/components/TimeOutButton/index.js +0 -104
- package/lib/components/VirtualKeyboard/index.js +0 -86
- package/lib/components/index.js +0 -28
- package/lib/configs/loadFonts.js +0 -11
- package/lib/hooks/index.js +0 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { Dimensions } from 'react-native';
|
|
1
|
+
import { Dimensions, StyleSheet } from 'react-native';
|
|
2
|
+
|
|
2
3
|
import { Colors } from '../../configs/constants';
|
|
3
4
|
|
|
4
5
|
const { width, height } = Dimensions.get('window');
|
|
5
6
|
|
|
6
|
-
export default {
|
|
7
|
+
export default StyleSheet.create({
|
|
7
8
|
container: {
|
|
8
9
|
backgroundColor: 'rgba(0,0,0,0.9)',
|
|
9
10
|
flex: 1,
|
|
10
11
|
justifyContent: 'center',
|
|
11
12
|
alignItems: 'center',
|
|
12
|
-
position: 'relative'
|
|
13
|
+
position: 'relative',
|
|
13
14
|
},
|
|
14
15
|
closeIcon: {
|
|
15
16
|
position: 'absolute',
|
|
@@ -21,17 +22,17 @@ export default {
|
|
|
21
22
|
borderRadius: 15,
|
|
22
23
|
backgroundColor: Colors.lightblue,
|
|
23
24
|
alignItems: 'center',
|
|
24
|
-
justifyContent: 'center'
|
|
25
|
+
justifyContent: 'center',
|
|
25
26
|
},
|
|
26
27
|
body: {
|
|
27
28
|
width,
|
|
28
29
|
height,
|
|
29
30
|
alignSelf: 'center',
|
|
30
|
-
position: 'relative'
|
|
31
|
+
position: 'relative',
|
|
31
32
|
},
|
|
32
33
|
activityIndicator: {
|
|
33
|
-
top:
|
|
34
|
-
left:
|
|
35
|
-
position: 'absolute'
|
|
36
|
-
}
|
|
37
|
-
};
|
|
34
|
+
top: height / 2 - 100,
|
|
35
|
+
left: width / 2 - 20,
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
},
|
|
38
|
+
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { View, TextInput, Text } from 'react-native';
|
|
4
|
-
import style from './style';
|
|
1
|
+
import { Text, TextInput, View } from 'react-native';
|
|
2
|
+
|
|
5
3
|
import { Colors } from '../../configs/constants';
|
|
4
|
+
import style from './style';
|
|
5
|
+
|
|
6
|
+
import type { InputProps } from '../../configs/types';
|
|
6
7
|
|
|
7
8
|
const Input = ({
|
|
8
9
|
variant = 'default',
|
|
@@ -17,7 +18,7 @@ const Input = ({
|
|
|
17
18
|
value,
|
|
18
19
|
maxLength = 100,
|
|
19
20
|
...props
|
|
20
|
-
}) => (
|
|
21
|
+
}: InputProps) => (
|
|
21
22
|
<View style={style.container}>
|
|
22
23
|
{showLabel && <Text style={style.label}>{label}</Text>}
|
|
23
24
|
<View style={style.inputWrapper}>
|
|
@@ -58,32 +59,4 @@ const Input = ({
|
|
|
58
59
|
</View>
|
|
59
60
|
);
|
|
60
61
|
|
|
61
|
-
Input.defaultProps = {
|
|
62
|
-
variant: 'default',
|
|
63
|
-
disabled: false,
|
|
64
|
-
leftIcon: null,
|
|
65
|
-
leftIconWide: false,
|
|
66
|
-
showLabel: false,
|
|
67
|
-
label: '',
|
|
68
|
-
count: false,
|
|
69
|
-
rightIcon: null,
|
|
70
|
-
value: '',
|
|
71
|
-
maxLength: 100,
|
|
72
|
-
size: 'fixed',
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
Input.propTypes = {
|
|
76
|
-
variant: PropTypes.oneOf(['default', 'completed', 'error']),
|
|
77
|
-
size: PropTypes.oneOf(['fixed', 'fit']),
|
|
78
|
-
disabled: PropTypes.bool,
|
|
79
|
-
leftIcon: PropTypes.node,
|
|
80
|
-
leftIconWide: PropTypes.bool,
|
|
81
|
-
showLabel: PropTypes.bool,
|
|
82
|
-
label: PropTypes.string,
|
|
83
|
-
count: PropTypes.bool,
|
|
84
|
-
rightIcon: PropTypes.node,
|
|
85
|
-
value: PropTypes.string,
|
|
86
|
-
maxLength: PropTypes.number,
|
|
87
|
-
};
|
|
88
|
-
|
|
89
62
|
export default Input;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Dimensions } from 'react-native';
|
|
2
|
-
|
|
1
|
+
import { Dimensions, StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { borderRadius, Colors } from '../../configs/constants';
|
|
3
4
|
|
|
4
5
|
const { width } = Dimensions.get('window');
|
|
5
6
|
|
|
6
|
-
export default {
|
|
7
|
+
export default StyleSheet.create({
|
|
7
8
|
container: {
|
|
8
9
|
marginVertical: 8,
|
|
9
10
|
},
|
|
@@ -80,23 +81,11 @@ export default {
|
|
|
80
81
|
paddingRight: 2,
|
|
81
82
|
borderRightWidth: 1,
|
|
82
83
|
},
|
|
83
|
-
rightIconContainer: {
|
|
84
|
-
position: 'absolute',
|
|
85
|
-
right: 10,
|
|
86
|
-
top: 10,
|
|
87
|
-
height: 42,
|
|
88
|
-
justifyContent: 'center',
|
|
89
|
-
},
|
|
90
84
|
count: {
|
|
91
85
|
textAlign: 'right',
|
|
92
86
|
fontSize: 12,
|
|
93
87
|
color: Colors.gray,
|
|
94
88
|
fontFamily: 'poppins_regular',
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
fitSize: {
|
|
99
|
-
width: '100%',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
};
|
|
89
|
+
width: '100%',
|
|
90
|
+
},
|
|
91
|
+
});
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { View } from 'react-native';
|
|
4
1
|
import { times } from 'lodash';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
|
|
5
4
|
import Text from '../Text';
|
|
6
5
|
import style from './style';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
import type { InputPinProps } from '../../configs/types';
|
|
8
|
+
|
|
9
|
+
const InputPin = ({ values = [] }: InputPinProps) => (
|
|
9
10
|
<View style={style.container}>
|
|
10
11
|
{times(4, (index) => (
|
|
11
12
|
<View style={style.input} key={`value-${index}`}>
|
|
12
|
-
<Text size=
|
|
13
|
+
<Text size="large" weight="semiBold">
|
|
13
14
|
{values[index]}
|
|
14
15
|
</Text>
|
|
15
16
|
</View>
|
|
@@ -17,12 +18,4 @@ const InputPin = ({ values = [] }) => (
|
|
|
17
18
|
</View>
|
|
18
19
|
);
|
|
19
20
|
|
|
20
|
-
InputPin.defaultProps = {
|
|
21
|
-
values: [],
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
InputPin.propTypes = {
|
|
25
|
-
values: PropTypes.arrayOf(PropTypes.number),
|
|
26
|
-
};
|
|
27
|
-
|
|
28
21
|
export default InputPin;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {Dimensions} from 'react-native';
|
|
1
|
+
import { Dimensions, StyleSheet } from 'react-native';
|
|
2
|
+
|
|
2
3
|
import { Colors } from '../../configs/constants';
|
|
3
4
|
|
|
4
5
|
const { width } = Dimensions.get('window');
|
|
5
6
|
|
|
6
|
-
export default {
|
|
7
|
+
export default StyleSheet.create({
|
|
7
8
|
container: {
|
|
8
9
|
flexDirection: 'row',
|
|
9
10
|
justifyContent: 'space-between',
|
|
10
|
-
width: width - 60
|
|
11
|
+
width: width - 60,
|
|
11
12
|
},
|
|
12
13
|
input: {
|
|
13
14
|
borderColor: Colors.gray,
|
|
@@ -16,6 +17,6 @@ export default {
|
|
|
16
17
|
width: width / 6,
|
|
17
18
|
height: width / 6,
|
|
18
19
|
justifyContent: 'center',
|
|
19
|
-
alignItems: 'center'
|
|
20
|
-
}
|
|
21
|
-
};
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Feather } from '@expo/vector-icons';
|
|
2
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { Colors } from '../../configs/constants';
|
|
5
|
+
import Text from '../Text';
|
|
6
|
+
import style from './style';
|
|
7
|
+
|
|
8
|
+
import type { MenuItemProps } from '../../configs/types';
|
|
9
|
+
|
|
10
|
+
const MenuItem = ({ icon, text, disabled, onPress, last }: MenuItemProps) => (
|
|
11
|
+
<TouchableOpacity
|
|
12
|
+
style={[style.menuItem, last ? style.last : {}, disabled ? style.disabled : {}]}
|
|
13
|
+
onPress={onPress}
|
|
14
|
+
disabled={disabled}
|
|
15
|
+
>
|
|
16
|
+
<View style={style.left}>
|
|
17
|
+
{icon}
|
|
18
|
+
<Text style={style.text}>{text}</Text>
|
|
19
|
+
</View>
|
|
20
|
+
|
|
21
|
+
<Feather name="chevron-right" size={16} color={Colors.darkblue} style={style.rightIcon} />
|
|
22
|
+
</TouchableOpacity>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export default MenuItem;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
1
3
|
import { Colors } from '../../configs/constants';
|
|
2
4
|
|
|
3
|
-
export default {
|
|
5
|
+
export default StyleSheet.create({
|
|
4
6
|
// Default MenuItem
|
|
5
7
|
menuItem: {
|
|
6
8
|
backgroundColor: Colors.white,
|
|
@@ -12,7 +14,7 @@ export default {
|
|
|
12
14
|
justifyContent: 'space-between',
|
|
13
15
|
alignItems: 'center',
|
|
14
16
|
borderBottomWidth: 1,
|
|
15
|
-
borderBottomColor: Colors.lightblue
|
|
17
|
+
borderBottomColor: Colors.lightblue,
|
|
16
18
|
},
|
|
17
19
|
left: {
|
|
18
20
|
flexDirection: 'row',
|
|
@@ -20,7 +22,7 @@ export default {
|
|
|
20
22
|
alignItems: 'center',
|
|
21
23
|
},
|
|
22
24
|
text: {
|
|
23
|
-
marginLeft: 10
|
|
25
|
+
marginLeft: 10,
|
|
24
26
|
},
|
|
25
27
|
rightIcon: {
|
|
26
28
|
height: 20,
|
|
@@ -34,9 +36,9 @@ export default {
|
|
|
34
36
|
alignItems: 'center',
|
|
35
37
|
},
|
|
36
38
|
last: {
|
|
37
|
-
borderBottomColor: Colors.transparent
|
|
39
|
+
borderBottomColor: Colors.transparent,
|
|
38
40
|
},
|
|
39
41
|
disabled: {
|
|
40
|
-
opacity: 0.5
|
|
41
|
-
}
|
|
42
|
-
};
|
|
42
|
+
opacity: 0.5,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
3
2
|
import { TouchableOpacity, View } from 'react-native';
|
|
4
|
-
|
|
5
|
-
import Text from '../Text';
|
|
3
|
+
|
|
6
4
|
import { Colors } from '../../configs/constants';
|
|
5
|
+
import Text from '../Text';
|
|
7
6
|
import style from './style';
|
|
8
7
|
|
|
8
|
+
import type { NavigationTitleProps } from '../../configs/types';
|
|
9
|
+
|
|
9
10
|
const NavigationTitle = ({
|
|
10
11
|
type = 'close',
|
|
11
12
|
title,
|
|
@@ -13,7 +14,7 @@ const NavigationTitle = ({
|
|
|
13
14
|
xlarge,
|
|
14
15
|
blockNavigation,
|
|
15
16
|
onPress,
|
|
16
|
-
}) => (
|
|
17
|
+
}: NavigationTitleProps) => (
|
|
17
18
|
<View
|
|
18
19
|
style={[
|
|
19
20
|
style.container,
|
|
@@ -25,17 +26,13 @@ const NavigationTitle = ({
|
|
|
25
26
|
<>
|
|
26
27
|
{type === 'back' && (
|
|
27
28
|
<TouchableOpacity onPress={onPress} style={style.buttonBack}>
|
|
28
|
-
<Ionicons
|
|
29
|
-
name='arrow-back-outline'
|
|
30
|
-
size={20}
|
|
31
|
-
color={Colors.darkblue}
|
|
32
|
-
/>
|
|
29
|
+
<Ionicons name="arrow-back-outline" size={20} color={Colors.darkblue} />
|
|
33
30
|
</TouchableOpacity>
|
|
34
31
|
)}
|
|
35
32
|
</>
|
|
36
33
|
)}
|
|
37
34
|
{typeof title === 'string' ? (
|
|
38
|
-
<Text size={xlarge ? 'extra-large' : 'large'} weight=
|
|
35
|
+
<Text size={xlarge ? 'extra-large' : 'large'} weight="semiBold">
|
|
39
36
|
{title}
|
|
40
37
|
</Text>
|
|
41
38
|
) : (
|
|
@@ -45,7 +42,7 @@ const NavigationTitle = ({
|
|
|
45
42
|
<>
|
|
46
43
|
{type === 'close' && (
|
|
47
44
|
<TouchableOpacity onPress={onPress} style={style.button}>
|
|
48
|
-
<Ionicons name=
|
|
45
|
+
<Ionicons name="close-outline" size={24} color={Colors.darkblue} />
|
|
49
46
|
</TouchableOpacity>
|
|
50
47
|
)}
|
|
51
48
|
</>
|
|
@@ -53,22 +50,4 @@ const NavigationTitle = ({
|
|
|
53
50
|
</View>
|
|
54
51
|
);
|
|
55
52
|
|
|
56
|
-
NavigationTitle.defaultProps = {
|
|
57
|
-
type: 'close',
|
|
58
|
-
title: ' ',
|
|
59
|
-
noShadow: false,
|
|
60
|
-
xlarge: false,
|
|
61
|
-
blockNavigation: false,
|
|
62
|
-
onPress: () => {},
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
NavigationTitle.propTypes = {
|
|
66
|
-
type: PropTypes.oneOf(['close', 'back']),
|
|
67
|
-
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
68
|
-
noShadow: PropTypes.bool,
|
|
69
|
-
xlarge: PropTypes.bool,
|
|
70
|
-
blockNavigation: PropTypes.bool,
|
|
71
|
-
onPress: PropTypes.func,
|
|
72
|
-
};
|
|
73
|
-
|
|
74
53
|
export default NavigationTitle;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Dimensions } from 'react-native';
|
|
1
|
+
import { Dimensions, StyleSheet } from 'react-native';
|
|
2
|
+
|
|
2
3
|
import { Colors } from '../../configs/constants';
|
|
3
4
|
|
|
4
5
|
const { width } = Dimensions.get('window');
|
|
5
6
|
|
|
6
|
-
export default {
|
|
7
|
+
export default StyleSheet.create({
|
|
7
8
|
container: {
|
|
8
9
|
flexDirection: 'row',
|
|
9
10
|
alignItems: 'center',
|
|
@@ -13,20 +14,20 @@ export default {
|
|
|
13
14
|
borderRadius: 10,
|
|
14
15
|
width,
|
|
15
16
|
shadowOffset: { width: 0, height: 3 },
|
|
16
|
-
shadowOpacity:
|
|
17
|
+
shadowOpacity: 0.4,
|
|
17
18
|
shadowRadius: 3,
|
|
18
19
|
elevation: 5,
|
|
19
|
-
shadowColor: Colors.lightblue
|
|
20
|
+
shadowColor: Colors.lightblue,
|
|
20
21
|
},
|
|
21
22
|
noShadow: {
|
|
22
23
|
shadowOpacity: 0,
|
|
23
|
-
elevation: 0
|
|
24
|
+
elevation: 0,
|
|
24
25
|
},
|
|
25
26
|
containerClose: {
|
|
26
|
-
justifyContent: 'space-between'
|
|
27
|
+
justifyContent: 'space-between',
|
|
27
28
|
},
|
|
28
29
|
containerBack: {
|
|
29
|
-
justifyContent: 'flex-start'
|
|
30
|
+
justifyContent: 'flex-start',
|
|
30
31
|
},
|
|
31
32
|
button: {
|
|
32
33
|
height: 30,
|
|
@@ -34,7 +35,7 @@ export default {
|
|
|
34
35
|
borderRadius: 15,
|
|
35
36
|
backgroundColor: Colors.lightblue,
|
|
36
37
|
alignItems: 'center',
|
|
37
|
-
justifyContent: 'center'
|
|
38
|
+
justifyContent: 'center',
|
|
38
39
|
},
|
|
39
40
|
buttonBack: {
|
|
40
41
|
height: 30,
|
|
@@ -43,6 +44,6 @@ export default {
|
|
|
43
44
|
marginRight: 10,
|
|
44
45
|
backgroundColor: Colors.lightblue,
|
|
45
46
|
alignItems: 'center',
|
|
46
|
-
justifyContent: 'center'
|
|
47
|
-
}
|
|
48
|
-
};
|
|
47
|
+
justifyContent: 'center',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
4
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
5
|
+
|
|
6
|
+
import { Colors } from '../../configs/constants';
|
|
7
|
+
import ImageResponsive from '../ImageResponsive';
|
|
8
|
+
import Text from '../Text';
|
|
9
|
+
import style from './style';
|
|
10
|
+
|
|
11
|
+
import type { NotificationProps } from '../../configs/types';
|
|
12
|
+
|
|
13
|
+
dayjs.extend(relativeTime);
|
|
14
|
+
|
|
15
|
+
const Notification = ({
|
|
16
|
+
first,
|
|
17
|
+
active,
|
|
18
|
+
hideAvatar,
|
|
19
|
+
avatar,
|
|
20
|
+
title,
|
|
21
|
+
description,
|
|
22
|
+
date = dayjs().fromNow(),
|
|
23
|
+
onPress,
|
|
24
|
+
}: NotificationProps) => (
|
|
25
|
+
<TouchableOpacity style={[style.container, first ? style.first : {}, active ? style.active : {}]} onPress={onPress}>
|
|
26
|
+
{!hideAvatar && <ImageResponsive source={avatar} avatar style={style.avatar} />}
|
|
27
|
+
<View style={style.textContainer}>
|
|
28
|
+
<View style={style.text}>
|
|
29
|
+
<View style={style.textInner}>
|
|
30
|
+
<Text weight="semiBold">{title}</Text>
|
|
31
|
+
{active && <Ionicons name="ellipse" color={Colors.green} size={12} style={style.icon} />}
|
|
32
|
+
</View>
|
|
33
|
+
<Text color="light" size="tiny" style={style.time}>
|
|
34
|
+
{dayjs(date).fromNow()}
|
|
35
|
+
</Text>
|
|
36
|
+
</View>
|
|
37
|
+
<Text color="light" size="small" ellipsizeMode="tail" numberOfLines={3}>
|
|
38
|
+
{description}
|
|
39
|
+
</Text>
|
|
40
|
+
</View>
|
|
41
|
+
</TouchableOpacity>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export default Notification;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
1
3
|
import { Colors } from '../../configs/constants';
|
|
2
4
|
|
|
3
|
-
export default {
|
|
5
|
+
export default StyleSheet.create({
|
|
4
6
|
container: {
|
|
5
7
|
flexDirection: 'row',
|
|
6
8
|
alignItems: 'center',
|
|
@@ -9,11 +11,11 @@ export default {
|
|
|
9
11
|
paddingVertical: 8,
|
|
10
12
|
borderLeftWidth: 6,
|
|
11
13
|
borderLeftColor: Colors.transparent,
|
|
12
|
-
paddingHorizontal: 10
|
|
14
|
+
paddingHorizontal: 10,
|
|
13
15
|
},
|
|
14
16
|
first: {
|
|
15
17
|
borderTopWidth: 1,
|
|
16
|
-
borderTopColor: Colors.lightblue
|
|
18
|
+
borderTopColor: Colors.lightblue,
|
|
17
19
|
},
|
|
18
20
|
active: {
|
|
19
21
|
borderLeftColor: Colors.green,
|
|
@@ -23,26 +25,26 @@ export default {
|
|
|
23
25
|
width: 60,
|
|
24
26
|
borderWidth: 1,
|
|
25
27
|
borderColor: Colors.lightblue,
|
|
26
|
-
marginRight: 15
|
|
28
|
+
marginRight: 15,
|
|
27
29
|
},
|
|
28
30
|
textContainer: {
|
|
29
31
|
flex: 1,
|
|
30
32
|
justifyContent: 'space-evenly',
|
|
31
|
-
height: 60
|
|
33
|
+
height: 60,
|
|
32
34
|
},
|
|
33
35
|
text: {
|
|
34
36
|
flexDirection: 'row',
|
|
35
|
-
justifyContent: 'space-between'
|
|
37
|
+
justifyContent: 'space-between',
|
|
36
38
|
},
|
|
37
39
|
textInner: {
|
|
38
40
|
flexDirection: 'row',
|
|
39
|
-
alignItems: 'center'
|
|
41
|
+
alignItems: 'center',
|
|
40
42
|
},
|
|
41
43
|
time: {
|
|
42
|
-
alignSelf: 'flex-start'
|
|
44
|
+
alignSelf: 'flex-start',
|
|
43
45
|
},
|
|
44
46
|
icon: {
|
|
45
47
|
marginLeft: 5,
|
|
46
|
-
marginTop: 2
|
|
47
|
-
}
|
|
48
|
-
};
|
|
48
|
+
marginTop: 2,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
import { debounce } from 'lodash';
|
|
4
|
+
import { PureComponent } from 'react';
|
|
5
|
+
|
|
6
|
+
import type { withPreventDoubleClickProps } from '../../configs/types';
|
|
7
|
+
|
|
8
|
+
function withPreventDoubleClick<P extends withPreventDoubleClickProps>(WrappedComponent: ComponentType<P>) {
|
|
9
|
+
class PreventDoubleClick extends PureComponent<P> {
|
|
10
|
+
debouncedOnPress = () => {
|
|
11
|
+
if (this.props.onPress) {
|
|
12
|
+
this.props.onPress();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
onPress = debounce(this.debouncedOnPress, 300, { leading: true, trailing: false });
|
|
17
|
+
static displayName: string;
|
|
18
|
+
|
|
19
|
+
render() {
|
|
20
|
+
return <WrappedComponent {...this.props} onPress={this.onPress} />;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
PreventDoubleClick.displayName = `withPreventDoubleClick(${WrappedComponent.displayName || WrappedComponent.name})`;
|
|
25
|
+
return PreventDoubleClick;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default withPreventDoubleClick;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Feather } from '@expo/vector-icons';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import RNPickerSelect from 'react-native-picker-select';
|
|
4
|
+
|
|
5
|
+
import style from './style';
|
|
6
|
+
|
|
7
|
+
import type { SelectProps } from '../../configs/types';
|
|
8
|
+
|
|
9
|
+
const Select = ({
|
|
10
|
+
disabled,
|
|
11
|
+
fitToContainer,
|
|
12
|
+
items = [],
|
|
13
|
+
onValueChange,
|
|
14
|
+
placeholder,
|
|
15
|
+
value = '',
|
|
16
|
+
variant = 'default',
|
|
17
|
+
}: SelectProps) => (
|
|
18
|
+
<View style={[style.container, disabled ? style.disabled : {}, fitToContainer ? style.fit : {}]}>
|
|
19
|
+
<RNPickerSelect
|
|
20
|
+
value={value}
|
|
21
|
+
onValueChange={(val) => onValueChange?.(val)}
|
|
22
|
+
disabled={disabled}
|
|
23
|
+
placeholder={{
|
|
24
|
+
label: placeholder,
|
|
25
|
+
value: '',
|
|
26
|
+
color: style.placeholderStyle.color,
|
|
27
|
+
}}
|
|
28
|
+
items={items}
|
|
29
|
+
Icon={() => <Feather name="chevron-down" size={24} style={style.iconStyle} />}
|
|
30
|
+
useNativeAndroidPickerStyle={false}
|
|
31
|
+
pickerProps={{ mode: 'dropdown', enabled: !disabled, itemStyle: style.itemStyle }}
|
|
32
|
+
style={{
|
|
33
|
+
inputIOSContainer: { pointerEvents: 'none', ...style.basicStyle, ...style[`${variant}Container`] },
|
|
34
|
+
inputAndroidContainer: { ...style.basicStyle, ...style[`${variant}Container`] },
|
|
35
|
+
inputIOS: {
|
|
36
|
+
...style.fontStyle,
|
|
37
|
+
...(variant === 'error' ? style.errorFontStyle : {}),
|
|
38
|
+
},
|
|
39
|
+
inputAndroid: {
|
|
40
|
+
...style.fontStyle,
|
|
41
|
+
...(variant === 'error' ? style.errorFontStyle : {}),
|
|
42
|
+
},
|
|
43
|
+
placeholder: style.placeholderStyle,
|
|
44
|
+
chevronUp: style.selectIcon,
|
|
45
|
+
chevronDown: style.selectIcon,
|
|
46
|
+
}}
|
|
47
|
+
/>
|
|
48
|
+
</View>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export default Select;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Dimensions, StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { borderRadius, Colors } from '../../configs/constants';
|
|
4
|
+
|
|
5
|
+
const { width } = Dimensions.get('window');
|
|
6
|
+
|
|
7
|
+
export default StyleSheet.create({
|
|
8
|
+
container: {
|
|
9
|
+
width: width - 60,
|
|
10
|
+
position: 'relative',
|
|
11
|
+
},
|
|
12
|
+
fit: {
|
|
13
|
+
width: '100%',
|
|
14
|
+
position: 'relative',
|
|
15
|
+
},
|
|
16
|
+
selectIcon: {
|
|
17
|
+
marginTop: 20,
|
|
18
|
+
marginRight: 15,
|
|
19
|
+
},
|
|
20
|
+
disabled: {
|
|
21
|
+
opacity: 0.5,
|
|
22
|
+
},
|
|
23
|
+
basicStyle: {
|
|
24
|
+
height: 50,
|
|
25
|
+
width: '100%',
|
|
26
|
+
borderRadius,
|
|
27
|
+
borderWidth: 1,
|
|
28
|
+
paddingHorizontal: 10,
|
|
29
|
+
backgroundColor: Colors.white,
|
|
30
|
+
marginVertical: 6,
|
|
31
|
+
},
|
|
32
|
+
defaultContainer: {
|
|
33
|
+
borderColor: Colors.midblue,
|
|
34
|
+
},
|
|
35
|
+
completedContainer: {
|
|
36
|
+
borderColor: Colors.green,
|
|
37
|
+
},
|
|
38
|
+
errorContainer: {
|
|
39
|
+
borderColor: Colors.red,
|
|
40
|
+
},
|
|
41
|
+
fontStyle: {
|
|
42
|
+
flex: 1,
|
|
43
|
+
color: Colors.darkblue,
|
|
44
|
+
fontFamily: 'poppins_regular',
|
|
45
|
+
},
|
|
46
|
+
errorFontStyle: {
|
|
47
|
+
color: Colors.red,
|
|
48
|
+
},
|
|
49
|
+
placeholderStyle: {
|
|
50
|
+
fontSize: 14,
|
|
51
|
+
fontFamily: 'poppins_regular',
|
|
52
|
+
color: Colors.midblue,
|
|
53
|
+
},
|
|
54
|
+
iconStyle: {
|
|
55
|
+
marginRight: 10,
|
|
56
|
+
marginTop: 12,
|
|
57
|
+
color: Colors.darkblue,
|
|
58
|
+
},
|
|
59
|
+
itemStyle: {
|
|
60
|
+
color: Colors.darkblue,
|
|
61
|
+
fontFamily: 'poppins_regular',
|
|
62
|
+
fontSize: 16,
|
|
63
|
+
},
|
|
64
|
+
});
|