@holper/react-native-holper-storybook 0.6.102 → 0.7.1
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/LICENSE +21 -0
- package/{readme.md → README.md} +19 -20
- package/index.js +3 -2
- package/lib/components/Button/index.tsx +66 -0
- package/lib/components/Button/{style.js → style.ts} +8 -7
- package/lib/components/Card/index.tsx +33 -0
- package/lib/components/Card/{style.js → style.ts} +5 -4
- package/lib/components/ConfirmationModal/{index.js → index.tsx} +25 -79
- package/lib/components/ConfirmationModal/{style.js → style.tsx} +14 -13
- package/lib/components/Container/{index.js → index.tsx} +7 -28
- package/lib/components/Container/{style.js → style.ts} +6 -5
- package/lib/components/CustomChatView/{index.js → index.tsx} +22 -30
- package/lib/components/CustomChatView/{style.js → style.ts} +1 -1
- package/lib/components/DeckSwiper/index.tsx +90 -0
- package/lib/components/DeckSwiper/{style.js → style.ts} +13 -12
- 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.js → style.ts} +7 -6
- package/lib/components/Footer/index.tsx +35 -0
- package/lib/components/Footer/{style.js → style.ts} +4 -3
- package/lib/components/Header/index.tsx +21 -0
- package/lib/components/Header/{style.js → style.ts} +4 -3
- package/lib/components/ImagePicker/{index.js → index.tsx} +3 -12
- 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.js → style.ts} +4 -3
- package/lib/components/Input/{index.js → index.tsx} +6 -33
- package/lib/components/Input/{style.js → style.ts} +7 -18
- package/lib/components/InputPin/{index.js → index.tsx} +6 -13
- package/lib/components/InputPin/{style.js → style.ts} +7 -6
- package/lib/components/MenuItem/index.tsx +25 -0
- package/lib/components/MenuItem/{style.js → style.ts} +9 -7
- package/lib/components/NavigationTitle/{index.js → index.tsx} +9 -30
- package/lib/components/NavigationTitle/{style.js → style.ts} +12 -11
- package/lib/components/Notification/index.tsx +44 -0
- package/lib/components/Notification/{style.js → style.ts} +13 -11
- 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.js → index.tsx} +58 -85
- package/lib/components/SwipeablePanel/{style.js → style.ts} +15 -14
- package/lib/components/Switch/index.tsx +30 -0
- package/lib/components/TakePicture/{confirmPictureModal.js → confirmPictureModal.tsx} +9 -33
- package/lib/components/TakePicture/index.tsx +148 -0
- package/lib/components/TakePicture/{style.js → style.ts} +4 -4
- package/lib/components/Text/index.tsx +33 -0
- package/lib/components/Text/{style.js → style.ts} +4 -2
- package/lib/components/Textarea/{index.js → index.tsx} +5 -24
- package/lib/components/Textarea/{style.js → style.ts} +5 -4
- package/lib/components/TimeOutButton/index.tsx +67 -0
- package/lib/components/TimeOutButton/{style.js → style.ts} +4 -3
- package/lib/components/Toast/index.tsx +34 -0
- package/lib/components/Toast/style.ts +12 -0
- package/lib/components/UploadDocument/{index.js → index.tsx} +49 -105
- package/lib/components/UploadDocument/{style.js → style.ts} +16 -15
- package/lib/components/VirtualKeyboard/index.tsx +75 -0
- package/lib/components/VirtualKeyboard/{style.js → style.ts} +9 -8
- package/lib/components/index.ts +29 -0
- package/lib/configs/{constants.js → constants.ts} +50 -48
- package/lib/configs/types.ts +326 -0
- package/lib/hooks/index.ts +2 -0
- package/lib/hooks/{useDebounce.js → useDebounce.tsx} +6 -4
- package/lib/hooks/useLoadFonts.tsx +13 -0
- package/lib/index.js +3 -2
- package/package.json +72 -59
- 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/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
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { forwardRef, useEffect, useImperativeHandle, useState } from 'react';
|
|
2
|
+
import { Dimensions, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import style from './style';
|
|
5
|
+
|
|
6
|
+
import type { TimeOutButtonProps } from '../../configs/types';
|
|
7
|
+
|
|
8
|
+
const { width } = Dimensions.get('window');
|
|
9
|
+
const BUTTON_WIDTH = width * 0.6;
|
|
10
|
+
|
|
11
|
+
const TimeOutButton = forwardRef(({ onPress, time = 3000, warning, children }: TimeOutButtonProps, ref) => {
|
|
12
|
+
const [elapsedTime, setElapsedTime] = useState<number>(0);
|
|
13
|
+
const [interval, setLocalInterval] = useState<NodeJS.Timeout | undefined>(undefined);
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
let isCancelled = false;
|
|
17
|
+
const timer = setInterval(() => {
|
|
18
|
+
if (!isCancelled) {
|
|
19
|
+
setElapsedTime((prevElapsedTime) => prevElapsedTime + 1);
|
|
20
|
+
}
|
|
21
|
+
}, 1);
|
|
22
|
+
setLocalInterval(timer);
|
|
23
|
+
|
|
24
|
+
return () => {
|
|
25
|
+
clearInterval(timer);
|
|
26
|
+
isCancelled = true;
|
|
27
|
+
};
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
useImperativeHandle(ref, () => ({
|
|
31
|
+
onStop() {
|
|
32
|
+
clearInterval(interval);
|
|
33
|
+
},
|
|
34
|
+
}));
|
|
35
|
+
|
|
36
|
+
const watchInterval = () => {
|
|
37
|
+
if (elapsedTime >= time) {
|
|
38
|
+
clearInterval(interval);
|
|
39
|
+
if (onPress) onPress();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return elapsedTime <= time ? (BUTTON_WIDTH * (time - elapsedTime)) / time : BUTTON_WIDTH;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const checkWarningPercent = () => (elapsedTime <= time ? time * 0.3 > time - elapsedTime : false);
|
|
46
|
+
|
|
47
|
+
const onLocalPress = () => {
|
|
48
|
+
setElapsedTime(time);
|
|
49
|
+
clearInterval(interval);
|
|
50
|
+
if (onPress) onPress();
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<TouchableOpacity style={[style.button, style.buttonBg]} onPress={onLocalPress}>
|
|
55
|
+
<View
|
|
56
|
+
style={[
|
|
57
|
+
style.button,
|
|
58
|
+
warning ? (checkWarningPercent() ? style.buttonOverlayWarning : style.buttonOverlay) : style.buttonOverlay,
|
|
59
|
+
{ width: watchInterval() },
|
|
60
|
+
]}
|
|
61
|
+
/>
|
|
62
|
+
{children}
|
|
63
|
+
</TouchableOpacity>
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export default TimeOutButton;
|
|
@@ -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
|
// Default button shape
|
|
8
9
|
button: {
|
|
9
10
|
margin: 8,
|
|
@@ -38,4 +39,4 @@ export default {
|
|
|
38
39
|
left: -10,
|
|
39
40
|
backgroundColor: Colors.red,
|
|
40
41
|
},
|
|
41
|
-
};
|
|
42
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
2
|
+
import { toast, Toaster } from 'sonner-native';
|
|
3
|
+
|
|
4
|
+
import { Colors } from '../../configs/constants';
|
|
5
|
+
import style from './style';
|
|
6
|
+
|
|
7
|
+
import type { ToastMessageProps } from '../../configs/types';
|
|
8
|
+
|
|
9
|
+
const Toast = () => (
|
|
10
|
+
<Toaster
|
|
11
|
+
autoWiggleOnUpdate="toast-change"
|
|
12
|
+
closeButton
|
|
13
|
+
duration={3000}
|
|
14
|
+
icons={{
|
|
15
|
+
error: <Ionicons name="alert-circle-outline" color={Colors.darkred} size={30} />,
|
|
16
|
+
success: <Ionicons name="checkmark-circle-outline" color={Colors.darkgreen} size={30} />,
|
|
17
|
+
}}
|
|
18
|
+
pauseWhenPageIsHidden
|
|
19
|
+
position="top-center"
|
|
20
|
+
richColors
|
|
21
|
+
swipeToDismissDirection="up"
|
|
22
|
+
visibleToasts={4}
|
|
23
|
+
toastOptions={{
|
|
24
|
+
titleStyle: style.titleStyle,
|
|
25
|
+
descriptionStyle: style.descriptionStyle,
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export const sendMessage = ({ variant, message, description }: ToastMessageProps) => {
|
|
31
|
+
toast[variant](message, { description });
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default Toast;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
4
|
-
View,
|
|
5
|
-
TouchableOpacity,
|
|
6
|
-
ActivityIndicator,
|
|
7
|
-
Platform,
|
|
8
|
-
} from 'react-native';
|
|
9
|
-
import * as MediaLibrary from 'expo-media-library';
|
|
10
1
|
import * as ExpoImagePicker from 'expo-image-picker';
|
|
11
|
-
import
|
|
2
|
+
import * as MediaLibrary from 'expo-media-library';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { ActivityIndicator, Platform, TouchableOpacity, View } from 'react-native';
|
|
5
|
+
|
|
6
|
+
import { Colors } from '../../configs/constants';
|
|
12
7
|
import Button from '../Button';
|
|
13
8
|
import ConfirmationModal from '../ConfirmationModal';
|
|
14
9
|
import ImagePicker from '../ImagePicker';
|
|
15
10
|
import ImageViewer from '../ImageViewer';
|
|
16
11
|
import TakePicture from '../TakePicture';
|
|
17
|
-
import
|
|
12
|
+
import Text from '../Text';
|
|
18
13
|
import style from './style';
|
|
19
14
|
|
|
15
|
+
import type { UploadDocumentProps } from '../../configs/types';
|
|
16
|
+
|
|
20
17
|
const iOS = Platform.OS === 'ios';
|
|
21
18
|
|
|
22
19
|
const UploadDocument = ({
|
|
@@ -33,17 +30,19 @@ const UploadDocument = ({
|
|
|
33
30
|
onSelectImage,
|
|
34
31
|
file,
|
|
35
32
|
onPermissionDenied,
|
|
36
|
-
}) => {
|
|
37
|
-
const [showMediaModal, setShowMediaModal] = useState(false);
|
|
38
|
-
const [showCamera, setShowCamera] = useState(false);
|
|
39
|
-
const [image, setImage] = useState(
|
|
40
|
-
const [loading, setLoading] = useState(true);
|
|
33
|
+
}: UploadDocumentProps) => {
|
|
34
|
+
const [showMediaModal, setShowMediaModal] = useState<boolean>(false);
|
|
35
|
+
const [showCamera, setShowCamera] = useState<boolean>(false);
|
|
36
|
+
const [image, setImage] = useState<string | { uri: string }>();
|
|
37
|
+
const [loading, setLoading] = useState<boolean>(true);
|
|
41
38
|
|
|
42
39
|
useEffect(() => {
|
|
43
40
|
(async () => {
|
|
44
|
-
iOS
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
if (iOS) {
|
|
42
|
+
await MediaLibrary.requestPermissionsAsync();
|
|
43
|
+
} else {
|
|
44
|
+
await ExpoImagePicker.getMediaLibraryPermissionsAsync();
|
|
45
|
+
}
|
|
47
46
|
})();
|
|
48
47
|
}, []);
|
|
49
48
|
|
|
@@ -51,9 +50,17 @@ const UploadDocument = ({
|
|
|
51
50
|
if (!image) {
|
|
52
51
|
setImage(file);
|
|
53
52
|
}
|
|
54
|
-
}, [file]);
|
|
53
|
+
}, [file, image]);
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
interface PickUploadMethodParams {
|
|
56
|
+
method: 'camera' | 'gallery' | string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface GalleryPermissionResult {
|
|
60
|
+
status: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const pickUploadMethod = async (method: PickUploadMethodParams['method']): Promise<void> => {
|
|
57
64
|
setShowMediaModal(false);
|
|
58
65
|
|
|
59
66
|
switch (method) {
|
|
@@ -64,17 +71,21 @@ const UploadDocument = ({
|
|
|
64
71
|
break;
|
|
65
72
|
case 'gallery':
|
|
66
73
|
setTimeout(async () => {
|
|
67
|
-
const { status: galleryStatus } = iOS
|
|
74
|
+
const { status: galleryStatus }: GalleryPermissionResult = iOS
|
|
68
75
|
? await MediaLibrary.requestPermissionsAsync()
|
|
69
76
|
: await ExpoImagePicker.getMediaLibraryPermissionsAsync();
|
|
70
77
|
|
|
71
78
|
if (galleryStatus !== 'granted' && iOS) {
|
|
72
|
-
onPermissionDenied
|
|
79
|
+
if (onPermissionDenied) {
|
|
80
|
+
onPermissionDenied();
|
|
81
|
+
}
|
|
73
82
|
return;
|
|
74
83
|
}
|
|
75
84
|
|
|
76
|
-
const
|
|
77
|
-
|
|
85
|
+
const pickedImage = await ImagePicker(isAvatarPicker);
|
|
86
|
+
if (pickedImage !== undefined) {
|
|
87
|
+
selectImage(pickedImage);
|
|
88
|
+
}
|
|
78
89
|
}, 500);
|
|
79
90
|
break;
|
|
80
91
|
default:
|
|
@@ -82,9 +93,11 @@ const UploadDocument = ({
|
|
|
82
93
|
}
|
|
83
94
|
};
|
|
84
95
|
|
|
85
|
-
const selectImage = (
|
|
86
|
-
setImage(
|
|
87
|
-
onSelectImage
|
|
96
|
+
const selectImage = (selectedImage: any) => {
|
|
97
|
+
setImage(selectedImage);
|
|
98
|
+
if (onSelectImage) {
|
|
99
|
+
onSelectImage(selectedImage);
|
|
100
|
+
}
|
|
88
101
|
};
|
|
89
102
|
|
|
90
103
|
return (
|
|
@@ -97,28 +110,18 @@ const UploadDocument = ({
|
|
|
97
110
|
uri: typeof image === 'object' ? image.uri : image,
|
|
98
111
|
}}
|
|
99
112
|
style={style.image}
|
|
100
|
-
resizeMode=
|
|
113
|
+
resizeMode="cover"
|
|
101
114
|
avatar
|
|
102
115
|
onLoadEnd={() => setLoading(false)}
|
|
103
116
|
/>
|
|
104
|
-
{loading &&
|
|
105
|
-
<ActivityIndicator
|
|
106
|
-
style={style.imageSpinner}
|
|
107
|
-
animating={loading}
|
|
108
|
-
color={Colors.darkblue}
|
|
109
|
-
/>
|
|
110
|
-
)}
|
|
117
|
+
{loading && <ActivityIndicator style={style.imageSpinner} animating={loading} color={Colors.darkblue} />}
|
|
111
118
|
</View>
|
|
112
119
|
<View style={style.reUploadButtons}>
|
|
113
|
-
<Text
|
|
114
|
-
style={style.titleUploaded}
|
|
115
|
-
numberOfLines={1}
|
|
116
|
-
ellipsizeMode='tail'
|
|
117
|
-
>
|
|
120
|
+
<Text style={style.titleUploaded} numberOfLines={1} ellipsizeMode="tail">
|
|
118
121
|
{title}
|
|
119
122
|
</Text>
|
|
120
123
|
<TouchableOpacity onPress={() => setShowMediaModal(true)}>
|
|
121
|
-
<Text size=
|
|
124
|
+
<Text size="tiny" style={style.reUpload}>
|
|
122
125
|
{reUploadButtonText}
|
|
123
126
|
</Text>
|
|
124
127
|
</TouchableOpacity>
|
|
@@ -127,19 +130,14 @@ const UploadDocument = ({
|
|
|
127
130
|
) : (
|
|
128
131
|
<View style={style.noUploaded}>
|
|
129
132
|
{icon}
|
|
130
|
-
<Text
|
|
131
|
-
size='large'
|
|
132
|
-
style={style.title}
|
|
133
|
-
numberOfLines={1}
|
|
134
|
-
ellipsizeMode='tail'
|
|
135
|
-
>
|
|
133
|
+
<Text size="large" style={style.title} numberOfLines={1} ellipsizeMode="tail">
|
|
136
134
|
{title}
|
|
137
135
|
</Text>
|
|
138
|
-
<Text size=
|
|
136
|
+
<Text size="small" style={style.description}>
|
|
139
137
|
{description}
|
|
140
138
|
</Text>
|
|
141
|
-
<Button variant='
|
|
142
|
-
<Text>{uploadButtonText}</Text>
|
|
139
|
+
<Button variant={inverted ? 'inverted' : 'primary'} onPress={() => setShowMediaModal(true)}>
|
|
140
|
+
<Text color="white">{uploadButtonText}</Text>
|
|
143
141
|
</Button>
|
|
144
142
|
</View>
|
|
145
143
|
)}
|
|
@@ -178,58 +176,4 @@ const UploadDocument = ({
|
|
|
178
176
|
);
|
|
179
177
|
};
|
|
180
178
|
|
|
181
|
-
UploadDocument.defaultProps = {
|
|
182
|
-
title: ' ',
|
|
183
|
-
description: ' ',
|
|
184
|
-
uploadButtonText: ' ',
|
|
185
|
-
reUploadButtonText: ' ',
|
|
186
|
-
completed: false,
|
|
187
|
-
inverted: false,
|
|
188
|
-
isAvatarPicker: false,
|
|
189
|
-
icon: null,
|
|
190
|
-
onSelectImage: () => {},
|
|
191
|
-
file: null,
|
|
192
|
-
onPermissionDenied: () => {},
|
|
193
|
-
mediaModal: {
|
|
194
|
-
title: ' ',
|
|
195
|
-
confirmText: ' ',
|
|
196
|
-
cancelText: ' ',
|
|
197
|
-
description: ' ',
|
|
198
|
-
},
|
|
199
|
-
takePicture: {
|
|
200
|
-
cameraErrorMessage: ' ',
|
|
201
|
-
requestPermissionsMessage: ' ',
|
|
202
|
-
processingPictureMessage: ' ',
|
|
203
|
-
repeatPictureText: ' ',
|
|
204
|
-
usePictureText: ' ',
|
|
205
|
-
},
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
UploadDocument.propTypes = {
|
|
209
|
-
title: PropTypes.string,
|
|
210
|
-
description: PropTypes.string,
|
|
211
|
-
uploadButtonText: PropTypes.string,
|
|
212
|
-
reUploadButtonText: PropTypes.string,
|
|
213
|
-
completed: PropTypes.bool,
|
|
214
|
-
inverted: PropTypes.bool,
|
|
215
|
-
isAvatarPicker: PropTypes.bool,
|
|
216
|
-
icon: PropTypes.node,
|
|
217
|
-
onSelectImage: PropTypes.func,
|
|
218
|
-
file: PropTypes.string,
|
|
219
|
-
onPermissionDenied: PropTypes.func,
|
|
220
|
-
mediaModal: PropTypes.shape({
|
|
221
|
-
title: PropTypes.string,
|
|
222
|
-
confirmText: PropTypes.string,
|
|
223
|
-
cancelText: PropTypes.string,
|
|
224
|
-
description: PropTypes.string,
|
|
225
|
-
}),
|
|
226
|
-
takePicture: PropTypes.shape({
|
|
227
|
-
cameraErrorMessage: PropTypes.string,
|
|
228
|
-
requestPermissionsMessage: PropTypes.string,
|
|
229
|
-
processingPictureMessage: PropTypes.string,
|
|
230
|
-
repeatPictureText: PropTypes.string,
|
|
231
|
-
usePictureText: PropTypes.string,
|
|
232
|
-
}),
|
|
233
|
-
};
|
|
234
|
-
|
|
235
179
|
export default UploadDocument;
|
|
@@ -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
|
borderWidth: 1,
|
|
9
10
|
borderColor: Colors.dimgray,
|
|
@@ -11,46 +12,46 @@ export default {
|
|
|
11
12
|
width: width - 80,
|
|
12
13
|
padding: 15,
|
|
13
14
|
justifyContent: 'center',
|
|
14
|
-
overflow: 'hidden'
|
|
15
|
+
overflow: 'hidden',
|
|
15
16
|
},
|
|
16
17
|
containerCompleted: {
|
|
17
|
-
borderColor: Colors.green
|
|
18
|
+
borderColor: Colors.green,
|
|
18
19
|
},
|
|
19
20
|
noUploaded: {
|
|
20
|
-
alignItems: 'center'
|
|
21
|
+
alignItems: 'center',
|
|
21
22
|
},
|
|
22
23
|
title: {
|
|
23
|
-
marginTop: 5
|
|
24
|
+
marginTop: 5,
|
|
24
25
|
},
|
|
25
26
|
titleUploaded: {
|
|
26
27
|
marginTop: 5,
|
|
27
|
-
width: width - 225
|
|
28
|
+
width: width - 225,
|
|
28
29
|
},
|
|
29
30
|
description: {
|
|
30
|
-
marginBottom: 20
|
|
31
|
+
marginBottom: 20,
|
|
31
32
|
},
|
|
32
33
|
uploadedContainer: {
|
|
33
34
|
flexDirection: 'row',
|
|
34
35
|
alignItems: 'center',
|
|
35
|
-
justifyContent: 'flex-start'
|
|
36
|
+
justifyContent: 'flex-start',
|
|
36
37
|
},
|
|
37
38
|
image: {
|
|
38
39
|
width: 100,
|
|
39
40
|
height: 100,
|
|
40
41
|
borderColor: Colors.dimgray,
|
|
41
|
-
borderWidth: 1
|
|
42
|
+
borderWidth: 1,
|
|
42
43
|
},
|
|
43
44
|
imageSpinner: {
|
|
44
45
|
position: 'absolute',
|
|
45
46
|
left: 0,
|
|
46
47
|
right: 0,
|
|
47
48
|
top: 0,
|
|
48
|
-
bottom: 0
|
|
49
|
+
bottom: 0,
|
|
49
50
|
},
|
|
50
51
|
reUpload: {
|
|
51
|
-
textDecorationLine: 'underline'
|
|
52
|
+
textDecorationLine: 'underline',
|
|
52
53
|
},
|
|
53
54
|
reUploadButtons: {
|
|
54
|
-
marginLeft: 15
|
|
55
|
-
}
|
|
56
|
-
}
|
|
55
|
+
marginLeft: 15,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
2
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import Text from '../Text';
|
|
5
|
+
import style from './style';
|
|
6
|
+
|
|
7
|
+
import type { VirtualKeyboardProps } from '../../configs/types';
|
|
8
|
+
|
|
9
|
+
const keys = [
|
|
10
|
+
{
|
|
11
|
+
key: <Text size="extra-large">1</Text>,
|
|
12
|
+
value: 1,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
key: <Text size="extra-large">2</Text>,
|
|
16
|
+
value: 2,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
key: <Text size="extra-large">3</Text>,
|
|
20
|
+
value: 3,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: <Text size="extra-large">4</Text>,
|
|
24
|
+
value: 4,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: <Text size="extra-large">5</Text>,
|
|
28
|
+
value: 5,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: <Text size="extra-large">6</Text>,
|
|
32
|
+
value: 6,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: <Text size="extra-large">7</Text>,
|
|
36
|
+
value: 7,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: <Text size="extra-large">8</Text>,
|
|
40
|
+
value: 8,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: <Text size="extra-large">9</Text>,
|
|
44
|
+
value: 9,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: <Ionicons name="finger-print-outline" style={style.icon} />,
|
|
48
|
+
value: 'biometrics',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: <Text size="extra-large">0</Text>,
|
|
52
|
+
value: 0,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: <Ionicons name="backspace-outline" style={style.icon} />,
|
|
56
|
+
value: 'back',
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
const VirtualKeyboard = ({ onPress, hideBiometrics }: VirtualKeyboardProps) => (
|
|
61
|
+
<View style={style.container}>
|
|
62
|
+
{keys.map(({ key, value }) => (
|
|
63
|
+
<TouchableOpacity
|
|
64
|
+
key={`key-${value}`}
|
|
65
|
+
style={style.button}
|
|
66
|
+
onPress={() => onPress(value === 'biometrics' && hideBiometrics ? null : value)}
|
|
67
|
+
disabled={value === 'biometrics' && hideBiometrics}
|
|
68
|
+
>
|
|
69
|
+
{value === 'biometrics' && hideBiometrics ? <Text> </Text> : key}
|
|
70
|
+
</TouchableOpacity>
|
|
71
|
+
))}
|
|
72
|
+
</View>
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
export default VirtualKeyboard;
|
|
@@ -1,24 +1,25 @@
|
|
|
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
|
width,
|
|
9
10
|
flexDirection: 'row',
|
|
10
11
|
flexWrap: 'wrap',
|
|
11
|
-
justifyContent: 'center'
|
|
12
|
+
justifyContent: 'center',
|
|
12
13
|
},
|
|
13
14
|
button: {
|
|
14
15
|
width: width / 3.3,
|
|
15
16
|
height: width / 5,
|
|
16
17
|
justifyContent: 'center',
|
|
17
|
-
alignItems: 'center'
|
|
18
|
+
alignItems: 'center',
|
|
18
19
|
},
|
|
19
20
|
icon: {
|
|
20
21
|
color: Colors.darkblue,
|
|
21
|
-
opacity: .6,
|
|
22
|
-
fontSize: 34
|
|
23
|
-
}
|
|
24
|
-
};
|
|
22
|
+
opacity: 0.6,
|
|
23
|
+
fontSize: 34,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { default as Button } from './Button';
|
|
2
|
+
export { default as Card } from './Card';
|
|
3
|
+
export { default as ConfirmationModal } from './ConfirmationModal';
|
|
4
|
+
export { default as Container } from './Container';
|
|
5
|
+
export { default as CustomChatView } from './CustomChatView';
|
|
6
|
+
export { default as DeckSwiper } from './DeckSwiper';
|
|
7
|
+
export { default as DonutCountdown } from './DonutCountdown';
|
|
8
|
+
export { default as FloatingContainer } from './FloatingContainer';
|
|
9
|
+
export { default as Footer } from './Footer';
|
|
10
|
+
export { default as Header } from './Header';
|
|
11
|
+
export { default as ImagePicker } from './ImagePicker';
|
|
12
|
+
export { default as ImageResponsive } from './ImageResponsive';
|
|
13
|
+
export { default as ImageViewer } from './ImageViewer';
|
|
14
|
+
export { default as Input } from './Input';
|
|
15
|
+
export { default as InputPin } from './InputPin';
|
|
16
|
+
export { default as MenuItem } from './MenuItem';
|
|
17
|
+
export { default as NavigationTitle } from './NavigationTitle';
|
|
18
|
+
export { default as Notification } from './Notification';
|
|
19
|
+
export { default as withPreventDoubleClick } from './PreventDoubleClick';
|
|
20
|
+
export { default as Select } from './Select';
|
|
21
|
+
export { default as SwipeablePanel } from './SwipeablePanel';
|
|
22
|
+
export { default as Switch } from './Switch';
|
|
23
|
+
export { default as TakePicture } from './TakePicture';
|
|
24
|
+
export { default as Text } from './Text';
|
|
25
|
+
export { default as Textarea } from './Textarea';
|
|
26
|
+
export { default as TimeOutButton } from './TimeOutButton';
|
|
27
|
+
export { sendMessage, default as Toast } from './Toast';
|
|
28
|
+
export { default as UploadDocument } from './UploadDocument';
|
|
29
|
+
export { default as VirtualKeyboard } from './VirtualKeyboard';
|