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

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 (178) hide show
  1. package/index.d.ts +66 -0
  2. package/index.js +3 -7
  3. package/package.json +3 -2
  4. package/src/Alerts/AAlert.js +4 -4
  5. package/src/Alerts/AAlertIOS.js +3 -3
  6. package/src/{common → Common}/NetworkServiceCall.js +1 -1
  7. package/src/CommonStyle/CommonTheme.js +11 -0
  8. package/src/CommonStyle/ComponentFunctions.js +632 -0
  9. package/src/CommonStyle/PopupStyle.js +146 -0
  10. package/src/CommonStyle/commonStyle.js +93 -0
  11. package/src/CommonStyle/componentStyle.js +545 -0
  12. package/src/CommonStyle/optionListStyles.js +175 -0
  13. package/src/Components/ByProductPage.js +200 -0
  14. package/src/Components/CDropDownListNew.js +153 -0
  15. package/src/Components/CSupplierList.js +88 -0
  16. package/src/Components/CVerificationCard.js +2822 -0
  17. package/src/Components/CustomButton.js +67 -0
  18. package/src/Components/CustomCard.js +127 -0
  19. package/src/Components/CustomTextInput.js +47 -0
  20. package/src/Components/EquipmentPage.js +313 -0
  21. package/src/Components/FilterInput.Copy.js +723 -0
  22. package/src/Components/FilterInput.js +569 -0
  23. package/src/Components/HSubHeading.js +68 -0
  24. package/src/Components/HeaderCard.js +40 -0
  25. package/src/Components/MoreOptionsScreen.js +251 -0
  26. package/src/Components/NonSwipableProductCard.js +226 -0
  27. package/src/Components/NonSwipableSupplierCard.js +348 -0
  28. package/src/Components/ProductCard.js +1336 -0
  29. package/src/Components/QualityProductCard.js +1059 -0
  30. package/src/Components/RateProductCard.js +1452 -0
  31. package/src/Components/RawMaterial.js +261 -0
  32. package/src/Components/SDropDownEdited.js +549 -0
  33. package/src/Components/SDropDownNew.js +529 -0
  34. package/src/Components/SHelpDescription.js +147 -0
  35. package/src/Components/STextInputNew.js +510 -0
  36. package/src/Components/SearchProductCard.js +470 -0
  37. package/src/Components/StageByProduct.js +199 -0
  38. package/src/Components/SupplierCard.js +243 -0
  39. package/src/Components/SupplierInvoiceCard.js +405 -0
  40. package/src/Components/SwipableSupplierCard.js +136 -0
  41. package/src/Components/TagTemplate.js +74 -0
  42. package/src/Components/WrappedComponent.js +25 -0
  43. package/src/Custom/CBooking.js +944 -0
  44. package/src/Custom/CBookingPostpone.js +1822 -0
  45. package/src/Custom/CCalendar.js +560 -0
  46. package/src/Custom/CCard.js +880 -0
  47. package/src/Custom/CDetailCard.js +205 -0
  48. package/src/Custom/CHelpImage.js +52 -0
  49. package/src/Custom/CReport.js +569 -0
  50. package/src/Custom/CScrollView.js +73 -0
  51. package/src/Custom/CSignature.js +112 -0
  52. package/src/Custom/CSliderMenu.js +339 -0
  53. package/src/Custom/CSupplierCard.js +99 -0
  54. package/src/Custom/CTemplateCard.js +438 -0
  55. package/src/Custom/CTokenAllocation.js +1402 -0
  56. package/src/Custom/CTokenListOverlay.js +122 -0
  57. package/src/Custom/CWardStatus.js +444 -0
  58. package/src/Custom/Charts/CBarChart.js +218 -0
  59. package/src/Custom/Charts/CDashBoardList.js +133 -0
  60. package/src/Custom/Charts/CDashBoardTable.js +172 -0
  61. package/src/Custom/Charts/CLineChart.js +193 -0
  62. package/src/Custom/Charts/CPieChart.js +186 -0
  63. package/src/Custom/Loader.js +182 -0
  64. package/src/Custom/OUserView.js +1121 -0
  65. package/src/Custom/PreviewDosage.js +115 -0
  66. package/src/Custom/SearchLoader.js +32 -0
  67. package/src/Custom/TableComponent/CActivityTable.js +707 -0
  68. package/src/Custom/TableComponent/CMoreButtonTable.js +197 -0
  69. package/src/Custom/TableComponent/CTable.js +185 -0
  70. package/src/Custom/TableComponent/CTextBody.js +40 -0
  71. package/src/Custom/TableComponent/CTextHeader.js +17 -0
  72. package/src/Custom/TableComponent/PreviewPrescriptionNew.js +1011 -0
  73. package/src/Custom/TableComponent/SDropdownTable.js +491 -0
  74. package/src/Custom/TableComponent/TagTable.js +1200 -0
  75. package/src/CustomComponents/CAddColumn.js +140 -0
  76. package/src/CustomComponents/CAssessmentDelete.js +307 -0
  77. package/src/CustomComponents/CAwesomeButton.js +83 -0
  78. package/src/CustomComponents/CAwesomeMoreButton.js +54 -0
  79. package/src/CustomComponents/CBackHandler.js +273 -0
  80. package/src/CustomComponents/CCalendar.js +243 -0
  81. package/src/CustomComponents/CCommentOverlay.js +202 -0
  82. package/src/CustomComponents/CComments.js +162 -0
  83. package/src/CustomComponents/CContainerView.js +24 -0
  84. package/src/CustomComponents/CCustomTextInput.js +336 -0
  85. package/src/CustomComponents/CDetailView.js +40 -0
  86. package/src/CustomComponents/CDropDownList.js +153 -0
  87. package/src/CustomComponents/CDropdownSelect.js +555 -0
  88. package/src/CustomComponents/CFooterView.js +42 -0
  89. package/src/CustomComponents/CImagePickerSave.js +316 -0
  90. package/src/CustomComponents/CModalOverlay.js +91 -0
  91. package/src/CustomComponents/CNetworkStatus.js +327 -0
  92. package/src/CustomComponents/CNotesInstructions.js +1000 -0
  93. package/src/CustomComponents/COverlay.js +81 -0
  94. package/src/CustomComponents/CRemarks.js +176 -0
  95. package/src/CustomComponents/CRowAdd.js +143 -0
  96. package/src/CustomComponents/CSummaryDropDown.js +327 -0
  97. package/src/CustomComponents/CText.js +9 -0
  98. package/src/CustomComponents/CVectorIcon.js +34 -0
  99. package/src/CustomComponents/HtmlContentViewer.js +65 -0
  100. package/src/CustomComponents/PdfContentViewer.js +90 -0
  101. package/src/CustomComponents/SDropDownDosage.js +1087 -0
  102. package/src/CustomComponents/SwipableProductCard.js +246 -0
  103. package/src/CustomComponents/SwipableProductImageCard.js +254 -0
  104. package/src/CustomComponents/WorkOrderDetails.js +1216 -0
  105. package/src/CustomComponents/WorkOrderDetailsPage.js +1213 -0
  106. package/src/HOC/ConfirmOverlay.js +2 -2
  107. package/src/HOC/HMoreButton.js +1 -1
  108. package/src/HOC/HNatureHeading.js +1 -1
  109. package/src/HOC/HShadowButton.js +1 -1
  110. package/src/HOC/HShadowCountButton.js +1 -1
  111. package/src/Json/Chart.json +818 -0
  112. package/src/Json/Consultation.json +622 -0
  113. package/src/Json/CreditBill.json +490 -0
  114. package/src/Json/Dropdown.json +216 -0
  115. package/src/Json/DropdownConsultation.json +228 -0
  116. package/src/Json/DynamicReports.json +623 -0
  117. package/src/Json/Footer.json +79 -0
  118. package/src/Media/AudioScreen.js +2 -7
  119. package/src/Media/CCaptureImageWithoutEdit.js +1 -1
  120. package/src/Media/CImageGallery.js +2 -2
  121. package/src/Media/CSingleImage.js +2 -2
  122. package/src/Media/CVideoPlay.js +1 -1
  123. package/src/Media/DocumentScreen.js +2 -7
  124. package/src/Media/DrawingScreen.js +2 -6
  125. package/src/Media/ImageScreen.js +2 -6
  126. package/src/Media/RecordAudio.js +1 -1
  127. package/src/Media/VideoScreen.js +2 -7
  128. package/src/Navigation/PageNavigation.js +224 -0
  129. package/src/Navigation/useFocusEffect.js +2 -0
  130. package/src/Navigation/useFocusEffect.native.js +1 -0
  131. package/src/Navigation/useFocusEffect.web.js +1 -0
  132. package/src/Navigation/useIsFocused.js +1 -0
  133. package/src/Navigation/useIsFocused.native.js +1 -0
  134. package/src/Navigation/useIsFocused.web.js +1 -0
  135. package/src/Navigation/useNavigation.js +2 -0
  136. package/src/Navigation/useNavigation.native.js +1 -0
  137. package/src/Navigation/useNavigation.web.js +1 -0
  138. package/src/Screens/CMedications.js +528 -0
  139. package/src/Screens/CWebViewGallery.js +203 -0
  140. package/src/Screens/ChartScan.js +279 -0
  141. package/src/Screens/ChartScreenNew.js +1579 -0
  142. package/src/Screens/Consultation.js +1500 -0
  143. package/src/Screens/Dashboard.js +778 -0
  144. package/src/Screens/FileExplorer.js +288 -0
  145. package/src/Screens/Footer.js +340 -0
  146. package/src/Screens/ForgotPassword.js +288 -0
  147. package/src/Screens/HeaderBlock.js +353 -0
  148. package/src/Screens/Login.js +328 -0
  149. package/src/Screens/Notification.js +149 -0
  150. package/src/Screens/OcrScreen.js +20 -0
  151. package/src/Screens/PdfPreview.js +507 -0
  152. package/src/Screens/RegistrationDetails.js +467 -0
  153. package/src/Screens/SearchScreen.js +582 -0
  154. package/src/Screens/Splash.js +788 -0
  155. package/src/Screens/SwipeLeftView.js +1867 -0
  156. package/src/StaticComponents/SDatePickerLabel.js +1 -1
  157. package/src/StaticComponents/SDatePickerNew.js +1 -1
  158. package/src/StaticComponents/SDateTimePickerNew.js +2 -2
  159. package/src/StaticComponents/SDropDownGenerate.js +3 -3
  160. package/src/StaticComponents/SDropDownHoc.js +4 -4
  161. package/src/StaticComponents/SDropDownIcon.js +1 -1
  162. package/src/StaticComponents/SMenuBox.js +2 -2
  163. package/src/StaticComponents/SSearch.js +2 -2
  164. package/src/StaticComponents/STextInput.js +1 -1
  165. package/src/StaticComponents/STimePicker.js +1 -1
  166. package/src/StaticComponents/STimingDropDownNew.js +2 -6
  167. package/src/StaticComponents/STimingSwitch.js +1 -1
  168. package/src/layout/CContainerView.js +1 -1
  169. package/src/layout/CDetailView.js +3 -3
  170. package/src/layout/HeaderBlock.js +5 -5
  171. package/src/layout/INVLoginLayout.js +3 -4
  172. package/src/layout/Loader.js +2 -2
  173. package/src/HOC/HAbsolute.js +0 -56
  174. package/src/HOC/HDiscontinue.js +0 -105
  175. package/src/HOC/HOverlay.js +0 -99
  176. package/src/layout/FooterBlock.js +0 -821
  177. /package/src/{common → Common}/ErrorBoundary.tsx +0 -0
  178. /package/src/{common → Common}/Icons.js +0 -0
@@ -0,0 +1,328 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import {
3
+ View,
4
+ StatusBar,
5
+ Text,
6
+ Image,
7
+ Platform,
8
+ TouchableOpacity,
9
+ Dimensions,
10
+ StyleSheet,
11
+ ScrollView,
12
+ TouchableWithoutFeedback,
13
+ Keyboard,
14
+ SafeAreaView,
15
+ Linking,
16
+ BackHandler,
17
+ } from 'react-native';
18
+ import { normalize } from '../CommonStyle/componentStyle';
19
+ import Icon from '../Common/Icons';
20
+ import Loader from '../Custom/Loader';
21
+ import { useIsFocused } from '../Navigation/useIsFocused';
22
+ import { useNavigation } from '../Navigation/useNavigation';
23
+ import RNFetchBlob from 'react-native-blob-util';
24
+ import { Global } from '../../../../../src/Common/Global';
25
+ import { isNU } from '../CommonStyle/ComponentFunctions';
26
+ import RNExitApp from 'react-native-exit-app';
27
+ import HView from '../HOC/HView';
28
+ import { APIURL } from '../../../../../src/Common/apiConstants';
29
+
30
+ /**
31
+ * Login Component
32
+ *
33
+ * Handles the main login screen functionality of the application
34
+ *
35
+ * @param {Object} props - Component props passed from parent
36
+ * @returns {React.ReactElement} Rendered login screen
37
+ */
38
+ function Login(props) {
39
+ // State variables
40
+ const [data, setData] = useState(props.route.params.data);
41
+ const [isLoading, setIsLoading] = useState(false);
42
+
43
+ // Hooks and dimensions
44
+ const { width, height } = Dimensions.get('screen');
45
+ const isFocused = useIsFocused();
46
+ const navigation = useNavigation();
47
+
48
+ // Handle back button press to exit app
49
+ useEffect(() => {
50
+ const backAction = () => {
51
+ if (!navigation.isFocused()) {
52
+ return false;
53
+ }
54
+
55
+ RNExitApp.exitApp();
56
+ return true;
57
+ };
58
+
59
+ const backHandler = BackHandler.addEventListener(
60
+ 'hardwareBackPress',
61
+ backAction,
62
+ );
63
+
64
+ return () => backHandler.remove();
65
+ }, [navigation]);
66
+
67
+ /**
68
+ * Get file extension from filename
69
+ * @param {string} filename - The file name to extract extension from
70
+ * @returns {string|undefined} - The file extension
71
+ */
72
+ const getExtention = filename => {
73
+ return /[.]/.exec(filename) ? /[^.]+$/.exec(filename) : undefined;
74
+ };
75
+
76
+ /**
77
+ * Downloads an image from URL to device storage
78
+ */
79
+ const downloadImage = () => {
80
+ let date = new Date();
81
+ let image_URL = 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png';
82
+ let ext = getExtention(image_URL);
83
+ ext = '.' + ext[0];
84
+
85
+ const { config, fs } = RNFetchBlob;
86
+ let PictureDir = fs.dirs.PictureDir;
87
+
88
+ let options = {
89
+ fileCache: true,
90
+ addAndroidDownloads: {
91
+ useDownloadManager: true,
92
+ notification: true,
93
+ path: PictureDir + '/image_' + Math.floor(date.getTime() + date.getSeconds() / 2) + ext,
94
+ description: 'Image',
95
+ },
96
+ };
97
+
98
+ config(options)
99
+ .fetch('GET', image_URL)
100
+ .then(res => {
101
+ console.log('res -> ', JSON.stringify(res));
102
+ alert('Image Downloaded Successfully.');
103
+ });
104
+ };
105
+
106
+ const hospitalBgImage = Global.HospitalData?.bgimage || 'https://i.ibb.co/jvj0wdH/Adams-Neilson.jpg';
107
+
108
+ return (
109
+ <SafeAreaView style={styles.container}>
110
+ <StatusBar
111
+ translucent
112
+ backgroundColor="transparent"
113
+ barStyle={Platform.OS === 'ios' ? 'light-content' : 'dark-content'} />
114
+
115
+ <TouchableWithoutFeedback>
116
+ <View style={styles.container}>
117
+ {/* App Title */}
118
+ <Text
119
+ style={[
120
+ styles.titleText,
121
+ {
122
+ paddingHorizontal: 30,
123
+ textShadowColor: Global.AppTheme.primary_color,
124
+ textShadowOffset: { width: normalize(5), height: normalize(5) },
125
+ textShadowRadius: normalize(15),
126
+ textAlign: 'center',
127
+ },
128
+ ]}
129
+ >
130
+ {'HOMES'}
131
+ </Text>
132
+
133
+ <ScrollView keyboardShouldPersistTaps="handled">
134
+ <View style={styles.contentContainer}>
135
+ {/* Header Image */}
136
+ <View>
137
+ <Image
138
+ style={styles.headerImage}
139
+ source={{ uri: hospitalBgImage }}
140
+ />
141
+
142
+ {/* Customer Service Button */}
143
+ <TouchableOpacity
144
+ style={styles.customerServiceButton}
145
+ onPress={() => Linking.openURL(`tel:${Global.HospitalData.customercare}`)}
146
+ >
147
+ <Icon.AntDesign
148
+ name="customerservice"
149
+ color="#fff"
150
+ size={normalize(17)}
151
+ />
152
+ </TouchableOpacity>
153
+ </View>
154
+
155
+ {/* Login Form */}
156
+ <View style={styles.bottomView}>
157
+ <HView
158
+ component={'InsureLoginLayout'}
159
+ loader={val => (val === undefined ? null : setIsLoading(val))}
160
+ />
161
+ </View>
162
+ </View>
163
+
164
+ {/* Company Logo Section */}
165
+ <View style={styles.companyLogoSection}>
166
+ <TouchableOpacity
167
+ onPress={() => Linking.openURL('http://jescontechnologies.com/')}
168
+ style={styles.footer_container}
169
+ >
170
+ <View style={styles.companyinfo_container}>
171
+ <Image
172
+ style={styles.companyLogo}
173
+ source={{ uri: 'https://i.ibb.co/dkNbcDN/jesconnewlogo.jpg' }}
174
+ />
175
+ <Image
176
+ style={styles.company_icon}
177
+ source={{ uri: `${APIURL}insurancefile/getCommonFile/image/companyaddress_transparent.png` }}
178
+ />
179
+ </View>
180
+ </TouchableOpacity>
181
+ </View>
182
+ </ScrollView>
183
+
184
+ {/* App Version Display */}
185
+ <View style={styles.versionContainer}>
186
+ {Platform.OS !== 'ios' && (
187
+ <Text style={styles.versionText}>
188
+ {Global.CodePushVersion}
189
+ </Text>
190
+ )}
191
+ <Text style={styles.versionText}>
192
+ {isNU(Global.version) ? `V ${Global.version}` : null}
193
+ </Text>
194
+ </View>
195
+
196
+ {/* Footer Icons */}
197
+ {/* <View style={styles.footerIconsContainer}>
198
+ <View style={styles.footerIconsRow}>
199
+ {data?.loginfootericons?.map((item, i) => (
200
+ <CVectorIcon
201
+ key={i}
202
+ data={{
203
+ disabled: false,
204
+ displaytext: item.displaytext,
205
+ fontcolor: item.color,
206
+ fontWeight: 'bold',
207
+ size: 12,
208
+ iconname: item.iconname,
209
+ iconcolor: item.color,
210
+ iconsize: 22,
211
+ functionid: 'DF01',
212
+ }}
213
+ callBack={val =>
214
+ val === undefined
215
+ ? null
216
+ : props.navigation.navigate('WebPage', { data: item })
217
+ }
218
+ />
219
+ ))}
220
+ </View>
221
+ </View> */}
222
+
223
+ {/* Loading Indicator */}
224
+ {isLoading && <Loader displaytext={true} />}
225
+ </View>
226
+ </TouchableWithoutFeedback>
227
+ </SafeAreaView>
228
+ );
229
+ }
230
+
231
+ export default Login;
232
+
233
+ const styles = StyleSheet.create({
234
+ container: {
235
+ flex: 1,
236
+ },
237
+ contentContainer: {
238
+ flex: 1,
239
+ marginBottom: Platform.OS !== 'web' ? normalize(100) : normalize(50),
240
+ },
241
+ titleText: {
242
+ position: 'absolute',
243
+ top: Dimensions.get('screen').height * 0.05,
244
+ alignSelf: 'center',
245
+ color: '#fff',
246
+ zIndex: 1,
247
+ elevation: 5,
248
+ fontWeight: 'bold',
249
+ fontSize: normalize(40),
250
+ },
251
+ headerImage: {
252
+ height: Dimensions.get('screen').height * 0.25,
253
+ width: '100%',
254
+ opacity: 0.7,
255
+ },
256
+ customerServiceButton: {
257
+ position: 'absolute',
258
+ top: normalize(60),
259
+ right: normalize(20),
260
+ backgroundColor: Global.AppTheme.primary_color,
261
+ padding: normalize(5),
262
+ borderRadius: 1000,
263
+ },
264
+ bottomView: {
265
+ backgroundColor: '#fff',
266
+ opacity: 0.95,
267
+ marginTop: normalize(-50),
268
+ borderRadius: normalize(20),
269
+ marginHorizontal: normalize(7),
270
+ paddingHorizontal: normalize(15),
271
+ },
272
+ companyLogoSection: {
273
+ position: Platform.OS !== 'web' && 'absolute',
274
+ bottom: normalize(50),
275
+ backgroundColor: '#fff',
276
+ },
277
+ footer_container: {
278
+ marginBottom: '1%',
279
+ alignItems: 'center',
280
+ width: '100%',
281
+ },
282
+ companyinfo_container: {
283
+ flexDirection: 'row',
284
+ height: normalize(45),
285
+ width: '100%',
286
+ justifyContent: 'flex-start',
287
+ alignItems: 'flex-start',
288
+ },
289
+ companyLogo: {
290
+ width: '47%',
291
+ height: '100%',
292
+ borderRadius: 0,
293
+ margin: 5,
294
+ resizeMode: 'cover',
295
+ },
296
+ company_icon: {
297
+ width: '47%',
298
+ height: '100%',
299
+ borderRadius: 0,
300
+ margin: 5,
301
+ resizeMode: 'contain',
302
+ },
303
+ versionContainer: {
304
+ position: 'absolute',
305
+ bottom: 0,
306
+ zIndex: 1,
307
+ alignSelf: 'center',
308
+ },
309
+ versionText: {
310
+ color: Global.AppTheme.secondary_color,
311
+ fontSize: normalize(10),
312
+ alignSelf: 'center',
313
+ fontWeight: 'bold',
314
+ },
315
+ footerIconsContainer: {
316
+ position: 'absolute',
317
+ bottom: 0,
318
+ backgroundColor: '#fff',
319
+ width: '100%',
320
+ height: normalize(45),
321
+ justifyContent: 'center',
322
+ },
323
+ footerIconsRow: {
324
+ flexDirection: 'row',
325
+ justifyContent: 'space-between',
326
+ paddingHorizontal: normalize(15),
327
+ },
328
+ });
@@ -0,0 +1,149 @@
1
+ import React, { useState } from 'react';
2
+ import { View, Text, FlatList, TouchableOpacity, RefreshControl, Linking } from 'react-native';
3
+ import Ionicons from 'react-native-vector-icons/Ionicons';
4
+ import moment from 'moment';
5
+ import { normalize } from '../CommonStyle/componentStyle';
6
+ import { notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
7
+ import CContainerView from '../CustomComponents/CContainerView';
8
+ import HeaderBlock from './HeaderBlock';
9
+ import CDetailView from '../CustomComponents/CDetailView';
10
+ import NotificationContext from '../Handlers/NoticationsContext';
11
+ import { Global } from '../../../../../src/Common/Global';
12
+ import HHeading from '../HOC/HHeading';
13
+ import Icons from '../Common/Icons';
14
+
15
+ const Notifications = (props) => {
16
+
17
+ var TestArray = [{ "code": 12, "displayheader": "UPDATE", "displaytext": "Updates are available ", "status": true, "patientnumber": 0, "patientname": "", "tokennumber": 0, "phonenumber": "", "qrcode": 0, "date": "2022-12-07T15:59:00", "time": "2022-12-07T15:59:00" }, { "code": 11, "displayheader": "Consultation", "displaytext": "Booking is confirmed on 31st Dec 2022 for CHRISTY MARIA; Token Number :6 Patient name :HAROLD LOUIS TEST", "status": false, "patientnumber": 0, "patientname": "HAROLD LOUIS TEST", "tokennumber": 6, "phonenumber": "7338483582", "qrcode": 2345, "date": "2022-12-07T15:15:00", "time": "2022-12-07T15:15:00" }, { "code": 8, "displayheader": "Consultation", "displaytext": "Booking is confirmed on 30th Dec 2022 for SR.ROSE MAVELIKUNNEL MBBS,DGO; Token Number :19 Patient name :ALVIN ANTONY", "status": false, "patientnumber": 0, "patientname": "ALVIN ANTONY", "tokennumber": 19, "phonenumber": "7338483582", "qrcode": 2345, "date": "2022-12-06T14:53:00", "time": "2022-12-06T14:53:00" }, { "code": 7, "displayheader": "Consultation", "displaytext": "Booking is confirmed on 28th Dec 2022 for CHRISTY MARIA; Token Number :4 Patient name :HAROLD LOUIS", "status": false, "patientnumber": 0, "patientname": "HAROLD LOUIS", "tokennumber": 4, "phonenumber": "7338483582", "qrcode": 2345, "date": "2022-12-05T16:23:00", "time": "2022-12-05T16:23:00" }, { "code": 1, "displayheader": "HEADER", "displaytext": "NOTIFICATIONS", "status": false, "patientnumber": 0, "patientname": "", "tokennumber": 0, "phonenumber": "", "qrcode": 0, "date": "2022-12-05T12:28:00", "time": "2022-12-05T12:28:00" }]
18
+
19
+ const NoticationData = React.useContext(
20
+ NotificationContext,
21
+ );
22
+ // console.log("RRRRRRRRRREEEEEEEEESSSSSVARRRRRRRRRR",JSON.stringify(NoticationData))
23
+ var today = new Date()
24
+ const [NotificationArr, setNotificationArr] = useState(NoticationData)
25
+ const [refresh, setRefresh] = useState(0)
26
+ const [pulltorefresh] = useState(false)
27
+
28
+ return (
29
+ <CContainerView>
30
+ <HeaderBlock navigation={props.navigation} />
31
+
32
+ <CDetailView userlist={false}>
33
+ <View style={{ marginTop: normalize(-3), flex: 1 }}>
34
+ <HHeading
35
+ styles={{
36
+ "iconname": 'bell',
37
+ "bgcolor": "#f2efef",
38
+ "iconsize": 16,
39
+ "iconcolor": Global.AppTheme.primary_color,
40
+ "displaytext": "Notifications",
41
+ "textsize": 14,
42
+ "textcolor": Global.AppTheme.primary_color
43
+ }}
44
+ callBack={val => (val == undefined ? null : console.log(val))}>
45
+ </HHeading>
46
+
47
+ <View style={{ flex: 1, backgroundColor: '#f2efef' }}>
48
+ <FlatList
49
+ data={NotificationArr}
50
+ renderItem={renderItem}
51
+ style={{ flex: 1 }}
52
+ initialNumToRender={10}
53
+ maxToRenderPerBatch={20}
54
+ refreshControl={
55
+ <RefreshControl
56
+ refreshing={pulltorefresh}
57
+ size={"large"}
58
+ tintColor={"blue"}
59
+ colors={["red", "green", "cyan", "black"]}
60
+ progressBackgroundColor={"white"}
61
+ onRefresh={() => console.log("......Refresh.....")}
62
+ />
63
+ }
64
+ contentContainerStyle={{ marginHorizontal: 10 }}
65
+ keyExtractor={(item, index) => 'key' + index}
66
+ />
67
+ </View>
68
+ </View>
69
+ </CDetailView>
70
+ </CContainerView>
71
+ )
72
+
73
+ function urlify(text) {
74
+ var urlRegex = /(https?:\/\/[^\s]+)/g;
75
+ var x
76
+ text.replace(urlRegex, function (url) {
77
+ x = url
78
+ })
79
+ return x
80
+ }
81
+
82
+ function getLink(params) {
83
+ var linkUrl = urlify(params.displaytext)
84
+ if (linkUrl != undefined && linkUrl != null) {
85
+ Linking.openURL(linkUrl).catch(err => notifyMessage("Couldn't load page", 4))
86
+ }
87
+ }
88
+
89
+ function getNotification(data) {
90
+ switch (data.type) {
91
+ case 4: console.log("LAB RESULTS PRESSED")
92
+ break;
93
+
94
+ default: getLink(data)
95
+ break;
96
+ }
97
+
98
+ data.status = false
99
+ setRefresh(refresh + 1)
100
+ }
101
+
102
+ function getIcons(data) {
103
+ switch (data.type) {
104
+ case 4: return "microscope"
105
+ default:return "bell"
106
+ }
107
+ }
108
+
109
+ function getTimeCalculate(datePassed) {
110
+ var newDate = moment(today).format('DD/MM/YYYY');
111
+ var fromdate = moment(datePassed).format('DD/MM/YYYY');
112
+
113
+ var a = moment(newDate, 'DD/MM/YYYY');
114
+ var b = moment(fromdate, 'DD/MM/YYYY');
115
+ var diffDays = b.diff(a, 'days');
116
+ return -diffDays == 0 ? "Today" : -diffDays + " Days ago"
117
+ }
118
+
119
+ function renderItem({ item }) {
120
+ return (
121
+ <TouchableOpacity onPress={() => getNotification(item)}
122
+ style={{
123
+ backgroundColor: !item.status ? 'transparent' : '#fff', marginVertical: normalize(4),
124
+ flexDirection: 'row', paddingVertical: 10, borderRadius: 10, borderWidth: 1, borderColor: '#d8d6d6'
125
+ }}>
126
+ <View style={{ alignItems: 'center', justifyContent: 'center', width: '15%' }}>
127
+ <Icons.FontAwesome5 name={getIcons(item)} color="black" size={normalize(25)} />
128
+ </View>
129
+ <View style={{ flexDirection: 'column', width: '80%' }}>
130
+ <Text style={{ fontWeight: '700', color: '#626263' }}>{item.displayheader}</Text>
131
+ <Text style={{ fontSize: normalize(12), color: '#626263' }}>{item.displaytext}</Text>
132
+ <View style={{ flexDirection: 'column' }}>
133
+ <Text style={{ fontSize: normalize(12), color: '#626263' }}>{getTimeCalculate(item.time)} |{" "}
134
+ <Ionicons name={item.status ? 'eye-outline' : 'ios-eye-off-outline'} color="#626263"
135
+ size={normalize(15)} />
136
+ </Text>
137
+ </View>
138
+ </View>
139
+
140
+ {ValueCheck(item.user) ?
141
+ <View style={{ position: 'absolute', bottom: normalize(5), right: normalize(5) }}>
142
+ <Text style={{ fontSize: normalize(11), color: '#626263' }}>{"USERNAME"}</Text>
143
+ </View> : null}
144
+
145
+ </TouchableOpacity>
146
+ )
147
+ }
148
+ }
149
+ export default Notifications;
@@ -0,0 +1,20 @@
1
+ import COcrScanner from "../CustomComponents/COcrScanner";
2
+
3
+
4
+ export default function OcrScreen(props) {
5
+
6
+ return (
7
+ <COcrScanner
8
+ imageurl={[
9
+ {
10
+ "url": "https://imgv3.fotor.com/images/blog-cover-image/How-to-Make-Text-Stand-Out-And-More-Readable.jpg"
11
+ },
12
+ {
13
+ "url": "https://im.indiatimes.in/content/2022/Sep/Kerala-Doctors-Handwriting-Goes-Viral-For-Being-Too-Neat_633690f2b67a7.jpg?w=1200&h=900&cc=1&webp=1&q=75"
14
+ }
15
+ ]}
16
+ pdfurl={[{ "url": "https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf" }]}
17
+ />
18
+ )
19
+
20
+ }