@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,402 @@
1
+ import React, { memo, useState } from 'react';
2
+ import { View, TouchableOpacity, Text, FlatList, ScrollView } from 'react-native';
3
+ import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
4
+ import { normalize } from '../CommonStyle/componentStyle';
5
+ import CText from '../CustomComponents/CText';
6
+ import HOCIcons from './HOCIcons';
7
+ import { Global } from '../Common/Global';
8
+ import { CButtonShadow,isBNUL, isNU, isNUQ } from '../CommonStyle/ComponentFunctions';
9
+ import HShadowButton from './HShadowButton';
10
+ import HMoreButton from './HMoreButton';
11
+
12
+ function HNatureHeading(props) {
13
+
14
+
15
+ const deletebutton = 5;
16
+ const notebutton = 6;
17
+ const instructionbutton = 7;
18
+ const commentbutton = 8;
19
+ const commentbutton2 = 9;
20
+
21
+ const imagebutton = 3;
22
+ const videobutton = 3;
23
+ const audiobutton = 3;
24
+ const documentbutton = 3;
25
+
26
+
27
+ const [showButtons, setShowButtons] = useState({
28
+ 'mediabuttons': false,
29
+ 'detailbuttons': false,
30
+ });
31
+
32
+ const styles = props.styles != undefined ? props.styles : {
33
+ 'iconname': 'file',
34
+ 'bgcolor': '#f2efef',
35
+ 'iconsize': 18,
36
+ 'iconcolor': 'black',
37
+ 'displaytext': 'Testing',
38
+ 'textsize': 15,
39
+ 'textcolor': 'darkblue',
40
+ };
41
+
42
+ function CheckDeleteButton(array) { //delete button
43
+
44
+ let prevcodearray = array.filter((i, k) => { return i.buttonflag == deletebutton ? { ...i } : undefined; });
45
+ let prevcode = isBNUL(prevcodearray) ? prevcodearray[0] : false;
46
+ return prevcode;
47
+
48
+ }
49
+
50
+
51
+ function groupMediaIcons(array) { // image video audio
52
+
53
+ let prevcodearray = array.filter((i, k) => { return (i.buttonflag == imagebutton || i.buttonflag == videobutton || i.buttonflag == audiobutton || i.buttonflag == documentbutton) ? { ...i } : undefined; });
54
+ let prevcode = isBNUL(prevcodearray) ? prevcodearray : [];
55
+ return prevcode;
56
+
57
+ }
58
+
59
+ function groupEntryIcons(array) { // notes instructions comments
60
+
61
+ let prevcodearray = array.filter((i, k) => { return (i.buttonflag == notebutton || i.buttonflag == instructionbutton || i.buttonflag == commentbutton || i.buttonflag == commentbutton2) ? { ...i } : undefined; });
62
+ let prevcode = isBNUL(prevcodearray) ? prevcodearray : [];
63
+ return prevcode;
64
+
65
+ }
66
+
67
+ function renderList(val) {
68
+
69
+ return (
70
+ <HShadowButton
71
+ useicon={true}
72
+ // usetext={true}
73
+ buttonstyle={{
74
+ margin: normalize(4),
75
+ borderLeftWidth: 0,
76
+ borderBottomWidth: 0,
77
+ borderRadius: 5,
78
+ borderWidth: 0,
79
+ borderColor: Global.AppTheme.primary_color,
80
+ justifyContent: 'center',
81
+ alignItems: 'center',
82
+ backgroundColor: 'white',
83
+ height: normalize(20),
84
+ width: normalize(20),
85
+ ...CButtonShadow(),
86
+ }}
87
+ iconcolor={Global.AppTheme.primary_color}
88
+ iconname={isNU(val.iconname) ? val.iconname : 'file-alt'}
89
+ iconsize={normalize(15)}
90
+ iconstyle={{textAlign:'center'}}
91
+ displaytext={isNUQ(val.name) ? val.name : null}
92
+ buttonCallback={() => {
93
+ props.moreCallBack(val);
94
+ }}
95
+ textstyle={{
96
+ color: Global.AppTheme.primary_color,
97
+ fontSize: normalize(7),
98
+ textAlign: 'center',
99
+ }}
100
+ />
101
+ );
102
+
103
+ }
104
+
105
+ return (
106
+ <View style={{
107
+ // backgroundColor: styles.bgcolor != undefined ? styles.bgcolor : '#f2efef',
108
+ }}>
109
+ <TouchableOpacity
110
+ onPress={() => props.callBack(true)}
111
+ style={{
112
+ // backgroundColor: styles.bgcolor != undefined ? styles.bgcolor : '#f2efef',
113
+ flexDirection: 'row',
114
+ alignItems: 'center',
115
+ // paddingVertical: normalize(3)
116
+ }}>
117
+ <TouchableOpacity
118
+ onPress={() => props.Expand != undefined ? props.Expand(1) : null}
119
+ disabled={props.Expand != undefined ? false : true}
120
+ style={{
121
+ width: normalize(30),
122
+ alignItems: 'center',
123
+ }}
124
+ >
125
+ <FontAwesome5 name={styles.iconname} color={styles.iconcolor}
126
+ size={normalize(styles.iconsize)} />
127
+ </TouchableOpacity>
128
+ <Text
129
+ numberOfLines={1}
130
+ adjustsFontSizeToFit={true}
131
+ style={{
132
+ flex: 1,
133
+ borderWidth: 0,
134
+ textShadowRadius: 2,
135
+ fontSize: normalize(styles.textsize),
136
+ fontWeight: 'bold',
137
+ color: styles.textcolor,
138
+ }}>
139
+ {styles.displaytext}
140
+ </Text>
141
+ {isBNUL(props.moreButtonArray) ?
142
+ <HMoreButton
143
+ styles={{
144
+ 'iconname': 'dots-vertical',
145
+ 'iconsize': 23,
146
+ 'iconcolor': Global.AppTheme.primary_color,
147
+ 'textsize': 9,
148
+ 'textcolor': Global.AppTheme.primary_color,
149
+ }}
150
+ moreButtonArray={props.moreButtonArray}
151
+ // callBack={val => (val == undefined ? null : getHeaderMoreButtonPress(val, item))} />
152
+ callBack={val => (val == undefined ? null :
153
+ // getSelection(val, item, index)
154
+ props.moreCallBack(val)
155
+ )}
156
+ />
157
+ : null}
158
+ {isBNUL(props.moreButtonArray) && CheckDeleteButton(props.moreButtonArray) ?
159
+ <View style={{ borderWidth: 0 }}>
160
+ <HShadowButton // DELETE BUTTON
161
+ useicon={true}
162
+ // usetext={true}
163
+ buttonstyle={{
164
+ margin: normalize(2),
165
+ padding: normalize(2),
166
+ borderLeftWidth: 0,
167
+ borderBottomWidth: 0,
168
+ borderRadius: 5,
169
+ borderWidth: 0,
170
+ borderColor: Global.AppTheme.primary_color,
171
+ justifyContent: 'center',
172
+ alignItems: 'center',
173
+ backgroundColor: 'white',
174
+ height: normalize(20),
175
+ width: normalize(20),
176
+ ...CButtonShadow(),
177
+ }}
178
+ iconcolor={'#bb3030'}
179
+ iconname={isNU(CheckDeleteButton(props.moreButtonArray).iconname) ? CheckDeleteButton(props.moreButtonArray).iconname : 'file-alt'}
180
+ iconsize={normalize(15)}
181
+ textstyle={{
182
+ color: Global.AppTheme.primary_color,
183
+ fontSize: normalize(5),
184
+ textAlign: 'center',
185
+ }}
186
+ displaytext={isNUQ(CheckDeleteButton(props.moreButtonArray).name) ? CheckDeleteButton(props.moreButtonArray).name : null}
187
+ buttonCallback={() => {
188
+ props.moreCallBack(CheckDeleteButton(props.moreButtonArray));
189
+ }}
190
+ />
191
+ </View>
192
+ : null}
193
+
194
+ </TouchableOpacity>
195
+ {isBNUL(props.moreButtonArray) ?
196
+ <ScrollView
197
+ showsHorizontalScrollIndicator={false}
198
+ showsVerticalScrollIndicator={false}
199
+ horizontal={true}
200
+ >
201
+ <View style={{ flexDirection: 'row', marginVertical: normalize(4) }}>
202
+ {props.moreButtonArray.map((val) => {
203
+ return val.buttonflag == deletebutton || // DELETE BUTTON
204
+ val.buttonflag == notebutton || // NOTES
205
+ val.buttonflag == instructionbutton || // INSTRUCTIONS
206
+ val.buttonflag == commentbutton || // COMMENTS
207
+ val.buttonflag == commentbutton2 || // COMMENTS 2
208
+ val.buttonflag == imagebutton || // IMAGE
209
+ val.buttonflag == videobutton || // VIDEO
210
+ val.buttonflag == audiobutton || // AUDIO
211
+ val.buttonflag == documentbutton // DOCUMENTS
212
+ ? null : (
213
+ renderList(val)
214
+ );
215
+ })}
216
+ {isBNUL(groupMediaIcons(props.moreButtonArray)) ? // image,audio, video, document
217
+
218
+ <TouchableOpacity
219
+ onPress={() => {
220
+ setShowButtons(prevstate => {
221
+ return {
222
+ ...prevstate,
223
+ mediabuttons: !prevstate.mediabuttons,
224
+ };
225
+ });
226
+ }}
227
+ style={{
228
+ borderWidth: 0,
229
+ flexDirection: 'row',
230
+ margin: normalize(4),
231
+ padding: normalize(4),
232
+ borderLeftWidth: 0,
233
+ borderBottomWidth: 0,
234
+ borderRadius: 5,
235
+ borderColor: Global.AppTheme.primary_color,
236
+ justifyContent: 'space-evenly',
237
+ alignItems: 'center',
238
+ backgroundColor: 'white',
239
+ ...CButtonShadow(),
240
+ height: normalize(20),
241
+ width: normalize(40),
242
+ }}>
243
+
244
+ <HShadowButton
245
+ useicon={true}
246
+ // usetext={true}
247
+ buttonstyle={{
248
+ borderWidth: 0,
249
+ justifyContent: 'center',
250
+ alignItems: 'center',
251
+ }}
252
+ iconcolor={Global.AppTheme.primary_color}
253
+ icongroup={11}
254
+ iconname={'folder-images'}
255
+ iconsize={normalize(15)}
256
+ displaytext={'Media'}
257
+ buttonCallback={() => {
258
+ setShowButtons(prevstate => {
259
+ return {
260
+ ...prevstate,
261
+ mediabuttons: !prevstate.mediabuttons,
262
+ };
263
+ });
264
+ }}
265
+ textstyle={{
266
+ color: Global.AppTheme.primary_color,
267
+ fontSize: normalize(7),
268
+ textAlign: 'center',
269
+ }}
270
+ />
271
+ <HOCIcons.Icons
272
+ icongroup={5}
273
+ color={'black'}
274
+ name={showButtons.mediabuttons ? 'chevron-left' : 'chevron-right'}
275
+ size={normalize(10)}
276
+ style={{ marginHorizontal: normalize(5) }}
277
+ />
278
+ </TouchableOpacity>
279
+
280
+ // <HShadowButton
281
+ // useicon={true}
282
+ // usetext={true}
283
+ // buttonstyle={{
284
+ // margin: normalize(4),
285
+ // padding: normalize(4),
286
+ // borderLeftWidth: 0,
287
+ // borderBottomWidth: 0,
288
+ // borderRadius: 5,
289
+ // borderWidth: 0,
290
+ // borderColor: Global.AppTheme.primary_color,
291
+ // justifyContent: 'center',
292
+ // alignItems: 'center',
293
+ // backgroundColor: 'white',
294
+ // height: normalize(30),
295
+ // width: normalize(40),
296
+ // }}
297
+ // iconcolor={Global.AppTheme.primary_color}
298
+ // icongroup={11}
299
+ // iconname={'folder-images'}
300
+ // iconsize={normalize(15)}
301
+ // displaytext={'Media'}
302
+ // buttonCallback={() => {
303
+ // setShowButtons(prevstate => {
304
+ // return {
305
+ // ...prevstate,
306
+ // mediabuttons: !prevstate.mediabuttons
307
+ // }
308
+ // })
309
+ // }}
310
+ // textstyle={{
311
+ // color: Global.AppTheme.primary_color,
312
+ // fontSize: normalize(7),
313
+ // textAlign: 'center'
314
+ // }}
315
+ // />
316
+ : null}
317
+ {isBNUL(groupMediaIcons(props.moreButtonArray)) && showButtons.mediabuttons ?
318
+ groupMediaIcons(props.moreButtonArray).map((val) => {
319
+ return (
320
+ renderList(val)
321
+ );
322
+ })
323
+ : null}
324
+
325
+ {isBNUL(groupEntryIcons(props.moreButtonArray)) ? // NOTES , INSTRUCTIONS , COMMENTS
326
+ <TouchableOpacity
327
+ onPress={() => {
328
+ setShowButtons(prevstate => {
329
+ return {
330
+ ...prevstate,
331
+ detailbuttons: !prevstate.detailbuttons,
332
+ };
333
+ });
334
+ }}
335
+ style={{
336
+ borderWidth: 0,
337
+ flexDirection: 'row',
338
+ margin: normalize(4),
339
+ padding: normalize(4),
340
+ borderLeftWidth: 0,
341
+ borderBottomWidth: 0,
342
+ borderRadius: 5,
343
+ borderColor: Global.AppTheme.primary_color,
344
+ justifyContent: 'space-evenly',
345
+ alignItems: 'center',
346
+ backgroundColor: 'white',
347
+ ...CButtonShadow(),
348
+ height: normalize(20),
349
+ width: normalize(40),
350
+ }}>
351
+
352
+ <HShadowButton
353
+ useicon={true}
354
+ // usetext={true}
355
+ buttonstyle={{
356
+ borderWidth: 0,
357
+ justifyContent: 'center',
358
+ alignItems: 'center',
359
+ }}
360
+ iconcolor={Global.AppTheme.primary_color}
361
+ icongroup={3}
362
+ iconname={'clipboard-text'}
363
+ iconsize={normalize(15)}
364
+ displaytext={'Remarks'}
365
+ buttonCallback={() => {
366
+ setShowButtons(prevstate => {
367
+ return {
368
+ ...prevstate,
369
+ detailbuttons: !prevstate.detailbuttons,
370
+ };
371
+ });
372
+ }}
373
+ textstyle={{
374
+ color: Global.AppTheme.primary_color,
375
+ fontSize: normalize(7),
376
+ textAlign: 'center',
377
+ }}
378
+ />
379
+ <HOCIcons.Icons
380
+ icongroup={5}
381
+ color={'black'}
382
+ name={showButtons.detailbuttons ? 'chevron-left' : 'chevron-right'}
383
+ size={normalize(10)}
384
+ style={{ marginHorizontal: normalize(5) }}
385
+ />
386
+ </TouchableOpacity>
387
+ : null}
388
+ {isBNUL(groupEntryIcons(props.moreButtonArray)) && showButtons.detailbuttons ?
389
+ groupEntryIcons(props.moreButtonArray).map((val) => {
390
+ return (
391
+ renderList(val)
392
+ );
393
+ })
394
+ : null}
395
+ </View>
396
+ </ScrollView>
397
+ : null}
398
+ </View>
399
+ );
400
+ }
401
+
402
+ export default memo(HNatureHeading);
@@ -0,0 +1,80 @@
1
+ import React, { memo } from 'react';
2
+ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
3
+ import SimpleLineIcons from 'react-native-vector-icons/SimpleLineIcons';
4
+ import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
5
+ import FontAwesome from 'react-native-vector-icons/FontAwesome';
6
+ import Foundation from 'react-native-vector-icons/Foundation';
7
+ import EvilIcons from 'react-native-vector-icons/EvilIcons';
8
+ import Octicons from 'react-native-vector-icons/Octicons';
9
+ import Ionicons from 'react-native-vector-icons/Ionicons';
10
+ import Feather from 'react-native-vector-icons/Feather';
11
+ import Fontisto from 'react-native-vector-icons/Fontisto';
12
+ import Entypo from 'react-native-vector-icons/Entypo';
13
+ import Zocial from 'react-native-vector-icons/Zocial';
14
+ import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
15
+ import AntDesign from 'react-native-vector-icons/AntDesign';
16
+
17
+ function Icons(props) {
18
+
19
+ const components = {
20
+ 1: AntDesign,
21
+ 2: MaterialIcons,
22
+ 3: MaterialCommunityIcons,
23
+ 4: FontAwesome,
24
+ 5: FontAwesome5,
25
+ 6: Foundation,
26
+ 7: EvilIcons,
27
+ 8: Ionicons,
28
+ 9: Octicons,
29
+ 10: Feather,
30
+ 11: Entypo,
31
+ 12: Zocial,
32
+ 13: Fontisto,
33
+ 14: SimpleLineIcons,
34
+ };
35
+
36
+ const HOCIconComponent = props.icongroup != null && props.icongroup != undefined &&
37
+ typeof props.icongroup !== 'boolean' && !isNaN(props.icongroup) && props.icongroup > 0 &&
38
+ props.icongroup < 15 ? components[props.icongroup] : components[5];
39
+
40
+ return (
41
+ <HOCIconComponent
42
+ {...props}
43
+ />
44
+ );
45
+ }
46
+ /**
47
+ * to use HOC <HOCIcons.Icons
48
+ * Pass icongroup as an integer ex: icongroup={3}
49
+ * @param 1 AntDesign.
50
+ * @param 2 MaterialIcons.
51
+ * @param 3 MaterialCommunityIcons.
52
+ * @param 4 FontAwesome.
53
+ * @param 5 FontAwesome5.
54
+ * @param 6 Foundation.
55
+ * @param 7 EvilIcons.
56
+ * @param 8 Ionicons.
57
+ * @param 9 Octicons.
58
+ * @param 10 Feather.
59
+ * @param 11 Entypo.
60
+ * @param 12 Zocial.
61
+ * @param 13 Fontisto.
62
+ * @param 14 SimpleLineIcons.
63
+ */
64
+ export default {
65
+ Icons,
66
+ MaterialCommunityIcons,
67
+ SimpleLineIcons,
68
+ MaterialIcons,
69
+ FontAwesome,
70
+ Foundation,
71
+ Fontisto,
72
+ EvilIcons,
73
+ Ionicons,
74
+ Octicons,
75
+ Feather,
76
+ Entypo,
77
+ Zocial,
78
+ FontAwesome5,
79
+ AntDesign,
80
+ };
@@ -0,0 +1,99 @@
1
+ import React, { useState } from 'react';
2
+ import { View, TouchableOpacity, Dimensions } from 'react-native';
3
+ import { normalize } from '../CommonStyle/componentStyle';
4
+ import AntDesign from 'react-native-vector-icons/AntDesign';
5
+ import CNotesInstructions from '../CustomComponents/CNotesInstructions';
6
+ import CComments from '../CustomComponents/CComments';
7
+ // import AddParameter from '../InvTemplate/AddParameter';
8
+ // import AddTemplate from '../Templates/AddTemplate';
9
+ // import DeleteParameter from '../InvTemplate/DeleteParameter';
10
+ import CCalendar from '../CustomComponents/CCalendar';
11
+ import CRemarks from '../CustomComponents/CRemarks';
12
+ import CDropdownSelect from '../CustomComponents/CDropdownSelect';
13
+ import CAssessmentDelete from '../CustomComponents/CAssessmentDelete';
14
+ // import AddScreenOverlay from '../Templates/AddScreenOverlay';
15
+ import CAddColumn from '../CustomComponents/CAddColumn';
16
+ import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5';
17
+ import CRowAdd from '../CustomComponents/CRowAdd';
18
+ import CSummaryDropDown from '../CustomComponents/CSummaryDropDown';
19
+ import SwipeLeftView from '../Screens/SwipeLeftView';
20
+ import { Global } from '../Common/Global';
21
+ import RawMaterial from '../Components/RawMaterial';
22
+ import EquipmentPage from '../Components/EquipmentPage';
23
+ import ByProductPage from '../Components/ByProductPage';
24
+ import StageByProduct from '../Components/StageByProduct';
25
+ import CDynamicReportScreen from '../CustomComponents/CDynamicReportScreen';
26
+ import COperatorsOverlay from '../CustomComponents/COperatorsOverlay';
27
+ import DiscriptiveViewOverlay from '../CustomComponents/DiscriptiveViewOverlay';
28
+ import CDateOperatorsOverlay from '../CustomComponents/CDateOperatorsOverlay';
29
+ import CTextOperatorsOverlay from '../CustomComponents/CTextOperatorsOverlay';
30
+ import CModalOverlay from '../CustomComponents/CModalOverlay';
31
+
32
+ function HOverlay(props) {
33
+ const [overlay, setOverlay] = useState(true);
34
+ const components = {
35
+ // SetUpVitalSign: SetUpVitalSign,
36
+ CNotesOrInstructions: CNotesInstructions,
37
+ CComments: CComments,
38
+ // AddParameterScreen: AddParameter,
39
+ // ConsultationPreview: ConsultationPreview,
40
+ // AddTemplate: AddTemplate,
41
+ // DeleteParameter: DeleteParameter,
42
+ CCalendar: CCalendar,
43
+ CRemarks: CRemarks,
44
+ CDropdownSelect: CDropdownSelect,
45
+ CAssessmentDelete: CAssessmentDelete,
46
+ // AddScreenOverlay: AddScreenOverlay,
47
+ CAddColumn: CAddColumn,
48
+ CRowAdd: CRowAdd,
49
+ CSummaryDropDown: CSummaryDropDown,
50
+ // SetUpComponents: SetUpComponents,
51
+ RawMaterial: RawMaterial,
52
+ EquipmentPage: EquipmentPage,
53
+ ByProductPage: ByProductPage,
54
+ StageByProduct: StageByProduct,
55
+ CDynamicReportScreen: CDynamicReportScreen,
56
+ COperatorsOverlay: COperatorsOverlay,
57
+ DiscriptiveViewOverlay: DiscriptiveViewOverlay,
58
+ CDateOperatorsOverlay: CDateOperatorsOverlay,
59
+ CTextOperatorsOverlay: CTextOperatorsOverlay,
60
+ // SwipeLeftView: SwipeLeftView
61
+ };
62
+ const ViewHOCComponent = components[props.component];
63
+ return (
64
+ <CModalOverlay
65
+ visible={overlay}
66
+ onClose={() => (props.visibility(false))}
67
+ closeOnTouchOutside
68
+ animationType="fadeInUp"
69
+ // easing
70
+ containerStyle={{ backgroundColor: 'rgba(0, 0, 0, 0.20)' }}
71
+ // animationDuration={500}
72
+ childrenWrapperStyle={getPopupContainerStyle()}>
73
+ <View style={{ position: 'absolute', right: 14, top: 10, zIndex: 1 }}>
74
+ <TouchableOpacity
75
+ onPress={() => setOverlay(false, props.visibility(false))}
76
+ >
77
+ <FontAwesome5Icon name={'angle-double-down'} size={normalize(20)} color={Global.AppTheme.primary_color} />
78
+ </TouchableOpacity>
79
+ </View>
80
+ <ViewHOCComponent
81
+ {...props}
82
+ />
83
+ </CModalOverlay>
84
+ );
85
+
86
+ function getPopupContainerStyle() {
87
+ return {
88
+ position: 'absolute',
89
+ bottom: 0,
90
+ top: Dimensions.get('screen').height * 0.12,
91
+ width: Dimensions.get('window').width,
92
+ borderRadius: 20,
93
+ borderWidth: 2,
94
+ borderColor: '#e0e0e0',
95
+ paddingHorizontal: normalize(5),
96
+ };
97
+ }
98
+ }
99
+ export default HOverlay;