@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
@@ -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 '../Common/Global';
22
- import Icons from '../Common/Icons';
23
- import NetworkServiceCall from '../Common/NetworkServiceCall';
24
- import { APIURL } from '../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
- });