@jescon-technologies/react-native-ui-kit 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/index.js +70 -0
  2. package/package.json +25 -3
  3. package/src/Alerts/AAlert.js +1 -1
  4. package/src/HOC/ConfirmOverlay.js +192 -0
  5. package/src/HOC/HAbsolute.js +56 -0
  6. package/src/HOC/HDiscontinue.js +105 -0
  7. package/src/HOC/HHeading.js +70 -0
  8. package/src/HOC/HMoreButton.js +88 -0
  9. package/src/HOC/HNatureHeading.js +402 -0
  10. package/src/HOC/HOCIcons.js +80 -0
  11. package/src/HOC/HOverlay.js +99 -0
  12. package/src/HOC/HOverlayCentered.js +140 -0
  13. package/src/HOC/HShadowButton.js +45 -0
  14. package/src/HOC/HShadowCountButton.js +82 -0
  15. package/src/HOC/OptionOverlay.js +48 -0
  16. package/src/Media/AudioScreen.js +347 -0
  17. package/src/Media/BarcodeScan.js +145 -0
  18. package/src/Media/CAudioPlay.js +228 -0
  19. package/src/Media/CCaptureImageWithoutEdit.js +330 -0
  20. package/src/Media/CImageGallery.js +289 -0
  21. package/src/Media/CImageZoom.js +82 -0
  22. package/src/Media/CSingleImage.js +391 -0
  23. package/src/Media/CSketchCanvas.js +76 -0
  24. package/src/Media/CVideoPlay.js +31 -0
  25. package/src/Media/DocumentScreen.js +367 -0
  26. package/src/Media/DrawingScreen.js +582 -0
  27. package/src/Media/ImageScreen.js +313 -0
  28. package/src/Media/RecordAudio.js +250 -0
  29. package/src/Media/RecordVideo.js +223 -0
  30. package/src/Media/VideoScreen.js +383 -0
  31. package/src/StaticComponents/SAlphabet.js +47 -0
  32. package/src/StaticComponents/SCheckBox.js +42 -0
  33. package/src/StaticComponents/SDatePicker.js +208 -0
  34. package/src/StaticComponents/SDatePickerLabel.js +253 -0
  35. package/src/StaticComponents/SDatePickerNew.js +258 -0
  36. package/src/StaticComponents/SDateTimePickerNew.js +381 -0
  37. package/src/StaticComponents/SDropDownGenerate.js +450 -0
  38. package/src/StaticComponents/SDropDownHoc.js +636 -0
  39. package/src/StaticComponents/SDropDownIcon.js +500 -0
  40. package/src/StaticComponents/SMenuBox.js +131 -0
  41. package/src/StaticComponents/SOverlay.js +177 -0
  42. package/src/StaticComponents/SOverlayTextInput.js +109 -0
  43. package/src/StaticComponents/SSearch.js +438 -0
  44. package/src/StaticComponents/SSearchBar.js +53 -0
  45. package/src/StaticComponents/SSpeedDial.js +303 -0
  46. package/src/StaticComponents/STextInput.js +289 -0
  47. package/src/StaticComponents/STextInputProps.js +36 -0
  48. package/src/StaticComponents/STimePicker.js +171 -0
  49. package/src/StaticComponents/STimingDropDownNew.js +1589 -0
  50. package/src/StaticComponents/STimingSwitch.js +34 -0
  51. package/src/layout/CContainerView.js +21 -0
  52. package/src/layout/CDetailView.js +81 -0
  53. package/src/layout/FooterBlock.js +0 -3
  54. package/src/layout/HeaderBlock.js +353 -0
  55. package/src/index.js +0 -15
  56. package/src/screens/ForgotPassword.js +0 -346
  57. package/src/screens/Login.js +0 -328
  58. package/src/screens/Splash.js +0 -788
  59. /package/src/{components → layout}/Loader.js +0 -0
@@ -0,0 +1,82 @@
1
+ import React, { useState } from 'react';
2
+ // import { useDimensions } from '@react-native-community/hooks'
3
+ import { View, Image, TouchableOpacity, StyleSheet, Dimensions} from 'react-native';
4
+ // import ImageZoom from 'react-native-image-pan-zoom';
5
+ import ComponentStyles from '../CommonStyle/componentStyle';
6
+ import AntDesign from 'react-native-vector-icons/AntDesign';
7
+ import CModalOverlay from '../CustomComponents/CModalOverlay';
8
+
9
+ export default function CustomImageZoom(props) {
10
+ const [isloading, setIsLoading] = useState(true);
11
+ const { width, height } = Dimensions.get('window');
12
+
13
+ return (
14
+ <CModalOverlay
15
+ visible={isloading}
16
+ onClose={() => props.visibility(false)}
17
+ transparent={true}
18
+ containerStyle={getOverlayContainerStyle()}
19
+ animationDuration={500}
20
+ closeOnTouchOutside={true}
21
+ >
22
+ <View style={getCloseButtonContainer()}>
23
+ <TouchableOpacity onPress={() => props.visibility(false)}
24
+ style={{ width: '100%', alignItems: 'flex-end' }}>
25
+ <AntDesign name="close" size={30} />
26
+ </TouchableOpacity>
27
+ </View>
28
+ <View style={layoutstyles.zoom_image_container}>
29
+ {/* <ImageZoom
30
+ cropWidth={width * 0.90}
31
+ cropHeight={height * 0.85}
32
+ imageWidth={width}
33
+ imageHeight={height}
34
+ > */}
35
+ <Image
36
+ style={getZoomImageStyle()}
37
+ source={{ uri: props.image }}
38
+ />
39
+ {/* </ImageZoom> */}
40
+ </View>
41
+ </CModalOverlay>
42
+ );
43
+
44
+
45
+ function getZoomImageStyle() {
46
+ return (
47
+ {
48
+ width: width, height: height * 0.90, resizeMode: 'contain',
49
+ }
50
+ );
51
+ }
52
+ function getOverlayContainerStyle() {
53
+ return (
54
+ {
55
+ ...ComponentStyles.View_col_center,
56
+ backgroundColor: '#fff',
57
+ height: height, width: width,
58
+ }
59
+ );
60
+ }
61
+ function getCloseButtonContainer() {
62
+ return (
63
+ {
64
+ width: width * 0.90,
65
+ ...ComponentStyles.View_col_flexend,
66
+ }
67
+ );
68
+ }
69
+ }
70
+ const layoutstyles = StyleSheet.create({
71
+ close_button_style: {
72
+ height: '10%', width: 30, alignItems: 'flex-end', backgroundColor: 'black',
73
+ },
74
+ zoom_image_container: {
75
+ justifyContent: 'center',
76
+ alignItems: 'center', height: '95%',
77
+ },
78
+ });
79
+
80
+ {/**
81
+ url is passed from parent component
82
+ */}
@@ -0,0 +1,391 @@
1
+ import React, { useState, memo } from 'react';
2
+ import {
3
+ Text,
4
+ View,
5
+ Image,
6
+ TouchableOpacity,
7
+ ActivityIndicator,
8
+ StyleSheet,
9
+ Dimensions,
10
+ PermissionsAndroid,
11
+ Platform,
12
+ } from 'react-native';
13
+ import { colors } from '../CommonStyle/commonStyle';
14
+ import ComponentStyles, { normalize } from '../CommonStyle/componentStyle';
15
+ import NetworkServiceCall from '../Common/NetworkServiceCall';
16
+ import DocumentPicker from 'react-native-document-picker';
17
+ import FontAwesome from 'react-native-vector-icons/FontAwesome';
18
+ import { useNavigation } from '../Navigation/useNavigation';
19
+
20
+
21
+ import { APIURL, EMRAPI, imageURL } from '../Common/apiConstants';
22
+ import { isNU, LoaderIndicator, notifyMessage } from '../CommonStyle/ComponentFunctions';
23
+ import ReactNativeBlobUtil from 'react-native-blob-util';
24
+ //import PhotoEditor from 'react-native-photo-editor';
25
+ import { Global } from '../Common/Global';
26
+
27
+ function CSingleImage(props) {
28
+
29
+ const navigation = useNavigation();
30
+ const { width, height } = Dimensions.get('window');
31
+ const [data, setData] = useState();
32
+ const [isLoading, setIsLoading] = useState(false);
33
+ const [isMsgShow, setIsMsgShow] = useState(false);
34
+ const [Msg, setMsg] = useState(false);
35
+ const [showImage, setShowImage] = useState(props.imageurl != undefined && props.imageurl != null && props.imageurl != '' ? props.imageurl
36
+ : 'https://icon-library.com/images/no-image-icon/no-image-icon-0.jpg');
37
+ console.log('showImage', showImage);
38
+ const [pathPE, setPathPE] = useState();
39
+
40
+ const isPermitted = async () => {
41
+ if (Platform.OS === 'android') {
42
+ try {
43
+ const granted = await PermissionsAndroid.request(
44
+ PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,
45
+ );
46
+ return granted === PermissionsAndroid.RESULTS.GRANTED;
47
+ } catch (err) {
48
+ alert('Write permission error', err);
49
+ return false;
50
+ }
51
+ } else {
52
+ return true;
53
+ }
54
+ };
55
+
56
+ const getResolvedPath = async (uri, filen) => {
57
+
58
+ const fileBase64 = await ReactNativeBlobUtil.fs.readFile(uri, 'base64');
59
+ const relativePath = ReactNativeBlobUtil.fs.dirs.CacheDir;
60
+ const fileName = `${filen}`;
61
+ const path = `${relativePath}/${fileName}`;
62
+
63
+ // Create temporary file
64
+ await ReactNativeBlobUtil.fs.writeFile(path, fileBase64, 'base64');
65
+ return { relativePath, fileName, path };
66
+ };
67
+
68
+ const browseFromDevice = async () => {
69
+ if (await isPermitted()) {
70
+ try {
71
+ const fileDetails = await DocumentPicker.pick({
72
+ type: [DocumentPicker.types.images],
73
+ });
74
+ const { relativePath, fileName, path } = await getResolvedPath(
75
+ fileDetails[0].uri,
76
+ fileDetails[0].name,
77
+ );
78
+ let fileid_autogenerate = 123;
79
+ let dataset = {
80
+ fileid: fileid_autogenerate,
81
+ uri: 'file://' + path,
82
+ filename: fileDetails[0].name + Date(),
83
+ uritype: false,
84
+ };
85
+ if (Platform.OS == 'ios') {
86
+ props.route.params.onSelect({
87
+ uri: dataset.uri,
88
+ filename: 'image',
89
+ filetype: 'image/jpeg',
90
+ });
91
+ props.navigation.goBack();
92
+ }
93
+ else {
94
+ // PhotoEditor.Edit({
95
+ // path: path,
96
+ // hiddenControls: ['sticker', 'save'],
97
+ // onDone: () => {
98
+ // setPathPE(path)
99
+ // Media_Upload(dataset);
100
+ // },
101
+ // });
102
+ }
103
+ } catch (error) {
104
+ console.log('EROOROOOROROROOROROROROOROROROOROOR', error);
105
+ notifyMessage(
106
+ DocumentPicker.isCancel(error)
107
+ ? 'Canceled'
108
+ : 'Unknown Error: ' + JSON.stringify(error), 2
109
+ );
110
+ }
111
+ }
112
+ };
113
+
114
+ function getcontainerStyle() {
115
+ return {
116
+ ...layoutstyles.container_style,
117
+ width: props.width != undefined ? props.width : '38%',
118
+ };
119
+ }
120
+
121
+ // Add to folder
122
+ const Media_Upload = async item => {
123
+
124
+ setIsLoading(true);
125
+ let uniquename = '.jpg';
126
+ var formData = new FormData();
127
+ formData.append('file', {
128
+ uri: item.uri,
129
+ type: 'image/jpeg',
130
+ name: uniquename,
131
+ });
132
+ let buttonapi = props.doctorprofile ? EMRAPI.saveDoctorProfile : APIURL + 'file/fileupload/emr/image';
133
+ console.log('buttonapi', buttonapi);
134
+ NetworkServiceCall('multiform', buttonapi, formData)
135
+ .then(function (response) {
136
+ if (response.httpstatus == 200) {
137
+ if (response.data.filesize > 0) {
138
+ setData(response.data.fileuri);
139
+ if (props.doctorprofile) {
140
+ setShowImage(props.profilelink + response.data.fileuri);
141
+ }
142
+ else {
143
+ setShowImage(imageURL + response.data.fileuri);
144
+ }
145
+ props.callBack(response.data.fileuri);
146
+ setIsMsgShow(true, setMsg('Success...'));
147
+ setIsLoading(false);
148
+ setTimeout(() => {
149
+ setIsMsgShow(false);
150
+ }, 2000);
151
+ } else {
152
+ setIsLoading(false);
153
+ setIsMsgShow(true, setMsg('...'));
154
+ setTimeout(() => {
155
+ setIsMsgShow(false);
156
+ }, 2000);
157
+ }
158
+ } else {
159
+ setIsLoading(false);
160
+ setIsMsgShow(true, setMsg('..'));
161
+ setTimeout(() => {
162
+ setIsMsgShow(false);
163
+ }, 2000);
164
+ }
165
+ });
166
+ };
167
+
168
+ function CaptureImageWithoutEdit() {
169
+ // navigation.navigate('CCaptureImageWithoutEdit', {
170
+ // onSelect: Media_Upload
171
+ // });
172
+
173
+ navigation.navigate('CCaptureImageWithoutEdit', {
174
+ 'hidebuttons': false,
175
+ 'cameratype': 'back',
176
+ onSelect: (s) => s && isNU(s) ? Media_Upload(s) : null,
177
+ });
178
+ }
179
+
180
+ async function getPhotoEditor() {
181
+ console.log('SHOW IMAGE URL:', showImage);
182
+
183
+ if (!showImage) {
184
+ notifyMessage('Image URL is not available.');
185
+ return;
186
+ }
187
+
188
+ try {
189
+ // Use NetworkServiceCall to fetch the image
190
+ const response = await NetworkServiceCall('get', showImage, null, null, 60000);
191
+
192
+ if (response.httpstatus === 200 && response.data) {
193
+ const imgData = response.data; // Must be base64 or ArrayBuffer
194
+
195
+ // Save the image locally
196
+ const fileName = `photo_${Math.floor(Math.random() * 10000)}.jpg`;
197
+ const imgPath = `${ReactNativeBlobUtil.fs.dirs.CacheDir}/${fileName}`;
198
+ await ReactNativeBlobUtil.fs.writeFile(imgPath, imgData, 'base64');
199
+
200
+ console.log('The file saved to', imgPath);
201
+ setPathPE(imgPath);
202
+
203
+ const dataset = {
204
+ fileid: Math.floor(Math.random() * 10),
205
+ uri: 'file://' + imgPath,
206
+ filename: '.jpg',
207
+ uritype: false,
208
+ };
209
+
210
+ // Uncomment to use PhotoEditor
211
+ // PhotoEditor.Edit({
212
+ // path: imgPath,
213
+ // hiddenControls: ['sticker', 'save'],
214
+ // onDone: () => {
215
+ // setPathPE(imgPath);
216
+ // Media_Upload(dataset);
217
+ // },
218
+ // });
219
+ } else {
220
+ console.log('Failed to fetch image:', response);
221
+ notifyMessage('Failed to fetch image');
222
+ }
223
+ } catch (error) {
224
+ console.log('Error fetching image:', error);
225
+ notifyMessage('Image download failed');
226
+ }
227
+ }
228
+
229
+
230
+ function getTableStyle() {
231
+ return {
232
+ width: props.width != undefined ? props.width : '38%',
233
+ flexDirection: 'row',
234
+ };
235
+ }
236
+
237
+ return (
238
+ <View style={props.table != undefined ? getTableStyle() : getcontainerStyle()}>
239
+ <View style={props.table != undefined ? { flexDirection: 'row', width: normalize(65) } : {}}>
240
+ <TouchableOpacity
241
+ onPress={() => getPhotoEditor()}
242
+ disabled={Platform.OS == 'ios' && isLoading ? true : false}
243
+ style={props.table != undefined ? { borderRadius: 10 } : layoutstyles.image_container_style}>
244
+ {props.table != undefined ?
245
+ <Image style={{ width: normalize(40), height: normalize(40), borderRadius: 10 }}
246
+ source={{
247
+ uri: showImage,
248
+ headers: {
249
+ Authorization: `Bearer ${Global.JWTToken}`,
250
+ },
251
+ }}
252
+ />
253
+ :
254
+ <Image style={
255
+ props.customimagestyle ?
256
+ props.customimagestyle :
257
+ {
258
+ width: '100%',
259
+ height: normalize(110),
260
+ borderRadius: 20,
261
+ resizeMode: 'cover',
262
+ }}
263
+ source={{
264
+ uri: showImage,
265
+ headers: {
266
+ Authorization: `Bearer ${Global.JWTToken}`,
267
+ },
268
+ }}
269
+ />}
270
+ {isLoading ?
271
+ <View style={{ position: 'absolute', justifyContent: 'center', alignItems: 'center' }}>
272
+ <LoaderIndicator
273
+ />
274
+ </View>
275
+ : null}
276
+ </TouchableOpacity>
277
+
278
+ <View style={layoutstyles.options_row}>
279
+ <TouchableOpacity onPress={() => browseFromDevice()}
280
+ style={{ backgroundColor: 'transparent', width: '50%', alignItems: 'center' }}
281
+ >
282
+ <FontAwesome name="folder-open" color={Global.AppTheme.primary_color} size={25} />
283
+ </TouchableOpacity>
284
+
285
+ {props.hidephoto != undefined && props.hidephoto ? null :
286
+ <TouchableOpacity
287
+ style={{ backgroundColor: 'transparent', width: '50%', alignItems: 'center', marginLeft: 5 }}
288
+ onPress={() => CaptureImageWithoutEdit()}>
289
+ <FontAwesome name="camera" color={Global.AppTheme.primary_color} size={25} />
290
+ </TouchableOpacity>}
291
+
292
+ </View>
293
+ </View>
294
+ </View >
295
+ );
296
+ }
297
+ const layoutstyles = StyleSheet.create({
298
+ container_style: {
299
+ ...ComponentStyles.View_col_center,
300
+ padding: normalize(5),
301
+ paddingBottom: 0,
302
+ // height: normalize(165),
303
+ alignItems: 'flex-start',
304
+ },
305
+ image_container_style: {
306
+ flexDirection: 'row',
307
+ justifyContent: 'center',
308
+ alignItems: 'center',
309
+ borderColor: colors.color_componentBordercolor,
310
+ borderWidth: 1,
311
+ borderRadius: 15,
312
+ borderColor: 'lightgrey',
313
+ // height:Dimensions.get('screen').height*0.1
314
+ },
315
+ image_style: {
316
+ width: '100%',
317
+ height: normalize(110),
318
+ // resizeMode:'stretch',
319
+ borderRadius: 20,
320
+ },
321
+ options_row: {
322
+ flexDirection: 'row',
323
+ justifyContent: 'space-around',
324
+ padding: normalize(5),
325
+ paddingBottom: 0,
326
+ },
327
+ option_text: {
328
+ fontSize: normalize(12),
329
+ // color: '#000059',
330
+ color: 'white',
331
+ },
332
+ });
333
+ export default memo(CSingleImage);
334
+
335
+ // Add to folder
336
+ // const Media_Upload = async item => {
337
+ // setShowImage(item.uri)
338
+ // var formData = new FormData();
339
+ // formData.append('file', {
340
+ // uri: item.uri,
341
+ // type: item.filetype,
342
+ // name: item.filename,
343
+ // });
344
+ // NetworkServiceCall('multiform', APIURL + 'file/fileupload/patientphoto', formData)
345
+ // .then(function (response) {
346
+ // if (response.httpstatus == 200) {
347
+ // if (response.data.filesize > 0) {
348
+ // setData(response.data.fileuri);
349
+ // props.callBack(response.data.fileuri)
350
+ // setIsMsgShow(true, setMsg('Success...'));
351
+ // setTimeout(() => {
352
+ // setIsMsgShow(false);
353
+ // }, 2000);
354
+ // } else {
355
+ // setIsMsgShow(true, setMsg('...'));
356
+ // // setIsLoading(false);
357
+ // setTimeout(() => {
358
+ // setIsMsgShow(false);
359
+ // }, 2000);
360
+ // }
361
+ // } else {
362
+ // setIsMsgShow(true, setMsg('..'));
363
+ // // setIsLoading(false);
364
+ // setTimeout(() => {
365
+ // setIsMsgShow(false);
366
+ // }, 2000);
367
+ // }
368
+ // });
369
+ // };
370
+
371
+ // To browse
372
+ // async function browseFromDevice() {
373
+ // try {
374
+ // const res = await DocumentPicker.pick({
375
+ // type: [DocumentPicker.types.images],
376
+ // });
377
+ // setShowImage(res.uri)
378
+ // let dataset = {
379
+ // uri: res[0].uri,
380
+ // filetype: res[0].type,
381
+ // filename: res[0].name,
382
+ // };
383
+ // Media_Upload(dataset);
384
+ // } catch (err) {
385
+ // if (DocumentPicker.isCancel(err)) {
386
+ // // User cancelled the picker, exit any dialogs or menus and move on
387
+ // } else {
388
+ // throw err;
389
+ // }
390
+ // }
391
+ // }
@@ -0,0 +1,76 @@
1
+ import React, { useState } from 'react';
2
+ import { View, Text, StyleSheet } from 'react-native';
3
+ import SketchCanvas from '@terrylinla/react-native-sketch-canvas';
4
+
5
+
6
+ export default function CSketchCanvas(props) {
7
+ return (
8
+ <View style={styles.container}>
9
+ {/* <View style={{ flex: 1, flexDirection: 'row' }}>
10
+ <SketchCanvas
11
+ localSourceImagePath={"https://camo.githubusercontent.com/52de4f8da02befa1677e05033d6393eab9aaf6d0a3e834e193ba54a244a180e3/68747470733a2f2f692e696d6775722e636f6d2f3471706958386d2e706e67"}
12
+ containerStyle={{ backgroundColor: 'transparent', flex: 1 }}
13
+ canvasStyle={{ backgroundColor: 'transparent', flex: 1 }}
14
+ defaultStrokeIndex={0}
15
+ defaultStrokeWidth={5}
16
+ closeComponent={<View style={styles.functionButton}><Text style={{ color: 'white' }}>Close</Text></View>}
17
+ undoComponent={<View style={styles.functionButton}><Text style={{ color: 'white' }}>Undo</Text></View>}
18
+ clearComponent={<View style={styles.functionButton}><Text style={{ color: 'white' }}>Clear</Text></View>}
19
+ eraseComponent={<View style={styles.functionButton}><Text style={{ color: 'white' }}>Eraser</Text></View>}
20
+ strokeComponent={color => (
21
+ <View style={[{ backgroundColor: color }, styles.strokeColorButton]} />
22
+ )}
23
+ strokeSelectedComponent={(color, index, changed) => {
24
+ return (
25
+ <View style={[{ backgroundColor: color, borderWidth: 2 }, styles.strokeColorButton]} />
26
+ )
27
+ }}
28
+ strokeWidthComponent={(w) => {
29
+ return (<View style={styles.strokeWidthButton}>
30
+ <View style={{
31
+ backgroundColor: 'white', marginHorizontal: 2.5,
32
+ width: Math.sqrt(w / 3) * 10, height: Math.sqrt(w / 3) * 10, borderRadius: Math.sqrt(w / 3) * 10 / 2
33
+ }} />
34
+ </View>
35
+ )
36
+ }}
37
+ saveComponent={<View style={styles.functionButton}><Text style={{ color: 'white' }}>Save</Text></View>}
38
+ savePreference={() => {
39
+ return {
40
+ folder: 'RNSketchCanvas',
41
+ filename: String(Math.ceil(Math.random() * 100000000)),
42
+ transparent: false,
43
+ imageType: 'png'
44
+ }
45
+ }}
46
+ />
47
+ </View> */}
48
+
49
+ <View style={{ flex: 1, flexDirection: 'row' }}>
50
+ <SketchCanvas
51
+ localSourceImagePath={'file:///...'}
52
+ style={{ flex: 1 }}
53
+ strokeColor={'red'}
54
+ strokeWidth={7}
55
+ />
56
+ </View>
57
+ </View>
58
+ );
59
+ }
60
+
61
+ const styles = StyleSheet.create({
62
+ container: {
63
+ flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF',
64
+ },
65
+ strokeColorButton: {
66
+ marginHorizontal: 2.5, marginVertical: 8, width: 30, height: 30, borderRadius: 15,
67
+ },
68
+ strokeWidthButton: {
69
+ marginHorizontal: 2.5, marginVertical: 8, width: 30, height: 30, borderRadius: 15,
70
+ justifyContent: 'center', alignItems: 'center', backgroundColor: '#39579A',
71
+ },
72
+ functionButton: {
73
+ marginHorizontal: 2.5, marginVertical: 8, height: 30, width: 60,
74
+ backgroundColor: '#39579A', justifyContent: 'center', alignItems: 'center', borderRadius: 5,
75
+ },
76
+ });
@@ -0,0 +1,31 @@
1
+ import React, { useState } from 'react';
2
+ import { View, StatusBar } from 'react-native';
3
+ import VideoPlayer from 'react-native-video-controls';
4
+ import { useNavigation } from '../Navigation/useNavigation';
5
+
6
+
7
+ import { Global } from '../Common/Global';
8
+
9
+ export default function CVideoPlay(props) {
10
+ // console.log("videoplayer", JSON.stringify(props))
11
+ const navigation = useNavigation();
12
+
13
+ const [video, setVideo] = useState(props.route.params.video);
14
+ console.log('video',video);
15
+ return (
16
+ <View style={{ flex: 1 }}>
17
+ <StatusBar
18
+ translucent
19
+ backgroundColor={'transparent'}
20
+ barStyle="dark-content"
21
+ />
22
+ <VideoPlayer
23
+ source={{
24
+ uri: video,
25
+ headers: { Authorization: `Bearer ${Global.JWTToken}` },
26
+ }}
27
+ onBack={() => navigation.goBack()}
28
+ />
29
+ </View>
30
+ );
31
+ }