@jescon-technologies/react-native-ui-kit 0.0.6 → 0.0.7

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 (205) hide show
  1. package/dist/Common/ErrorBoundary.d.ts +15 -0
  2. package/dist/Common/ErrorBoundary.d.ts.map +1 -0
  3. package/dist/Common/ErrorBoundary.js +64 -0
  4. package/dist/Common/ErrorBoundary.js.map +1 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +8 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/src/Common/ErrorBoundary.d.ts +15 -0
  10. package/dist/src/Common/ErrorBoundary.d.ts.map +1 -0
  11. package/dist/src/Common/ErrorBoundary.js +64 -0
  12. package/dist/src/Common/ErrorBoundary.js.map +1 -0
  13. package/package.json +17 -5
  14. package/.gitattributes +0 -2
  15. package/index.d.ts +0 -66
  16. package/index.js +0 -66
  17. package/src/Alerts/AAlert.js +0 -137
  18. package/src/Alerts/AAlertIOS.js +0 -97
  19. package/src/Alerts/ABlink.js +0 -40
  20. package/src/Common/ErrorBoundary.tsx +0 -73
  21. package/src/Common/Icons.js +0 -49
  22. package/src/Common/NetworkServiceCall.js +0 -265
  23. package/src/CommonStyle/CommonTheme.js +0 -11
  24. package/src/CommonStyle/ComponentFunctions.js +0 -632
  25. package/src/CommonStyle/PopupStyle.js +0 -146
  26. package/src/CommonStyle/commonStyle.js +0 -93
  27. package/src/CommonStyle/componentStyle.js +0 -545
  28. package/src/CommonStyle/optionListStyles.js +0 -175
  29. package/src/Components/ByProductPage.js +0 -200
  30. package/src/Components/CDropDownListNew.js +0 -153
  31. package/src/Components/CSupplierList.js +0 -88
  32. package/src/Components/CVerificationCard.js +0 -2822
  33. package/src/Components/CustomButton.js +0 -67
  34. package/src/Components/CustomCard.js +0 -127
  35. package/src/Components/CustomTextInput.js +0 -47
  36. package/src/Components/EquipmentPage.js +0 -313
  37. package/src/Components/FilterInput.Copy.js +0 -723
  38. package/src/Components/FilterInput.js +0 -569
  39. package/src/Components/HSubHeading.js +0 -68
  40. package/src/Components/HeaderCard.js +0 -40
  41. package/src/Components/MoreOptionsScreen.js +0 -251
  42. package/src/Components/NonSwipableProductCard.js +0 -226
  43. package/src/Components/NonSwipableSupplierCard.js +0 -348
  44. package/src/Components/ProductCard.js +0 -1336
  45. package/src/Components/QualityProductCard.js +0 -1059
  46. package/src/Components/RateProductCard.js +0 -1452
  47. package/src/Components/RawMaterial.js +0 -261
  48. package/src/Components/SDropDownEdited.js +0 -549
  49. package/src/Components/SDropDownNew.js +0 -529
  50. package/src/Components/SHelpDescription.js +0 -147
  51. package/src/Components/STextInputNew.js +0 -510
  52. package/src/Components/SearchProductCard.js +0 -470
  53. package/src/Components/StageByProduct.js +0 -199
  54. package/src/Components/SupplierCard.js +0 -243
  55. package/src/Components/SupplierInvoiceCard.js +0 -405
  56. package/src/Components/SwipableSupplierCard.js +0 -136
  57. package/src/Components/TagTemplate.js +0 -74
  58. package/src/Components/WrappedComponent.js +0 -25
  59. package/src/Custom/CBooking.js +0 -944
  60. package/src/Custom/CBookingPostpone.js +0 -1822
  61. package/src/Custom/CCalendar.js +0 -560
  62. package/src/Custom/CCard.js +0 -880
  63. package/src/Custom/CDetailCard.js +0 -205
  64. package/src/Custom/CHelpImage.js +0 -52
  65. package/src/Custom/CReport.js +0 -569
  66. package/src/Custom/CScrollView.js +0 -73
  67. package/src/Custom/CSignature.js +0 -112
  68. package/src/Custom/CSliderMenu.js +0 -339
  69. package/src/Custom/CSupplierCard.js +0 -99
  70. package/src/Custom/CTemplateCard.js +0 -438
  71. package/src/Custom/CTokenAllocation.js +0 -1402
  72. package/src/Custom/CTokenListOverlay.js +0 -122
  73. package/src/Custom/CWardStatus.js +0 -444
  74. package/src/Custom/Charts/CBarChart.js +0 -218
  75. package/src/Custom/Charts/CDashBoardList.js +0 -133
  76. package/src/Custom/Charts/CDashBoardTable.js +0 -172
  77. package/src/Custom/Charts/CLineChart.js +0 -193
  78. package/src/Custom/Charts/CPieChart.js +0 -186
  79. package/src/Custom/Loader.js +0 -182
  80. package/src/Custom/OUserView.js +0 -1121
  81. package/src/Custom/PreviewDosage.js +0 -115
  82. package/src/Custom/SearchLoader.js +0 -32
  83. package/src/Custom/TableComponent/CActivityTable.js +0 -707
  84. package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
  85. package/src/Custom/TableComponent/CTable.js +0 -185
  86. package/src/Custom/TableComponent/CTextBody.js +0 -40
  87. package/src/Custom/TableComponent/CTextHeader.js +0 -17
  88. package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
  89. package/src/Custom/TableComponent/SDropdownTable.js +0 -491
  90. package/src/Custom/TableComponent/TagTable.js +0 -1200
  91. package/src/CustomComponents/CAddColumn.js +0 -140
  92. package/src/CustomComponents/CAssessmentDelete.js +0 -307
  93. package/src/CustomComponents/CAwesomeButton.js +0 -83
  94. package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
  95. package/src/CustomComponents/CBackHandler.js +0 -273
  96. package/src/CustomComponents/CCalendar.js +0 -243
  97. package/src/CustomComponents/CCommentOverlay.js +0 -202
  98. package/src/CustomComponents/CComments.js +0 -162
  99. package/src/CustomComponents/CContainerView.js +0 -24
  100. package/src/CustomComponents/CCustomTextInput.js +0 -336
  101. package/src/CustomComponents/CDetailView.js +0 -40
  102. package/src/CustomComponents/CDropDownList.js +0 -153
  103. package/src/CustomComponents/CDropdownSelect.js +0 -555
  104. package/src/CustomComponents/CFooterView.js +0 -42
  105. package/src/CustomComponents/CImagePickerSave.js +0 -316
  106. package/src/CustomComponents/CModalOverlay.js +0 -91
  107. package/src/CustomComponents/CNetworkStatus.js +0 -327
  108. package/src/CustomComponents/CNotesInstructions.js +0 -1000
  109. package/src/CustomComponents/COverlay.js +0 -81
  110. package/src/CustomComponents/CRemarks.js +0 -176
  111. package/src/CustomComponents/CRowAdd.js +0 -143
  112. package/src/CustomComponents/CSummaryDropDown.js +0 -327
  113. package/src/CustomComponents/CText.js +0 -9
  114. package/src/CustomComponents/CVectorIcon.js +0 -34
  115. package/src/CustomComponents/HtmlContentViewer.js +0 -65
  116. package/src/CustomComponents/PdfContentViewer.js +0 -90
  117. package/src/CustomComponents/SDropDownDosage.js +0 -1087
  118. package/src/CustomComponents/SwipableProductCard.js +0 -246
  119. package/src/CustomComponents/SwipableProductImageCard.js +0 -254
  120. package/src/CustomComponents/WorkOrderDetails.js +0 -1216
  121. package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
  122. package/src/HOC/ConfirmOverlay.js +0 -192
  123. package/src/HOC/HHeading.js +0 -70
  124. package/src/HOC/HMoreButton.js +0 -88
  125. package/src/HOC/HNatureHeading.js +0 -402
  126. package/src/HOC/HOCIcons.js +0 -80
  127. package/src/HOC/HOverlayCentered.js +0 -140
  128. package/src/HOC/HShadowButton.js +0 -45
  129. package/src/HOC/HShadowCountButton.js +0 -82
  130. package/src/HOC/OptionOverlay.js +0 -48
  131. package/src/Json/Chart.json +0 -818
  132. package/src/Json/Consultation.json +0 -622
  133. package/src/Json/CreditBill.json +0 -490
  134. package/src/Json/Dropdown.json +0 -216
  135. package/src/Json/DropdownConsultation.json +0 -228
  136. package/src/Json/DynamicReports.json +0 -623
  137. package/src/Json/Footer.json +0 -79
  138. package/src/Media/AudioScreen.js +0 -342
  139. package/src/Media/BarcodeScan.js +0 -145
  140. package/src/Media/CAudioPlay.js +0 -228
  141. package/src/Media/CCaptureImageWithoutEdit.js +0 -330
  142. package/src/Media/CImageGallery.js +0 -289
  143. package/src/Media/CImageZoom.js +0 -82
  144. package/src/Media/CSingleImage.js +0 -391
  145. package/src/Media/CSketchCanvas.js +0 -76
  146. package/src/Media/CVideoPlay.js +0 -31
  147. package/src/Media/DocumentScreen.js +0 -362
  148. package/src/Media/DrawingScreen.js +0 -578
  149. package/src/Media/ImageScreen.js +0 -309
  150. package/src/Media/RecordAudio.js +0 -250
  151. package/src/Media/RecordVideo.js +0 -223
  152. package/src/Media/VideoScreen.js +0 -378
  153. package/src/Navigation/PageNavigation.js +0 -224
  154. package/src/Navigation/useFocusEffect.js +0 -2
  155. package/src/Navigation/useFocusEffect.native.js +0 -1
  156. package/src/Navigation/useFocusEffect.web.js +0 -1
  157. package/src/Navigation/useIsFocused.js +0 -1
  158. package/src/Navigation/useIsFocused.native.js +0 -1
  159. package/src/Navigation/useIsFocused.web.js +0 -1
  160. package/src/Navigation/useNavigation.js +0 -2
  161. package/src/Navigation/useNavigation.native.js +0 -1
  162. package/src/Navigation/useNavigation.web.js +0 -1
  163. package/src/Screens/CMedications.js +0 -528
  164. package/src/Screens/CWebViewGallery.js +0 -203
  165. package/src/Screens/ChartScan.js +0 -279
  166. package/src/Screens/ChartScreenNew.js +0 -1579
  167. package/src/Screens/Consultation.js +0 -1500
  168. package/src/Screens/Dashboard.js +0 -778
  169. package/src/Screens/FileExplorer.js +0 -288
  170. package/src/Screens/Footer.js +0 -340
  171. package/src/Screens/ForgotPassword.js +0 -288
  172. package/src/Screens/HeaderBlock.js +0 -353
  173. package/src/Screens/Login.js +0 -328
  174. package/src/Screens/Notification.js +0 -149
  175. package/src/Screens/OcrScreen.js +0 -20
  176. package/src/Screens/PdfPreview.js +0 -507
  177. package/src/Screens/RegistrationDetails.js +0 -467
  178. package/src/Screens/SearchScreen.js +0 -582
  179. package/src/Screens/Splash.js +0 -788
  180. package/src/Screens/SwipeLeftView.js +0 -1867
  181. package/src/StaticComponents/SAlphabet.js +0 -47
  182. package/src/StaticComponents/SCheckBox.js +0 -42
  183. package/src/StaticComponents/SDatePicker.js +0 -208
  184. package/src/StaticComponents/SDatePickerLabel.js +0 -253
  185. package/src/StaticComponents/SDatePickerNew.js +0 -258
  186. package/src/StaticComponents/SDateTimePickerNew.js +0 -381
  187. package/src/StaticComponents/SDropDownGenerate.js +0 -450
  188. package/src/StaticComponents/SDropDownHoc.js +0 -636
  189. package/src/StaticComponents/SDropDownIcon.js +0 -500
  190. package/src/StaticComponents/SMenuBox.js +0 -131
  191. package/src/StaticComponents/SOverlay.js +0 -177
  192. package/src/StaticComponents/SOverlayTextInput.js +0 -109
  193. package/src/StaticComponents/SSearch.js +0 -438
  194. package/src/StaticComponents/SSearchBar.js +0 -53
  195. package/src/StaticComponents/SSpeedDial.js +0 -303
  196. package/src/StaticComponents/STextInput.js +0 -289
  197. package/src/StaticComponents/STextInputProps.js +0 -36
  198. package/src/StaticComponents/STimePicker.js +0 -171
  199. package/src/StaticComponents/STimingDropDownNew.js +0 -1585
  200. package/src/StaticComponents/STimingSwitch.js +0 -34
  201. package/src/layout/CContainerView.js +0 -21
  202. package/src/layout/CDetailView.js +0 -81
  203. package/src/layout/HeaderBlock.js +0 -353
  204. package/src/layout/INVLoginLayout.js +0 -657
  205. package/src/layout/Loader.js +0 -176
@@ -1,316 +0,0 @@
1
- import React, { useState, memo } from 'react';
2
- import {
3
- Text,
4
- View,
5
- Image,
6
- TouchableOpacity,
7
- ActivityIndicator,
8
- StyleSheet,
9
- Dimensions,
10
- } from 'react-native';
11
- import { isNUQZ, normalize, ValueCheck } from '../CommonStyle/ComponentFunctions';
12
- import ComponentStyles from '../CommonStyle/componentStyle';
13
- // import DocumentPicker from 'react-native-document-picker';
14
- import FontAwesome from 'react-native-vector-icons/FontAwesome';
15
- import { useNavigation } from '../Navigation/useNavigation';
16
-
17
-
18
- import ReactNativeBlobUtil from 'react-native-blob-util';
19
- // import ImageCropPicker from 'react-native-image-crop-picker';
20
- import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
21
-
22
-
23
- function CImagePickerSave(props) {
24
-
25
- const navigation = useNavigation();
26
- const { width, height } = Dimensions.get('window');
27
- const [data, setData] = useState();
28
- const [isLoading, setIsLoading] = useState(false);
29
- const [isMsgShow, setIsMsgShow] = useState(false);
30
- const [Msg, setMsg] = useState(false);
31
- const [showImage, setShowImage] = useState(ValueCheck(props.imageurl) ? props.imageurl : '');
32
-
33
- const getResolvedPath = async (uri, filen) => {
34
-
35
- const fileBase64 = await ReactNativeBlobUtil.fs.readFile(uri, 'base64');
36
- const relativePath = ReactNativeBlobUtil.fs.dirs.CacheDir;
37
- const fileName = `${filen}`;
38
- const path = `${relativePath}/${fileName}`;
39
- await ReactNativeBlobUtil.fs.writeFile(path, fileBase64, 'base64');
40
- return { relativePath, fileName, path };
41
-
42
- };
43
-
44
- async function browseFromDevice() {
45
- try {
46
- const res = await DocumentPicker.pick({
47
- type: [DocumentPicker.types.images],
48
- });
49
- setShowImage(res.uri);
50
- let dataset = {
51
- uri: res[0].uri,
52
- filetype: res[0].type,
53
- filename: res[0].name,
54
- };
55
- console.log('browseFromDevice', JSON.stringify(dataset));
56
- // Media_Upload(dataset);
57
- } catch (err) {
58
- if (DocumentPicker.isCancel(err)) {
59
- // User cancelled the picker, exit any dialogs or menus and move on
60
- } else {
61
- throw err;
62
- }
63
- }
64
- }
65
-
66
- const selectImage = async () => {
67
- try {
68
- const res = await DocumentPicker.pick({
69
- type: [DocumentPicker.types.images],
70
- });
71
-
72
- // Assuming the first item is the selected image
73
- if (res && res.length > 0) {
74
- console.log('res', res[0].uri);
75
- cropImage(res[0].uri);
76
- }
77
- } catch (err) {
78
- if (DocumentPicker.isCancel(err)) {
79
- console.log('User cancelled the picker');
80
- } else {
81
- console.log('DocumentPicker Error: ', err);
82
- }
83
- }
84
- };
85
-
86
- const cropImage = (uri) => {
87
- ImageCropPicker.openCropper({
88
- path: uri,
89
- width: 500,
90
- height: 500,
91
- compressImageQuality: 0.5,
92
- })
93
- .then(image => {
94
- Media_UploadNew(image);
95
- console.log('setCroppedImage ', image);
96
- })
97
- .catch(error => {
98
- console.log('Crop error: ', error);
99
- });
100
- };
101
-
102
- const Media_UploadNew = async item => {
103
- var formData = new FormData();
104
- formData.append('file', {
105
- uri: item.path,
106
- type: item.mime,
107
- name: item.modificationDate,
108
- });
109
- let buttonapi = props.savelink;
110
- console.log('BUTTONNNNNNN APIIIIIIIIIIIIII', JSON.stringify(buttonapi));
111
- NetworkServiceCall('multiform', buttonapi, formData)
112
- .then(function (response) {
113
- console.log('Response C Single imaggeggeggegeggege', JSON.stringify(response));
114
- if (response.httpstatus == 200) {
115
- if (response.data.filesize > 0) {
116
- // setData(response.data.fileuri);
117
- setShowImage(props.imagelink + response.data.fileuri);
118
- props.callBack(response.data.fileuri);
119
- setIsMsgShow(true, setMsg('Image uploaded Successfully.'));
120
- setTimeout(() => {
121
- setIsMsgShow(false);
122
- }, 2000);
123
- } else {
124
- setIsMsgShow(true, setMsg('Image upload failed.'));
125
- // setIsLoading(false);
126
- setTimeout(() => {
127
- setIsMsgShow(false);
128
- }, 2000);
129
- }
130
- } else {
131
- setIsMsgShow(true, setMsg('..'));
132
- // setIsLoading(false);
133
- setTimeout(() => {
134
- setIsMsgShow(false);
135
- }, 2000);
136
- }
137
- });
138
- };
139
-
140
- const Media_Upload = async item => {
141
- var formData = new FormData();
142
- formData.append('file', {
143
- uri: item.uri,
144
- type: item.filetype,
145
- name: item.filename,
146
- });
147
- let buttonapi = props.savelink;
148
- console.log('BUTTONNNNNNN APIIIIIIIIIIIIII', JSON.stringify(buttonapi));
149
- NetworkServiceCall('multiform', buttonapi, formData)
150
- .then(function (response) {
151
- console.log('Response C Single imaggeggeggegeggege', JSON.stringify(response));
152
- if (response.httpstatus == 200) {
153
- if (response.data.filesize > 0) {
154
- setData(response.data.fileuri);
155
- props.callBack(response.data.fileuri);
156
- setIsMsgShow(true, setMsg('Success...'));
157
- setTimeout(() => {
158
- setIsMsgShow(false);
159
- }, 2000);
160
- } else {
161
- setIsMsgShow(true, setMsg('...'));
162
- // setIsLoading(false);
163
- setTimeout(() => {
164
- setIsMsgShow(false);
165
- }, 2000);
166
- }
167
- } else {
168
- setIsMsgShow(true, setMsg('..'));
169
- // setIsLoading(false);
170
- setTimeout(() => {
171
- setIsMsgShow(false);
172
- }, 2000);
173
- }
174
- });
175
- };
176
-
177
- function ReturnFromCamera(params, d) {
178
-
179
- console.log('ReturnFromCamera', params, d);
180
- cropImage(params.uri);
181
-
182
- }
183
-
184
- return (
185
- <View style={{ width: '100%' }}>
186
- {!isLoading ? (
187
- <View style={{ borderWidth: 0, justifyContent: 'center', alignItems: 'center' }}>
188
- <TouchableOpacity
189
- disabled={props.disabled ? props.disabled : false}
190
- onPress={() => {
191
- // navigation.navigate('CPhotoGallery', {
192
- // savedimages: [{ "filename": showImage }], index: 0
193
- // })
194
- // navigation.navigate('CPhotoGallery', {
195
- // // heading: 'REGISTRATION FORM EDITED HISTORY',
196
- // // headingmal: 'രജിസ്‌ട്രേഷൻ ഫോം തിരുത്തിയത്',
197
- // // headingicon: {
198
- // // "name": "file-document-edit",
199
- // // "color": "#164c92",
200
- // // "icongroup": 3
201
- // // },
202
- // index: 0,
203
- // displayarray: [{ filename: '', filelink: isNUQZ(showImage) ? showImage : "https://png.pngtree.com/png-clipart/20200224/original/pngtree-avatar-icon-profile-icon-member-login-vector-isolated-png-image_5247852.jpg"}]
204
- // })
205
- }
206
- // navigation.navigate('CCaptureImage', {
207
- // onSelect: Media_Upload,
208
- // navigation: navigation,
209
- // })
210
- }
211
- style={{
212
- flexDirection: 'row',
213
- justifyContent: 'center',
214
- // alignItems:'center',
215
- borderWidth: 0.5,
216
- borderRadius: 1000,
217
- elevation: 1,
218
- backgroundColor: 'white',
219
- borderColor: 'grey',
220
- // flex: 1,
221
- width: Dimensions.get('screen').width * 0.22,
222
- height: Dimensions.get('screen').width * 0.22,
223
- // paddingTop: normalize(6),
224
- }}
225
-
226
- >
227
- {/* <View style={{
228
-
229
- position: 'absolute',
230
- top: normalize(4), // Adjust position above the image
231
- left: normalize(4),
232
- backgroundColor: 'rgba(255, 255, 255, 0.83)', // Semi-transparent background
233
- padding: 2, // Add some padding for better readability
234
- borderRadius: 5, // Optional: rounded corners for the label
235
- }}>
236
- <Text style={{ color: '#164c92', fontSize: normalize(10), textAlign: 'left', fontWeight: 'normal' }}>{" "}{"Profile"}{" "}</Text>
237
- </View> */}
238
- <Image
239
- style={{
240
- width: '100%',
241
- // width: normalize(100),
242
- // height: normalize(80),
243
- resizeMode: 'cover',
244
- borderRadius: 1000,
245
- borderWidth: 0,
246
- borderColor: 'black',
247
- opacity: 0.8,
248
- }}
249
- source={{
250
- uri: isNUQZ(showImage) ? showImage : 'https://png.pngtree.com/png-clipart/20200224/original/pngtree-avatar-icon-profile-icon-member-login-vector-isolated-png-image_5247852.jpg', //https://static.vecteezy.com/system/resources/previews/005/544/718/non_2x/profile-icon-design-free-vector.jpg
251
- }}
252
- />
253
- </TouchableOpacity>
254
-
255
- <View style={{
256
- borderWidth: 0,
257
- justifyContent: 'space-evenly',
258
- alignItems: 'center',
259
- flexDirection: 'row',
260
- width: '100%',
261
- }}>
262
- <TouchableOpacity
263
- disabled={props.disabled ? props.disabled : false}
264
- onPress={() =>
265
- // browseFromDevice()
266
- selectImage()
267
- }
268
- style={{ alignItems: 'center' }}
269
- >
270
- <FontAwesome
271
- name="folder-open"
272
- color="#164c92"
273
- size={25}
274
- style={{ padding: normalize(5) }}
275
- />
276
- </TouchableOpacity>
277
-
278
- {/* <TouchableOpacity
279
- disabled={props.disabled ? props.disabled : false}
280
- style={{ backgroundColor: 'transparent', alignItems: 'center' }}
281
- onPress={() =>
282
- navigation.navigate('CCameraScreen', {
283
- onSelect: (s) => ReturnFromCamera(s, 'data'),
284
- navigation: navigation,
285
- })
286
- }>
287
- <FontAwesome name="camera" color="#164c92" size={25} />
288
- </TouchableOpacity> */}
289
-
290
- </View>
291
- </View>
292
- ) : (
293
- <View style={{ width: '100%', alignItems: 'center', justifyContent: 'center' }}>
294
- <Text style={{ fontSize: 10 }}> Uploading...</Text>
295
- <ActivityIndicator
296
- size="large"
297
- color="darkblue"
298
- backgroundColor="transparent"
299
- />
300
- </View>
301
- )
302
- }
303
- {
304
- isMsgShow ? (
305
- <View>
306
- <Text style={ComponentStyles.errorMsgText}>
307
- {Msg}
308
- </Text>
309
- </View>
310
- ) : null
311
- }
312
- </View >
313
- );
314
- }
315
-
316
- export default memo(CImagePickerSave);
@@ -1,91 +0,0 @@
1
- import React from 'react';
2
- import {
3
- View,
4
- Modal,
5
- TouchableWithoutFeedback,
6
- StyleSheet,
7
- ScrollView,
8
- SafeAreaView,
9
- Dimensions,
10
- } from 'react-native';
11
-
12
- const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get('window');
13
-
14
- const CModalOverlay = ({
15
- visible,
16
- onClose,
17
- children,
18
- closeOnTouchOutside = true,
19
- containerStyle,
20
- childrenWrapperStyle,
21
- contentStyle,
22
- footer,
23
- footerStyle,
24
- }) => {
25
- if (!visible) {return null;}
26
-
27
- return (
28
- <Modal
29
- visible={visible}
30
- transparent
31
- statusBarTranslucent
32
- >
33
- <SafeAreaView style={styles.safeArea}>
34
- <View style={[styles.container, containerStyle]}>
35
- {/* Background */}
36
- <TouchableWithoutFeedback
37
- disabled={!closeOnTouchOutside}
38
- onPress={onClose}
39
- >
40
- <View style={styles.overlayBackground} />
41
- </TouchableWithoutFeedback>
42
- <View style={[styles.childrenWrapper, childrenWrapperStyle]}>
43
- <ScrollView
44
- bounces={false}
45
- showsVerticalScrollIndicator={false}
46
- contentContainerStyle={[
47
- styles.content,
48
- contentStyle,
49
- ]}
50
- >
51
- {children}
52
- </ScrollView>
53
- {footer && (
54
- <View style={[footerStyle]}>
55
- {footer}
56
- </View>
57
- )}
58
- </View>
59
- </View>
60
- </SafeAreaView>
61
- </Modal>
62
- );
63
- };
64
-
65
- const styles = StyleSheet.create({
66
- overlayBackground: {
67
- ...StyleSheet.absoluteFillObject,
68
- },
69
-
70
- safeArea: {
71
- flex: 1,
72
- },
73
-
74
- container: {
75
- flex: 1,
76
- justifyContent: 'center',
77
- alignItems: 'center',
78
- },
79
-
80
- childrenWrapper: {
81
- backgroundColor: '#fff',
82
- borderRadius: 0,
83
- },
84
-
85
- content: {
86
- flexGrow: 1,
87
- maxHeight: SCREEN_HEIGHT,
88
- },
89
- });
90
-
91
- export default CModalOverlay;