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

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 (191) hide show
  1. package/index.d.ts +2 -66
  2. package/index.js +1 -66
  3. package/package.json +1 -1
  4. package/src/Alerts/AAlert.js +0 -137
  5. package/src/Alerts/AAlertIOS.js +0 -97
  6. package/src/Alerts/ABlink.js +0 -40
  7. package/src/Common/Icons.js +0 -49
  8. package/src/Common/NetworkServiceCall.js +0 -265
  9. package/src/CommonStyle/CommonTheme.js +0 -11
  10. package/src/CommonStyle/ComponentFunctions.js +0 -632
  11. package/src/CommonStyle/PopupStyle.js +0 -146
  12. package/src/CommonStyle/commonStyle.js +0 -93
  13. package/src/CommonStyle/componentStyle.js +0 -545
  14. package/src/CommonStyle/optionListStyles.js +0 -175
  15. package/src/Components/ByProductPage.js +0 -200
  16. package/src/Components/CDropDownListNew.js +0 -153
  17. package/src/Components/CSupplierList.js +0 -88
  18. package/src/Components/CVerificationCard.js +0 -2822
  19. package/src/Components/CustomButton.js +0 -67
  20. package/src/Components/CustomCard.js +0 -127
  21. package/src/Components/CustomTextInput.js +0 -47
  22. package/src/Components/EquipmentPage.js +0 -313
  23. package/src/Components/FilterInput.Copy.js +0 -723
  24. package/src/Components/FilterInput.js +0 -569
  25. package/src/Components/HSubHeading.js +0 -68
  26. package/src/Components/HeaderCard.js +0 -40
  27. package/src/Components/MoreOptionsScreen.js +0 -251
  28. package/src/Components/NonSwipableProductCard.js +0 -226
  29. package/src/Components/NonSwipableSupplierCard.js +0 -348
  30. package/src/Components/ProductCard.js +0 -1336
  31. package/src/Components/QualityProductCard.js +0 -1059
  32. package/src/Components/RateProductCard.js +0 -1452
  33. package/src/Components/RawMaterial.js +0 -261
  34. package/src/Components/SDropDownEdited.js +0 -549
  35. package/src/Components/SDropDownNew.js +0 -529
  36. package/src/Components/SHelpDescription.js +0 -147
  37. package/src/Components/STextInputNew.js +0 -510
  38. package/src/Components/SearchProductCard.js +0 -470
  39. package/src/Components/StageByProduct.js +0 -199
  40. package/src/Components/SupplierCard.js +0 -243
  41. package/src/Components/SupplierInvoiceCard.js +0 -405
  42. package/src/Components/SwipableSupplierCard.js +0 -136
  43. package/src/Components/TagTemplate.js +0 -74
  44. package/src/Components/WrappedComponent.js +0 -25
  45. package/src/Custom/CBooking.js +0 -944
  46. package/src/Custom/CBookingPostpone.js +0 -1822
  47. package/src/Custom/CCalendar.js +0 -560
  48. package/src/Custom/CCard.js +0 -880
  49. package/src/Custom/CDetailCard.js +0 -205
  50. package/src/Custom/CHelpImage.js +0 -52
  51. package/src/Custom/CReport.js +0 -569
  52. package/src/Custom/CScrollView.js +0 -73
  53. package/src/Custom/CSignature.js +0 -112
  54. package/src/Custom/CSliderMenu.js +0 -339
  55. package/src/Custom/CSupplierCard.js +0 -99
  56. package/src/Custom/CTemplateCard.js +0 -438
  57. package/src/Custom/CTokenAllocation.js +0 -1402
  58. package/src/Custom/CTokenListOverlay.js +0 -122
  59. package/src/Custom/CWardStatus.js +0 -444
  60. package/src/Custom/Charts/CBarChart.js +0 -218
  61. package/src/Custom/Charts/CDashBoardList.js +0 -133
  62. package/src/Custom/Charts/CDashBoardTable.js +0 -172
  63. package/src/Custom/Charts/CLineChart.js +0 -193
  64. package/src/Custom/Charts/CPieChart.js +0 -186
  65. package/src/Custom/Loader.js +0 -182
  66. package/src/Custom/OUserView.js +0 -1121
  67. package/src/Custom/PreviewDosage.js +0 -115
  68. package/src/Custom/SearchLoader.js +0 -32
  69. package/src/Custom/TableComponent/CActivityTable.js +0 -707
  70. package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
  71. package/src/Custom/TableComponent/CTable.js +0 -185
  72. package/src/Custom/TableComponent/CTextBody.js +0 -40
  73. package/src/Custom/TableComponent/CTextHeader.js +0 -17
  74. package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
  75. package/src/Custom/TableComponent/SDropdownTable.js +0 -491
  76. package/src/Custom/TableComponent/TagTable.js +0 -1200
  77. package/src/CustomComponents/CAddColumn.js +0 -140
  78. package/src/CustomComponents/CAssessmentDelete.js +0 -307
  79. package/src/CustomComponents/CAwesomeButton.js +0 -83
  80. package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
  81. package/src/CustomComponents/CBackHandler.js +0 -273
  82. package/src/CustomComponents/CCalendar.js +0 -243
  83. package/src/CustomComponents/CCommentOverlay.js +0 -202
  84. package/src/CustomComponents/CComments.js +0 -162
  85. package/src/CustomComponents/CContainerView.js +0 -24
  86. package/src/CustomComponents/CCustomTextInput.js +0 -336
  87. package/src/CustomComponents/CDetailView.js +0 -40
  88. package/src/CustomComponents/CDropDownList.js +0 -153
  89. package/src/CustomComponents/CDropdownSelect.js +0 -555
  90. package/src/CustomComponents/CFooterView.js +0 -42
  91. package/src/CustomComponents/CImagePickerSave.js +0 -316
  92. package/src/CustomComponents/CModalOverlay.js +0 -91
  93. package/src/CustomComponents/CNetworkStatus.js +0 -327
  94. package/src/CustomComponents/CNotesInstructions.js +0 -1000
  95. package/src/CustomComponents/COverlay.js +0 -81
  96. package/src/CustomComponents/CRemarks.js +0 -176
  97. package/src/CustomComponents/CRowAdd.js +0 -143
  98. package/src/CustomComponents/CSummaryDropDown.js +0 -327
  99. package/src/CustomComponents/CText.js +0 -9
  100. package/src/CustomComponents/CVectorIcon.js +0 -34
  101. package/src/CustomComponents/HtmlContentViewer.js +0 -65
  102. package/src/CustomComponents/PdfContentViewer.js +0 -90
  103. package/src/CustomComponents/SDropDownDosage.js +0 -1087
  104. package/src/CustomComponents/SwipableProductCard.js +0 -246
  105. package/src/CustomComponents/SwipableProductImageCard.js +0 -254
  106. package/src/CustomComponents/WorkOrderDetails.js +0 -1216
  107. package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
  108. package/src/HOC/ConfirmOverlay.js +0 -192
  109. package/src/HOC/HHeading.js +0 -70
  110. package/src/HOC/HMoreButton.js +0 -88
  111. package/src/HOC/HNatureHeading.js +0 -402
  112. package/src/HOC/HOCIcons.js +0 -80
  113. package/src/HOC/HOverlayCentered.js +0 -140
  114. package/src/HOC/HShadowButton.js +0 -45
  115. package/src/HOC/HShadowCountButton.js +0 -82
  116. package/src/HOC/OptionOverlay.js +0 -48
  117. package/src/Json/Chart.json +0 -818
  118. package/src/Json/Consultation.json +0 -622
  119. package/src/Json/CreditBill.json +0 -490
  120. package/src/Json/Dropdown.json +0 -216
  121. package/src/Json/DropdownConsultation.json +0 -228
  122. package/src/Json/DynamicReports.json +0 -623
  123. package/src/Json/Footer.json +0 -79
  124. package/src/Media/AudioScreen.js +0 -342
  125. package/src/Media/BarcodeScan.js +0 -145
  126. package/src/Media/CAudioPlay.js +0 -228
  127. package/src/Media/CCaptureImageWithoutEdit.js +0 -330
  128. package/src/Media/CImageGallery.js +0 -289
  129. package/src/Media/CImageZoom.js +0 -82
  130. package/src/Media/CSingleImage.js +0 -391
  131. package/src/Media/CSketchCanvas.js +0 -76
  132. package/src/Media/CVideoPlay.js +0 -31
  133. package/src/Media/DocumentScreen.js +0 -362
  134. package/src/Media/DrawingScreen.js +0 -578
  135. package/src/Media/ImageScreen.js +0 -309
  136. package/src/Media/RecordAudio.js +0 -250
  137. package/src/Media/RecordVideo.js +0 -223
  138. package/src/Media/VideoScreen.js +0 -378
  139. package/src/Navigation/PageNavigation.js +0 -224
  140. package/src/Navigation/useFocusEffect.js +0 -2
  141. package/src/Navigation/useFocusEffect.native.js +0 -1
  142. package/src/Navigation/useFocusEffect.web.js +0 -1
  143. package/src/Navigation/useIsFocused.js +0 -1
  144. package/src/Navigation/useIsFocused.native.js +0 -1
  145. package/src/Navigation/useIsFocused.web.js +0 -1
  146. package/src/Navigation/useNavigation.js +0 -2
  147. package/src/Navigation/useNavigation.native.js +0 -1
  148. package/src/Navigation/useNavigation.web.js +0 -1
  149. package/src/Screens/CMedications.js +0 -528
  150. package/src/Screens/CWebViewGallery.js +0 -203
  151. package/src/Screens/ChartScan.js +0 -279
  152. package/src/Screens/ChartScreenNew.js +0 -1579
  153. package/src/Screens/Consultation.js +0 -1500
  154. package/src/Screens/Dashboard.js +0 -778
  155. package/src/Screens/FileExplorer.js +0 -288
  156. package/src/Screens/Footer.js +0 -340
  157. package/src/Screens/ForgotPassword.js +0 -288
  158. package/src/Screens/HeaderBlock.js +0 -353
  159. package/src/Screens/Login.js +0 -328
  160. package/src/Screens/Notification.js +0 -149
  161. package/src/Screens/OcrScreen.js +0 -20
  162. package/src/Screens/PdfPreview.js +0 -507
  163. package/src/Screens/RegistrationDetails.js +0 -467
  164. package/src/Screens/SearchScreen.js +0 -582
  165. package/src/Screens/Splash.js +0 -788
  166. package/src/Screens/SwipeLeftView.js +0 -1867
  167. package/src/StaticComponents/SAlphabet.js +0 -47
  168. package/src/StaticComponents/SCheckBox.js +0 -42
  169. package/src/StaticComponents/SDatePicker.js +0 -208
  170. package/src/StaticComponents/SDatePickerLabel.js +0 -253
  171. package/src/StaticComponents/SDatePickerNew.js +0 -258
  172. package/src/StaticComponents/SDateTimePickerNew.js +0 -381
  173. package/src/StaticComponents/SDropDownGenerate.js +0 -450
  174. package/src/StaticComponents/SDropDownHoc.js +0 -636
  175. package/src/StaticComponents/SDropDownIcon.js +0 -500
  176. package/src/StaticComponents/SMenuBox.js +0 -131
  177. package/src/StaticComponents/SOverlay.js +0 -177
  178. package/src/StaticComponents/SOverlayTextInput.js +0 -109
  179. package/src/StaticComponents/SSearch.js +0 -438
  180. package/src/StaticComponents/SSearchBar.js +0 -53
  181. package/src/StaticComponents/SSpeedDial.js +0 -303
  182. package/src/StaticComponents/STextInput.js +0 -289
  183. package/src/StaticComponents/STextInputProps.js +0 -36
  184. package/src/StaticComponents/STimePicker.js +0 -171
  185. package/src/StaticComponents/STimingDropDownNew.js +0 -1585
  186. package/src/StaticComponents/STimingSwitch.js +0 -34
  187. package/src/layout/CContainerView.js +0 -21
  188. package/src/layout/CDetailView.js +0 -81
  189. package/src/layout/HeaderBlock.js +0 -353
  190. package/src/layout/INVLoginLayout.js +0 -657
  191. package/src/layout/Loader.js +0 -176
@@ -1,788 +0,0 @@
1
- import React, { useContext, useEffect, useState } from 'react';
2
- import {
3
- View,
4
- StatusBar,
5
- Text,
6
- Image,
7
- TouchableOpacity,
8
- KeyboardAvoidingView,
9
- BackHandler,
10
- Modal,
11
- Dimensions,
12
- Platform,
13
- StyleSheet
14
- } from 'react-native';
15
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
16
- import AsyncStorage from '@react-native-async-storage/async-storage';
17
- import RNExitApp from 'react-native-exit-app';
18
- import RNFS from 'react-native-fs';
19
- import { normalize } from '../CommonStyle/componentStyle';
20
- import { isNU, isNUQ, notifyMessage } from '../CommonStyle/ComponentFunctions';
21
- import { Global } from '../../../../../src/Common/Global';
22
- import Icons from '../Common/Icons';
23
- import NetworkServiceCall from '../Common/NetworkServiceCall';
24
- import { APIURL } from '../../../../../src/Common/apiConstants';
25
- import HOCIcons from '../HOC/HOCIcons';
26
- import CBackHandler from '../CustomComponents/CBackHandler';
27
- import ApkInstaller from 'react-native-installer'
28
- import { useNavigation } from '../Navigation/useNavigation';
29
- import packageJson from '../../package.json';
30
-
31
- const ThemeColors = [
32
- {
33
- primary_color: '#094485',
34
- secondary_color: 'black',
35
- text_color: '#fff',
36
- heading_text_color: 'darkblue',
37
- bg_button: '#fff',
38
- icon_color: 'darkblue',
39
- selected_color: "#d7ffbc",
40
- blur_color: 'rgba(255,255,255,0.6)',
41
- error_color: '#D32F2F',
42
- },
43
- {
44
- primary_color: 'black',
45
- secondary_color: 'black',
46
- text_color: '#fff',
47
- heading_text_color: 'black',
48
- bg_button: 'black',
49
- icon_color: '#fff',
50
- selected_color: "#d7ffbc",
51
- blur_color: 'rgba(255,255,255,0.6)',
52
- error_color: '#D32F2F',
53
- },
54
- {
55
- primary_color: '#00008B',
56
- secondary_color: 'black',
57
- text_color: '#fff',
58
- heading_text_color: '#00008B',
59
- bg_button: '#fff',
60
- icon_color: '#00008B',
61
- selected_color: "#d7ffbc",
62
- blur_color: 'rgba(255,255,255,0.6)',
63
- error_color: '#D32F2F',
64
- },
65
- {
66
- primary_color: '#e54495',
67
- secondary_color: 'black',
68
- text_color: '#fff',
69
- heading_text_color: '#fc5dac',
70
- bg_button: '#fff',
71
- icon_color: '#fc5dac',
72
- selected_color: "#d7ffbc",
73
- blur_color: 'rgba(255,255,255,0.6)',
74
- error_color: '#D32F2F',
75
- },
76
- {
77
- primary_color: 'purple',
78
- secondary_color: 'purple',
79
- text_color: '#fff',
80
- heading_text_color: 'purple',
81
- bg_button: 'purple',
82
- icon_color: '#fff',
83
- selected_color: "#d7ffbc",
84
- blur_color: 'rgba(255,255,255,0.6)',
85
- error_color: '#D32F2F',
86
- },
87
- {
88
- primary_color: '#0d910d',
89
- secondary_color: '#0d910d',
90
- text_color: '#fff',
91
- heading_text_color: '#0d910d',
92
- bg_button: '#fff',
93
- icon_color: '#fff',
94
- selected_color: "#d7ffbc",
95
- blur_color: 'rgba(255,255,255,0.6)',
96
- error_color: '#D32F2F',
97
- },
98
- {
99
- primary_color: '#f70404',
100
- secondary_color: '#f70404',
101
- text_color: '#fff',
102
- heading_text_color: '#f70404',
103
- bg_button: '#fff',
104
- icon_color: '#fff',
105
- selected_color: "#d7ffbc",
106
- blur_color: 'rgba(255,255,255,0.6)',
107
- error_color: '#D32F2F',
108
- },
109
- {
110
- primary_color: '#3489a8',
111
- secondary_color: '#3489a8',
112
- text_color: '#fff',
113
- heading_text_color: '#3489a8',
114
- bg_button: '#fff',
115
- icon_color: '#fff',
116
- selected_color: "#d7ffbc",
117
- blur_color: 'rgba(255,255,255,0.6)',
118
- error_color: '#D32F2F',
119
- },
120
- {
121
- primary_color: 'grey',
122
- secondary_color: 'grey',
123
- text_color: '#fff',
124
- heading_text_color: 'grey',
125
- bg_button: '#fff',
126
- icon_color: '#fff',
127
- selected_color: "#d7ffbc",
128
- blur_color: 'rgba(255,255,255,0.6)',
129
- error_color: '#D32F2F',
130
- },
131
- {
132
- primary_color: '#bab10e',
133
- secondary_color: '#bab10e',
134
- text_color: '#fff',
135
- heading_text_color: '#bab10e',
136
- bg_button: '#fff',
137
- icon_color: '#fff',
138
- selected_color: "#d7ffbc",
139
- blur_color: 'rgba(255,255,255,0.6)',
140
- error_color: '#D32F2F',
141
- },
142
- {
143
- primary_color: '#9e331e',
144
- secondary_color: '#9e331e',
145
- text_color: '#fff',
146
- heading_text_color: '#9e331e',
147
- bg_button: '#fff',
148
- icon_color: '#fff',
149
- selected_color: "#d7ffbc",
150
- blur_color: 'rgba(255,255,255,0.6)',
151
- error_color: '#D32F2F',
152
- }
153
- ];
154
-
155
- export default function Splash(props) {
156
- const [loading, setLoading] = useState(false);
157
- const [backHandler, setBackHandler] = useState(false);
158
- const [refresh, setRefresh] = useState(0);
159
- const [progress, setProgress] = useState(null);
160
- const [isLoading, setIsLoading] = useState(false);
161
- const [showText, setShowText] = useState();
162
- const [updateVersion, setUpdateVersion] = useState();
163
- const [retry, setRetry] = useState(false);
164
- const navigation = useNavigation()
165
-
166
- useEffect(() => {
167
- if (Platform.OS === 'android') {
168
- getApiVersionCheck();
169
- } else if (Platform.OS === 'web') {
170
- getData();
171
- } else {
172
- getData();
173
- }
174
- }, []);
175
-
176
-
177
- useEffect(() => {
178
- const backAction = () => {
179
- RNExitApp.exitApp();
180
- return true;
181
- };
182
-
183
- const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);
184
- return () => backHandler.remove();
185
- }, []);
186
-
187
- const isValidUrl = (string) => {
188
- try {
189
- new URL(string);
190
- return true;
191
- } catch (err) {
192
- return false;
193
- }
194
- };
195
-
196
- const goBackFunction = (showText, retry, isLoading) => {
197
- if (isNU(showText) && !retry && isLoading) {
198
- RNExitApp.exitApp();
199
- }
200
- };
201
-
202
- const getApiVersionCheck = () => {
203
- setIsLoading(true);
204
- setShowText();
205
- setUpdateVersion();
206
- setRetry(false);
207
- setProgress(null);
208
-
209
- const buttonapi = `${APIURL}insuranceadvanceget/emrcommonget/rnmoduleversioncheck ${Global.hospitalcode},${Global.module}`;
210
- console.log('getApiVersionCheck buttonapi ', JSON.stringify(buttonapi));
211
-
212
- NetworkServiceCall('get', buttonapi).then(function (response) {
213
- if (
214
- response.httpstatus === 200 &&
215
- isNU(response.data) &&
216
- isNUQ(response.data.version) &&
217
- isNUQ(response.data.apkVersion) &&
218
- isNUQ(response.data.bundleUrl) &&
219
- isValidUrl(response.data.bundleUrl) &&
220
- isNUQ(response.data.apkUrl) &&
221
- isValidUrl(response.data.apkUrl) &&
222
- isNU(response.data.descriptions)
223
- ) {
224
- console.log('getApiVersionCheck response @@@@@@@@@@@', JSON.stringify(response));
225
- console.log('New version available:', response.data.version,Global.version);
226
- console.log('New APK version available:', response.data.apkVersion,packageJson.version);
227
- if (Global.version !== response.data.version) {
228
- setUpdateVersion(response.data.version);
229
- downloadBundleWithProgress(
230
- (p) => setProgress(p),
231
- response.data.bundleUrl,
232
- response.data.version,
233
- response.data.descriptions
234
- );
235
- } else if (packageJson.version !== response.data.apkVersion) {
236
- downloadApkWithProgress(
237
- (p) => setProgress(p),
238
- response.data.apkUrl,
239
- response.data.apkVersion,
240
- response.data.descriptions
241
- );
242
- } else {
243
- getData();
244
- }
245
- } else {
246
- setIsLoading(false);
247
- setRetry(true);
248
- notifyMessage('Network Error.Please try again.', 2);
249
- }
250
- });
251
- };
252
-
253
- const downloadBundleWithProgress = async (onProgressUpdate, url, newversion, desc) => {
254
- console.log('Starting bundle download from:', url);
255
- return new Promise((resolve, reject) => {
256
- const downloadDest = `${RNFS.ExternalDirectoryPath}/update.apk`;
257
- const download = RNFS.downloadFile({
258
- fromUrl: url,
259
- toFile: downloadDest,
260
- progressInterval: 500,
261
- progress: (res) => {
262
- const percentage = Math.floor((res.bytesWritten / res.contentLength) * 100);
263
- console.log(`[OTA] Download progress: ${percentage}%`);
264
- onProgressUpdate?.(percentage);
265
- }
266
- });
267
-
268
- download.promise
269
- .then(async (res) => {
270
- console.log('[OTA] Download complete! Moving file...');
271
- try {
272
- ApkInstaller.install(downloadDest);
273
- console.log('[OTA] File moved to final destination!');
274
- setShowText(desc);
275
- resolve(true);
276
- RNExitApp.exitApp();
277
- } catch (moveErr) {
278
- console.warn('[OTA] Failed to move file:', moveErr.message);
279
- reject(moveErr);
280
- setRetry(true);
281
- }
282
- })
283
- .catch((err) => {
284
- console.warn('[OTA] Download failed:', err.message);
285
- reject(err);
286
- setRetry(true);
287
- });
288
- });
289
- };
290
-
291
- const downloadApkWithProgress = async (onProgressUpdate, url, newversion, desc) => {
292
- console.log('Starting APK download from:', url);
293
- return new Promise((resolve, reject) => {
294
- const downloadDest = `${RNFS.ExternalDirectoryPath}/insure${newversion}.apk`;
295
- const download = RNFS.downloadFile({
296
- fromUrl: url,
297
- toFile: downloadDest,
298
- progressInterval: 500,
299
- progress: (res) => {
300
- const percentage = Math.floor((res.bytesWritten / res.contentLength) * 100);
301
- console.log(`[APK] Download progress: ${percentage}%`);
302
- onProgressUpdate?.(percentage);
303
- }
304
- });
305
-
306
- download.promise
307
- .then(async (res) => {
308
- console.log('[APK] Download complete! Moving file...');
309
- try {
310
- ApkInstaller.install(downloadDest);
311
- console.log('[APK] File moved to final destination!');
312
- setShowText(desc);
313
- resolve(true);
314
- RNExitApp.exitApp();
315
- } catch (moveErr) {
316
- console.warn('[APK] Failed to move file:', moveErr.message);
317
- reject(moveErr);
318
- setRetry(true);
319
- }
320
- })
321
- .catch((err) => {
322
- console.warn('[APK] Download failed:', err.message);
323
- reject(err);
324
- setRetry(true);
325
- });
326
- });
327
- };
328
-
329
- const removeValue = async () => {
330
- try {
331
- await AsyncStorage.removeItem(Global.asyncStorageAppKey);
332
- } catch (e) {
333
- // remove error
334
- }
335
- };
336
-
337
- const getLoginPageData = (object, key) => {
338
- setLoading(true);
339
- const buttonapi = `http://${object.APIP}:${object.PortNumber}/${object.ApiLink} '${key}',${object.ApiVersion}`;
340
- console.log('getLoginPageData buttonpai ', JSON.stringify(buttonapi));
341
-
342
- NetworkServiceCall('get', buttonapi, '').then(function (response) {
343
- if (response.httpstatus === 200) {
344
- if (object.ValidationStatus === true) {
345
- Global.HospitalData = response.data.hospitalInfo;
346
- Global.InstallationKey = key;
347
- // props.navigation.navigate('Login', { data: response.data });
348
- navigation.navigate('Login', { data: response.data });
349
- setLoading(false);
350
- } else {
351
- setBackHandler(false);
352
- notifyMessage('Install validation failed...', 3);
353
- setLoading(false);
354
- }
355
- } else {
356
- setBackHandler(false);
357
- notifyMessage('Network Error... ', 4);
358
- setLoading(false);
359
- }
360
- });
361
- };
362
-
363
- const getValidation = (otp) => {
364
- const buttonapi = `${Global.licenseIp}'${otp}'`;
365
- console.log('getValidation buttonapi', buttonapi);
366
-
367
- setLoading(true);
368
- NetworkServiceCall('get', buttonapi, '').then(function (response) {
369
- console.log('getValidation response @@@@@@@@@@@', JSON.stringify(response));
370
-
371
- if (response.httpstatus === 200) {
372
- if (response.data?.ValidationStatus === true) {
373
- setBackHandler(false);
374
- storeData(otp, response.data);
375
- getLoginPageData(response.data, otp);
376
- } else {
377
- setLoading(false);
378
- setBackHandler(false);
379
- notifyMessage('Validation Failed...Please enter right key', 3);
380
- }
381
- } else {
382
- setLoading(false);
383
- notifyMessage('Network Error... ', 4);
384
- }
385
- });
386
- };
387
-
388
- const storeData = async (value, response) => {
389
- try {
390
- const newValue = {
391
- key: value,
392
- hospitaldata: response
393
- };
394
- const jsonValue = JSON.stringify(newValue);
395
- await AsyncStorage.setItem(Global.asyncStorageAppKey, jsonValue);
396
- } catch (e) {
397
- // saving error
398
- }
399
- };
400
-
401
- const setTheme = async (item) => {
402
- try {
403
- const jsonValue = JSON.stringify(item);
404
- await AsyncStorage.setItem(Global.asyncStorageThemeKey, jsonValue);
405
- Global.AppTheme = item;
406
- setRefresh(refresh + 1);
407
- } catch (e) {
408
- // saving error
409
- }
410
- removeValue();
411
- setBackHandler(false);
412
- };
413
-
414
- const getStorageItem = async (key) => {
415
- if (Platform.OS === 'web' || Platform.OS === 'windows' || Platform.OS === 'macos') {
416
- // Check if we're in Electron
417
- if (window && window.process && window.process.type === 'renderer') {
418
- // For Electron renderer process
419
- console.log('Getting from localStorage for key (Electron):', key);
420
- return localStorage.getItem(key);
421
- //return 'emr@amala'
422
- }
423
- return localStorage.getItem(key);
424
- } else {
425
- const AsyncStorage = require('@react-native-async-storage/async-storage').default;
426
- return await AsyncStorage.getItem(key);
427
- }
428
- };
429
-
430
-
431
-
432
- const getData = async () => {
433
- try {
434
- const jsonValue = await getStorageItem(Global.asyncStorageAppKey);
435
- console.log('Retrieved value:', jsonValue);
436
-
437
- if (!jsonValue) {
438
- return getValidation(Global.preinstallationkey);
439
- console.log("Hello");
440
- }
441
-
442
- const InstallationData = JSON.parse(jsonValue);
443
- console.log('installation', JSON.stringify(InstallationData));
444
-
445
- setBackHandler(false);
446
- return getLoginPageData(InstallationData.hospitaldata, InstallationData.key);
447
- } catch (e) {
448
- console.error('Error in getData:', e);
449
- return getValidation(Global.preinstallationkey);
450
- }
451
- };
452
-
453
- const renderUpdateModal = () => (
454
- <Modal
455
- animationType="none"
456
- transparent={true}
457
- visible={isLoading}
458
- onRequestClose={() => goBackFunction(showText, retry, isLoading)}
459
- style={styles.modal}
460
- >
461
- <View style={styles.modalContainer}>
462
- <View style={styles.modalContent}>
463
- {retry ? (
464
- <View style={styles.retryContainer}>
465
- <TouchableOpacity
466
- onPress={getApiVersionCheck}
467
- style={styles.retryButton}
468
- >
469
- <HOCIcons.MaterialCommunityIcons
470
- name={'reload'}
471
- color={'red'}
472
- size={normalize(30)}
473
- style={styles.retryIcon}
474
- />
475
- <Text style={styles.retryText}>Retry</Text>
476
- </TouchableOpacity>
477
- </View>
478
- ) : (
479
- <View style={styles.downloadContainer}>
480
- {!showText && (
481
- <Image
482
- style={styles.downloadGif}
483
- source={{ uri: APIURL + 'insurancefile/getCommonFile/image/transfer.gif' }}
484
- />
485
- )}
486
- {!showText && (
487
- <Text style={styles.progressText}>
488
- {isNU(progress) ? `${progress} % Downloading` : null}
489
- </Text>
490
- )}
491
- {showText && (
492
- <View style={styles.descriptionContainer}>
493
- <Text style={styles.descriptionText}>
494
- {showText}
495
- </Text>
496
- </View>
497
- )}
498
- {updateVersion && (
499
- <Text style={styles.versionText}>
500
- <Text style={styles.versionLabel}>Latest Version: </Text>
501
- {updateVersion}
502
- </Text>
503
- )}
504
- </View>
505
- )}
506
- {!showText && (
507
- <View>
508
- <Text style={styles.currentVersionText}>
509
- <Text style={styles.versionLabel}>Current Version: </Text>
510
- {Global.version}
511
- </Text>
512
- </View>
513
- )}
514
- </View>
515
- </View>
516
- </Modal>
517
- );
518
-
519
- const renderThemeSelector = () => (
520
- <View style={styles.themeContainer}>
521
- <Text style={[styles.themeLabel, { color: Global.AppTheme.text_color }]}>
522
- Choose Theme:
523
- </Text>
524
- <View style={styles.themeRow}>
525
- {ThemeColors.map((item, i) => (
526
- <TouchableOpacity
527
- key={i}
528
- onPress={() => setTheme(item)}
529
- style={styles.themeButton}
530
- >
531
- <Icons.FontAwesome
532
- name="circle"
533
- color={item.primary_color}
534
- size={normalize(20)}
535
- />
536
- </TouchableOpacity>
537
- ))}
538
- </View>
539
- </View>
540
- );
541
-
542
- const renderSocialIcons = () => (
543
- <View style={styles.socialContainer}>
544
- {['facebook', 'web', 'linkedin'].map((item, i) => (
545
- <TouchableOpacity
546
- key={i}
547
- onPress={removeValue}
548
- hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
549
- >
550
- <MaterialCommunityIcons
551
- name={item}
552
- color={Global.AppTheme.text_color}
553
- size={normalize(15)}
554
- />
555
- </TouchableOpacity>
556
- ))}
557
- </View>
558
- );
559
-
560
- const renderAppLogo = () => (
561
- <TouchableOpacity onPress={() => setBackHandler(false)}>
562
- <View style={styles.logoContainer}>
563
- <Image
564
- style={styles.logo}
565
- source={require('../../android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png')}
566
- />
567
- <Text style={styles.appName}>
568
- {Global.SplashHeading || 'HOMES'}
569
- </Text>
570
- </View>
571
- </TouchableOpacity>
572
- );
573
-
574
- const renderCompanyInfo = () => (
575
- <View style={styles.companyContainer}>
576
- <Text style={styles.fromText}>from,</Text>
577
- <Text style={styles.companyName}>JESCON TECHNOLOGIES PVT LTD</Text>
578
-
579
- {renderSocialIcons()}
580
-
581
- {Platform.OS !== 'ios' && (
582
- <View style={styles.versionContainer}>
583
- <Text style={styles.codePushVersion}>
584
- {Global.CodePushVersion}
585
- </Text>
586
- </View>
587
- )}
588
-
589
- <Text style={styles.versionText}>
590
- {isNU(Global.version) ? `V ${Global.version}` : null}
591
- </Text>
592
-
593
- <TouchableOpacity
594
- disabled={loading}
595
- onPress={() => Platform.OS === 'android' ? getApiVersionCheck() : getData()}
596
- style={styles.refreshButton}
597
- >
598
- <Icons.FontAwesome name={'refresh'} color={'#fff'} size={normalize(25)} />
599
- <Text style={styles.refreshText}>Refresh</Text>
600
- </TouchableOpacity>
601
- </View>
602
- );
603
-
604
- return (
605
- <KeyboardAvoidingView
606
- behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
607
- style={[styles.container, { backgroundColor: Global.AppTheme.primary_color }]}
608
- >
609
- <StatusBar
610
- backgroundColor={Global.AppTheme.primary_color}
611
- barStyle={Platform.OS === 'ios' ? 'dark-content' : 'light-content'}
612
- />
613
-
614
- {isLoading && renderUpdateModal()}
615
-
616
- {renderAppLogo()}
617
- {renderCompanyInfo()}
618
- {renderThemeSelector()}
619
-
620
- {backHandler && (
621
- <CBackHandler
622
- type={1}
623
- close={(val) => val && setBackHandler(val)}
624
- callBack={(val) => val && getValidation(val)}
625
- />
626
- )}
627
- </KeyboardAvoidingView>
628
- );
629
- }
630
-
631
- const styles = StyleSheet.create({
632
- container: {
633
- flex: 1,
634
- alignItems: 'center',
635
- justifyContent: 'center',
636
- },
637
- // Modal Styles
638
- modal: {
639
- alignSelf: 'center',
640
- padding: 0
641
- },
642
- modalContainer: {
643
- height: Dimensions.get('window').height,
644
- width: Dimensions.get('screen').width,
645
- justifyContent: 'center',
646
- alignItems: 'center',
647
- paddingBottom: normalize(50)
648
- },
649
- modalContent: {
650
- backgroundColor: 'white',
651
- borderWidth: 1,
652
- elevation: 5,
653
- borderColor: 'grey',
654
- borderRadius: 3,
655
- alignItems: 'center',
656
- alignSelf: 'center',
657
- justifyContent: 'center',
658
- height: Dimensions.get('screen').height * 0.2,
659
- minWidth: Dimensions.get('screen').width * 0.8
660
- },
661
- retryContainer: {
662
- flex: 1,
663
- justifyContent: 'center',
664
- alignItems: 'center'
665
- },
666
- retryButton: {
667
- justifyContent: 'center',
668
- alignItems: 'center'
669
- },
670
- retryIcon: {
671
- marginHorizontal: normalize(8)
672
- },
673
- retryText: {
674
- fontSize: normalize(12),
675
- fontWeight: 'bold',
676
- color: 'red'
677
- },
678
- downloadContainer: {
679
- flex: 1,
680
- justifyContent: 'center',
681
- alignItems: 'center'
682
- },
683
- downloadGif: {
684
- width: normalize(150),
685
- height: normalize(100)
686
- },
687
- progressText: {
688
- color: 'black'
689
- },
690
- descriptionContainer: {
691
- flex: 1,
692
- justifyContent: 'center',
693
- alignItems: 'center'
694
- },
695
- descriptionText: {
696
- color: '#cf1818',
697
- fontSize: normalize(12),
698
- textAlign: 'center'
699
- },
700
- versionText: {
701
- color: Global.AppTheme.primary_color,
702
- fontSize: normalize(10)
703
- },
704
- currentVersionText: {
705
- color: Global.AppTheme.primary_color,
706
- fontSize: normalize(10)
707
- },
708
- versionLabel: {
709
- color: 'black',
710
- fontSize: normalize(10)
711
- },
712
- // Logo Styles
713
- logoContainer: {
714
- alignItems: 'center',
715
- justifyContent: 'center'
716
- },
717
- logo: {
718
- width: normalize(70),
719
- height: normalize(70),
720
- resizeMode: 'contain',
721
- borderRadius: normalize(30)
722
- },
723
- appName: {
724
- color: Global.AppTheme.text_color,
725
- fontWeight: 'bold',
726
- fontSize: normalize(25),
727
- textAlign: 'center'
728
- },
729
- // Company Info Styles
730
- companyContainer: {
731
- paddingTop: normalize(40),
732
- alignItems: 'center',
733
- justifyContent: 'center'
734
- },
735
- fromText: {
736
- color: Global.AppTheme.text_color,
737
- paddingBottom: normalize(8)
738
- },
739
- companyName: {
740
- color: Global.AppTheme.text_color,
741
- fontWeight: 'bold',
742
- fontSize: normalize(16)
743
- },
744
- versionContainer: {
745
- alignItems: 'center'
746
- },
747
- codePushVersion: {
748
- color: 'white',
749
- fontSize: normalize(16),
750
- paddingTop: normalize(20)
751
- },
752
- refreshButton: {
753
- marginTop: normalize(20),
754
- alignItems: 'center'
755
- },
756
- refreshText: {
757
- color: '#fff',
758
- fontSize: normalize(7)
759
- },
760
- // Social Icons Styles
761
- socialContainer: {
762
- flexDirection: 'row',
763
- width: normalize(90),
764
- paddingTop: normalize(10),
765
- justifyContent: 'space-between'
766
- },
767
- // Theme Selector Styles
768
- themeContainer: {
769
- paddingTop: normalize(50),
770
- alignSelf: 'flex-start',
771
- paddingHorizontal: normalize(20)
772
- },
773
- themeLabel: {
774
- paddingBottom: normalize(2),
775
- fontSize: normalize(14),
776
- fontWeight: '500'
777
- },
778
- themeRow: {
779
- flexDirection: 'row',
780
- paddingTop: normalize(4),
781
- alignItems: 'center',
782
- flexWrap: 'wrap'
783
- },
784
- themeButton: {
785
- paddingLeft: normalize(10),
786
- paddingBottom: normalize(5)
787
- }
788
- });