@jescon-technologies/react-native-ui-kit 0.0.9 → 0.0.11

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.
@@ -1,4 +1,3 @@
1
-
2
1
  import ComponentStyles from '../CommonStyle/componentStyle';
3
2
  import { colors, fontWeight } from '../CommonStyle/commonStyle';
4
3
  import {
@@ -12,8 +11,10 @@ import {
12
11
  Dimensions,
13
12
  View,
14
13
  Image,
14
+ ViewStyle,
15
+ TextStyle,
16
+ ImageStyle,
15
17
  } from 'react-native';
16
- import Sound from 'react-native-sound';
17
18
  import NetInfo from '@react-native-community/netinfo';
18
19
  import { Global } from '../../../../../src/Common/Global';
19
20
  import { APIURL } from '../../../../../src/Common/apiConstants';
@@ -26,20 +27,31 @@ const {
26
27
 
27
28
  const scale = SCREEN_WIDTH / 320;
28
29
 
29
- export function getSound(code) {
30
- Sound.setCategory('Playback');
31
- const track = new Sound(code, Sound.MAIN_BUNDLE, (e) => {
32
- if (e) {
33
- console.log('error loading track:', e);
34
- } else {
35
- console.log('Playings');
36
- track.play();
37
- }
38
- });
30
+ // Type definitions
31
+ interface ShadowStyle {
32
+ elevation?: number;
33
+ shadowColor?: string;
34
+ shadowOffset?: { width: number; height: number };
35
+ shadowOpacity?: number;
36
+ shadowRadius?: number;
37
+ boxShadow?: string;
39
38
  }
40
39
 
41
- export function CButtonShadow() {
40
+ interface WeekDay {
41
+ datavalue: number;
42
+ displayvalue: string;
43
+ selected: boolean;
44
+ }
42
45
 
46
+ interface NetInfoState {
47
+ type: string;
48
+ isConnected: boolean | null;
49
+ isInternetReachable: boolean | null;
50
+ details?: any;
51
+ }
52
+
53
+ // Shadow Functions
54
+ export function CButtonShadow(): ShadowStyle {
43
55
  const isAndroidBelow9 = Platform.OS === 'android' && Platform.Version < 28;
44
56
  return isAndroidBelow9 ? {
45
57
  elevation: 10,
@@ -48,12 +60,11 @@ export function CButtonShadow() {
48
60
  shadowOpacity: 0,
49
61
  shadowRadius: 20,
50
62
  } : {
51
- boxShadow: `-3 3 6 -1 ${Global.AppTheme.primary_color}`,
52
- }; // offsetX offsetY blurRadius spreadDistance color
63
+ boxShadow: `-3px 3px 6px -1px ${Global.AppTheme.primary_color}`,
64
+ };
53
65
  }
54
66
 
55
- export function CFooterShadow() {
56
-
67
+ export function CFooterShadow(): ShadowStyle {
57
68
  const isAndroidBelow9 = Platform.OS === 'android' && Platform.Version < 28;
58
69
  return isAndroidBelow9 ? {
59
70
  elevation: 10,
@@ -62,14 +73,35 @@ export function CFooterShadow() {
62
73
  shadowOpacity: 0,
63
74
  shadowRadius: 20,
64
75
  } : {
65
- boxShadow: `0 4 10 0 ${Global.AppTheme.primary_color}`,
66
- }; // offsetX offsetY blurRadius spreadDistance color
76
+ boxShadow: `0px 4px 10px 0px ${Global.AppTheme.primary_color}`,
77
+ };
67
78
  }
68
79
 
69
- export function LoaderIndicator(i) {
80
+ export function CShadowDynamic(
81
+ offsetX: number = 0,
82
+ offsetY: number = 2,
83
+ blurRadius: number = 6,
84
+ spreadDistance: number = 0,
85
+ color: string = 'rgba(0, 0, 0, 0.2)',
86
+ ): ShadowStyle {
87
+ const isAndroidBelow9 = Platform.OS === 'android' && Platform.Version < 28;
70
88
 
71
- return (
89
+ return isAndroidBelow9
90
+ ? {
91
+ elevation: 6,
92
+ shadowColor: color,
93
+ shadowOffset: { width: offsetX, height: offsetY },
94
+ shadowOpacity: 0.25,
95
+ shadowRadius: blurRadius,
96
+ }
97
+ : {
98
+ boxShadow: `${offsetX}px ${offsetY}px ${blurRadius}px ${spreadDistance}px ${color}`,
99
+ };
100
+ }
72
101
 
102
+ // Loader Components
103
+ export function LoaderIndicator(i?: any): React.JSX.Element {
104
+ return (
73
105
  <View style={{
74
106
  backgroundColor: '#ffffff',
75
107
  padding: normalize(10),
@@ -82,16 +114,21 @@ export function LoaderIndicator(i) {
82
114
  width: normalize(35),
83
115
  height: normalize(35),
84
116
  }}
85
- // source={require('../Assets/gif/loading.gif')}
86
- source={{uri: `${APIURL}file/getCommonFile/image/heartpulse.gif`}}
117
+ source={{ uri: `${APIURL}file/getCommonFile/image/heartpulse.gif` }}
87
118
  resizeMode={Image.resizeMode.contain}
88
119
  />
89
120
  </View>
90
121
  );
122
+ }
91
123
 
124
+ export function Loader(): React.JSX.Element {
125
+ return (
126
+ <ActivityIndicator size={normalize(30)} style={{ marginTop: normalize(10) }} color="red" />
127
+ );
92
128
  }
93
129
 
94
- export function normalize(size) {
130
+ // Utility Functions
131
+ export function normalize(size: number): number {
95
132
  const newSize = scale < 1.5 ? size * scale : size * 1.6;
96
133
  if (Platform.OS === 'ios') {
97
134
  return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 2;
@@ -100,129 +137,107 @@ export function normalize(size) {
100
137
  }
101
138
  }
102
139
 
103
- export function Loader() {
104
- return (
105
- <ActivityIndicator size={normalize(30)} style={{ marginTop: normalize(10) }} color="red" />
106
- );
107
- }
108
-
109
- export function CShadowDynamic(
110
- offsetX = 0,
111
- offsetY = 2,
112
- blurRadius = 6,
113
- spreadDistance = 0,
114
- color = 'rgba(0, 0, 0, 0.2)',
115
- ) {
116
- const isAndroidBelow9 = Platform.OS === 'android' && Platform.Version < 28;
117
-
118
- return isAndroidBelow9
119
- ? {
120
- elevation: 6,
121
- shadowColor: color,
122
- shadowOffset: {width: offsetX, height: offsetY},
123
- shadowOpacity: 0.25,
124
- shadowRadius: blurRadius,
125
- }
126
- : {
127
- boxShadow: `${offsetX}px ${offsetY}px ${blurRadius}px ${spreadDistance}px ${color}`,
128
- };
129
- }
130
-
131
- export async function getAppVersion() {
132
- var Ver = 1.1;
133
- const Results = await codePush.getUpdateMetadata();
134
- if (Results) {
135
- if (Results.isPending == false) {
136
- Ver = Results.appVersion + Results.label;
137
- } else {
138
- Ver = Results.appVersion + Results.label + ' NOT UPDATED !!!';
139
- }
140
- }
141
- return Ver;
142
- }
143
-
144
140
 
145
- /**
146
- * To check whether value is true && null && undefined
147
- */
148
- export function isBNU(i) {
141
+ // Value Check Functions
142
+ export function isBNU(i: any): boolean {
149
143
  return (i && i != null && i != undefined ? true : false);
150
144
  }
151
145
 
152
- /**
153
- * To check whether value is null && undefined
154
- */
155
- export function isNU(i) { return (i != null && i != undefined ? true : false); }
146
+ export function isNU(i: any): boolean {
147
+ return (i != null && i != undefined ? true : false);
148
+ }
156
149
 
157
- /**
158
- * To check whether value is null && undefined && length > 0
159
- */
160
- export function isNUL(i) { return (i != null && i != undefined && i.length > 0 ? true : false); }
150
+ export function isNUL(i: any[] | string | null | undefined): boolean {
151
+ return (i != null && i != undefined && i.length > 0 ? true : false);
152
+ }
161
153
 
162
- /**
163
- * To check whether value is null && undefined && !=""
164
- */
165
- export function isNUQ(i) { return (i != null && i != undefined && i != '' ? true : false); }
154
+ export function isNUQ(i: any): boolean {
155
+ return (i != null && i != undefined && i !== '' ? true : false);
156
+ }
166
157
 
167
- /**
168
- * To check whether value is null && undefined && !="" && != 0
169
- */
170
- export function isNUQZ(i) { return (i != null && i != undefined && i != '' && i != 0 ? true : false); }
158
+ export function isNUQZ(i: any): boolean {
159
+ return (i != null && i != undefined && i !== '' && i !== 0 ? true : false);
160
+ }
171
161
 
172
- /**
173
- * To check whether value is true && null && undefined && length > 0
174
- */
175
- export function isBNUL(i) {
162
+ export function isBNUL(i: any[] | string | null | undefined): boolean {
176
163
  return (i && i != null && i != undefined && i.length > 0 ? true : false);
177
164
  }
178
165
 
179
- export function isOrganism(i) {
166
+ // Type Check Functions
167
+ export function isOrganism(i: number): boolean {
180
168
  return (i == 3 ? true : false);
181
169
  }
182
170
 
183
- export function isDescription(i) {
171
+ export function isDescription(i: number): boolean {
184
172
  return (i == 1 || i == 6 || i == 7 || i == 8 ? true : false);
185
173
  }
186
174
 
187
- export function isValueBased(i) {
175
+ export function isValueBased(i: number): boolean {
188
176
  return (i == 2 || i == 4 || i == 5 ? true : false);
189
177
  }
190
178
 
191
- export function dlog(i) {
192
- if (__DEV__) {
193
- return console.log(i);
194
- }
195
- else {
179
+ export function isDes(i: number): boolean {
180
+ return (i == 1 ? true : false);
181
+ }
182
+
183
+ export function isVal(i: number): boolean {
184
+ return (i == 2 ? true : false);
185
+ }
186
+
187
+ export function isOrg(i: number): boolean {
188
+ return (i == 3 ? true : false);
189
+ }
190
+
191
+ export function isSero(i: number): boolean {
192
+ return (i == 4 ? true : false);
193
+ }
194
+
195
+ export function isViro(i: number): boolean {
196
+ return (i == 5 ? true : false);
197
+ }
198
+
199
+ export function isPath(i: number): boolean {
200
+ return (i == 6 ? true : false);
201
+ }
196
202
 
203
+ // Debug Functions
204
+ export function dlog(i: any): void {
205
+ if (__DEV__) {
206
+ console.log(i);
197
207
  }
198
208
  }
199
209
 
200
- export function cdev() {
210
+ export function cdev(): boolean {
201
211
  if (__DEV__) {
202
212
  return true;
203
- }
204
- else {
213
+ } else {
205
214
  return false;
206
215
  }
207
216
  }
208
217
 
209
- export function clog(i) {
210
- return console.log(i);
218
+ export function clog(i: any): void {
219
+ console.log(i);
211
220
  }
212
221
 
213
-
214
-
215
-
216
- export function ValueCheck(value) {
222
+ // Validation Functions
223
+ export function ValueCheck(value: any): boolean {
217
224
  if (value) {
218
225
  return true;
219
226
  } else {
220
- false;
227
+ return false;
221
228
  }
222
229
  }
223
230
 
224
- export function convertStringToArrayWeekDay(inputString) {
225
- const days = [
231
+ export function ArrayCheck(value: any[] | null | undefined): boolean {
232
+ if (value && value.length > 0) {
233
+ return true;
234
+ } else {
235
+ return false;
236
+ }
237
+ }
238
+
239
+ export function convertStringToArrayWeekDay(inputString: string): WeekDay[] {
240
+ const days: WeekDay[] = [
226
241
  { datavalue: 1, displayvalue: 'Su', selected: true },
227
242
  { datavalue: 2, displayvalue: 'M', selected: true },
228
243
  { datavalue: 3, displayvalue: 'Tu', selected: true },
@@ -237,28 +252,20 @@ export function convertStringToArrayWeekDay(inputString) {
237
252
  datavalue: day.datavalue,
238
253
  displayvalue: day.displayvalue,
239
254
  selected: selectedDays.includes(day.datavalue) ? false : true,
240
- // selected: day.selected,
241
255
  };
242
256
  });
243
257
  }
244
258
 
245
- export function ArrayCheck(value) {
246
- if (value && value.length > 0) {
247
- return true;
248
- } else {
249
- false;
250
- }
251
- }
252
-
253
- export async function isPermitted() {
259
+ // Permission Functions
260
+ export async function isPermitted(): Promise<boolean> {
254
261
  if (Platform.OS === 'android') {
255
262
  try {
256
- const apiLevel = Platform.Version;
263
+ const apiLevel = Platform.Version as number;
257
264
 
258
265
  // Android 13+ (API 33+) - need READ_MEDIA permissions
259
266
  if (apiLevel >= 33) {
260
267
  const granted = await PermissionsAndroid.request(
261
- PermissionsAndroid.PERMISSIONS.READ_MEDIA_IMAGES
268
+ PermissionsAndroid.PERMISSIONS.READ_MEDIA_IMAGES as any
262
269
  );
263
270
  return granted === PermissionsAndroid.RESULTS.GRANTED;
264
271
  }
@@ -273,7 +280,7 @@ export async function isPermitted() {
273
280
  );
274
281
  return granted === PermissionsAndroid.RESULTS.GRANTED;
275
282
  }
276
- } catch (err) {
283
+ } catch (err: any) {
277
284
  Alert.alert('File access Permission not allowed', err.toString());
278
285
  return false;
279
286
  }
@@ -282,36 +289,14 @@ export async function isPermitted() {
282
289
  }
283
290
  }
284
291
 
285
- export function getLoading(load) {
292
+ // Network Functions
293
+ export function getLoading(load: () => void): void {
286
294
  setTimeout(load, 15000);
287
295
  }
288
- export function isDes(i) {
289
- return (i == 1 ? true : false);
290
- }
291
-
292
- export function isVal(i) {
293
- return (i == 2 ? true : false);
294
- }
295
-
296
- export function isOrg(i) {
297
- return (i == 3 ? true : false);
298
- }
299
-
300
- export function isSero(i) {
301
- return (i == 4 ? true : false);
302
- }
303
-
304
- export function isViro(i) {
305
- return (i == 5 ? true : false);
306
- }
307
-
308
- export function isPath(i) {
309
- return (i == 6 ? true : false);
310
- }
311
296
 
312
- export function isConnected() {
297
+ export function isConnected(): Promise<void> {
313
298
  return new Promise((resolve, reject) => {
314
- NetInfo.fetch().then(state => {
299
+ NetInfo.fetch().then((state: NetInfoState) => {
315
300
  console.log('Connection type', state.type);
316
301
  console.log('Is connected?', state.isConnected);
317
302
  console.log('Is Internet?', state.isInternetReachable);
@@ -319,70 +304,59 @@ export function isConnected() {
319
304
 
320
305
  if (state.isConnected && state.isInternetReachable) {
321
306
  resolve();
322
- }
323
- else {
307
+ } else {
324
308
  reject();
325
309
  }
326
310
  });
327
311
  });
328
312
  }
329
313
 
330
- //Footer icon
331
- export function getFooterIcon(opacity) {
332
- return (
333
- {
334
- ...ComponentStyles.footer_Icon,
335
- opacity: opacity,
336
- }
337
- );
314
+ // Footer Functions
315
+ export function getFooterIcon(opacity: number): ViewStyle {
316
+ return {
317
+ ...ComponentStyles.footer_Icon,
318
+ opacity: opacity,
319
+ };
338
320
  }
339
321
 
340
- export function notifyMessage(msg, type) {
322
+ export function notifyMessage(msg: string, type?: any): void {
341
323
  DeviceEventEmitter.emit('event.testToast', {
342
324
  'displaytext': msg,
343
325
  'datavalue': type,
344
326
  });
345
-
346
- // let X = bottom != undefined && bottom != null ? bottom : 80
347
- // if (Platform.OS === 'android') {
348
- // ToastAndroid.showWithGravityAndOffset(msg, ToastAndroid.LONG, ToastAndroid.BOTTOM,
349
- // 0,
350
- // X)
351
- // } else {
352
- // Alert.alert(msg);
353
- // }
354
327
  }
355
328
 
356
- export function getFooterIconText(opacity, color) {
357
- return (
358
- {
359
- ...ComponentStyles.footer_Icon_Text,
360
- opacity: opacity,
361
- color: color,
362
- }
363
- );
329
+ export function getFooterIconText(opacity: number, color: string): TextStyle {
330
+ return {
331
+ ...ComponentStyles.footer_Icon_Text,
332
+ opacity: opacity,
333
+ color: color,
334
+ };
364
335
  }
365
336
 
366
- // Header Section
367
-
368
- export function getHeaderBlockContainer(width) {
369
- return (
370
- {
371
- ...ComponentStyles.header_section_conatiner_style,
372
- width: width,
373
- paddingTop: '5%',
374
- }
375
- );
337
+ // Header Functions
338
+ export function getHeaderBlockContainer(width: number): ViewStyle {
339
+ return {
340
+ ...ComponentStyles.header_section_conatiner_style,
341
+ width: width,
342
+ paddingTop: '5%',
343
+ };
376
344
  }
377
- export function getHeaderTitleContainer(width) {
378
- return (
379
- {
380
- justifyContent: 'flex-end', paddingLeft: width * 0.02,
381
- }
382
- );
345
+
346
+ export function getHeaderTitleContainer(width: number): ViewStyle {
347
+ return {
348
+ justifyContent: 'flex-end',
349
+ paddingLeft: width * 0.02,
350
+ };
383
351
  }
384
352
 
385
- export function getResultViewObservedvalueTextvalidate(value, minvalue, maxvalue, datatype) {
353
+ // Result View Functions
354
+ export function getResultViewObservedvalueTextvalidate(
355
+ value: any,
356
+ minvalue: number | null | undefined,
357
+ maxvalue: number | null | undefined,
358
+ datatype: string
359
+ ): string {
386
360
  switch (datatype) {
387
361
  case 'integer':
388
362
  case 'numeric':
@@ -395,238 +369,228 @@ export function getResultViewObservedvalueTextvalidate(value, minvalue, maxvalue
395
369
  else {
396
370
  return colors.color_resulttext_normal;
397
371
  }
398
- break;
399
372
  default:
400
373
  return colors.color_resulttext_normal;
401
374
  }
402
375
  }
403
376
 
404
- // Profile Card
405
-
406
- export function getProfileMainContainer(item) {
407
- console.log('getProfileMainContainer', item);
408
- return (
409
- {
410
- width: '96%',
411
- backgroundColor: '#fff',
412
- flexDirection: 'row',
413
- alignItems: 'center',
414
- borderRadius: 10, elevation: 5,
415
- marginBottom: 5,
416
- borderWidth: 0.1,
417
- borderLeftWidth: 5,
418
- borderColor: item.bordercolor ? item.bordercolor : 'lightgreen',
419
- }
420
- );
421
- }
422
- export function getProfileContentLeftlogo1(item) {
423
- return (
424
- {
425
- borderRadius: 0,
426
- // backgroundColor: "blue",
427
- padding: 5,
428
- color: 'black',
429
- fontWeight: 'bold', fontSize: normalize(11),
430
- }
431
- );
432
- }
433
- export function getProfileContentLeftlogo2() {
434
- return (
435
- {
436
- backgroundColor: '#fcb5b5',
437
- padding: 5,
438
- borderRadius: 50,
439
- color: 'black',
440
- fontSize: normalize(10),
441
- }
442
- );
443
- }
444
- export function getProfileContentLogo1() {
445
- return (
446
- {
447
- fontSize: normalize(13),
448
- marginTop: 3,
449
- color: 'black',
450
- fontWeight: 'bold',
451
- }
452
- );
453
- }
454
- export function getProfileContentLogo2() {
455
- return (
456
- {
457
- fontSize: normalize(10),
458
- color: 'black',
459
- }
460
- );
461
- }
462
- export function getProfilecardSubheadingTop(color) {
463
- return (
464
- {
465
- fontSize: normalize(10),
466
- fontWeight: fontWeight.fontWeight_700,
467
- color: color,
468
- // padding: 5,
469
- paddingBottom: 0,
470
- paddingTop: 2,
471
- }
472
- );
473
- }
474
- export function getProfilecardSubheadingBottom(color, position) {
475
- return (
476
- {
477
- fontSize: normalize(10),
478
- fontWeight: fontWeight.fontWeight_100,
479
- color: color,
480
- paddingLeft: position == 'right' ? 5 : 0,
481
- paddingRight: position == 'left' ? 5 : 0,
482
- }
483
- );
377
+ // Profile Card Functions
378
+ interface ProfileItem {
379
+ bordercolor?: string;
380
+ [key: string]: any;
484
381
  }
485
382
 
486
- export function getProfilecardMobileNO(color, position) {
487
- return (
488
- {
489
- fontSize: normalize(12),
490
- // fontWeight: fontWeight.fontWeight_100,
491
- fontWeight: fontWeight.fontWeight_Bold,
492
- color: color,
493
- paddingLeft: position == 'right' ? 5 : 0,
494
- paddingRight: position == 'left' ? 5 : 0,
495
- }
496
- );
497
- }
498
- export function getProfilecardOnlineStatusBadgeContainer(backgroundcolor) {
499
- return (
500
- {
501
- backgroundColor: backgroundcolor,
502
- height: normalize(20),
503
- // width:normalize(28),
504
- paddingHorizontal: normalize(5),
505
- borderRadius: 1000,
506
- padding: 0,
507
- //elevation: 5,
508
- //borderColor:backgroundcolor,
509
- //borderWidth:1
510
- }
511
- );
512
- }
513
- export function getGroupButtonView(width) {
514
- return (
515
- {
516
- justifyContent: 'center', margin: 5,
517
- width: width * 0.10,
518
- alignContent: 'center', alignItems: 'center',
519
- }
520
- );
521
- }
522
- export function getMediaoverlayContainerStyle(height) {
523
- return (
524
- {
525
- ...ComponentStyles.mediaoverlay_containerstyle,
526
- height: height,
527
- }
528
- );
529
- }
530
- export function getMediaViewContainer(width, height, itemwidth) {
531
- return (
532
- {
533
- ...ComponentStyles.View_col_center,
534
- width: width * (itemwidth / 100),
535
- margin: height * 0.003,
536
- }
537
- );
538
- }
539
- export function getMediaViewChildContainer(width, itemwidth) {
540
- return (
541
- {
542
- borderWidth: 0.5,
543
- borderRadius: 2,
544
- width: width * (itemwidth / 100),
545
- borderColor: colors.color_componentBordercolor,
546
- }
547
- );
548
- }
549
- export function getMediaIcon(width, itemwidth) {
550
- return (
551
- {
552
- height: 120,
553
- width: width * (itemwidth / 100),
554
- }
555
- );
556
- }
557
- export function getMediaoverlayChildrenwrapperStyle(width, height, itemheight) {
558
- return (
559
- {
560
- width: width,
561
- height: itemheight,
562
- padding: height * 0.01,
563
- }
564
- );
565
- }
566
- export function getMediaoverlayTopLineContainer(width, height) {
567
- return (
568
- {
569
- ...ComponentStyles.View_col_center,
570
- width: width * 0.15, height: height * 0.02,
571
- }
572
- );
573
- }
574
- export function getMediaoverlayOptionRow(width, height) {
575
- return (
576
- {
577
- ...ComponentStyles.View_row_spacearound,
578
- borderRadius: 14,
579
- marginTop: height * 0.02, width: width * 0.90,
580
- }
581
- );
582
- }
583
- export function getMediaoverlayOptionContainer(width, height) {
584
- return (
585
- {
586
- ...ComponentStyles.View_col_center,
587
- margin: 5,
588
- height: height * 0.1,
589
- width: width * 0.20,
590
- }
591
- );
592
- }
593
- export function getMediaoverlayMsgorLoaderView(height) {
594
- return (
595
- {
596
- height: height,
597
- ...ComponentStyles.View_col_center,
598
- }
599
- );
600
- }
601
- export function getMediaGalleryChildContainer(width, height) {
602
- return (
603
- {
604
- marginTop: height * 0.01, width: width * 0.90,
605
- justifyContent: 'center', alignItems: 'center',
606
- }
607
- );
608
- }
609
- export function getMediaGalleryDeleteView(width, height) {
610
- return (
611
- {
612
- borderWidth: 0.5, borderRadius: 2,
613
- height: height / 5, width: width * 0.90,
614
- borderColor: colors.color_componentBordercolor,
615
- alignItems: 'center', justifyContent: 'center',
616
- }
617
- );
618
- }
619
- export function getMediaIconStyle(width, height) {
620
- return (
621
- {
622
- height: height / 5, width: width * 0.90,
623
- }
624
- );
625
- }
626
- export function getMediaGalleryDeleteIcon(width) {
627
- return (
628
- {
629
- height: '40%', width: width * 0.90, resizeMode: 'contain',
630
- }
631
- );
632
- }
383
+ export function getProfileMainContainer(item: ProfileItem): ViewStyle {
384
+ console.log('getProfileMainContainer', item);
385
+ return {
386
+ width: '96%',
387
+ backgroundColor: '#fff',
388
+ flexDirection: 'row',
389
+ alignItems: 'center',
390
+ borderRadius: 10,
391
+ elevation: 5,
392
+ marginBottom: 5,
393
+ borderWidth: 0.1,
394
+ borderLeftWidth: 5,
395
+ borderColor: item.bordercolor ? item.bordercolor : 'lightgreen',
396
+ };
397
+ }
398
+
399
+ export function getProfileContentLeftlogo1(item: ProfileItem): TextStyle {
400
+ return {
401
+ borderRadius: 0,
402
+ padding: 5,
403
+ color: 'black',
404
+ fontWeight: 'bold',
405
+ fontSize: normalize(11),
406
+ };
407
+ }
408
+
409
+ export function getProfileContentLeftlogo2(): TextStyle {
410
+ return {
411
+ backgroundColor: '#fcb5b5',
412
+ padding: 5,
413
+ borderRadius: 50,
414
+ color: 'black',
415
+ fontSize: normalize(10),
416
+ };
417
+ }
418
+
419
+ export function getProfileContentLogo1(): TextStyle {
420
+ return {
421
+ fontSize: normalize(13),
422
+ marginTop: 3,
423
+ color: 'black',
424
+ fontWeight: 'bold',
425
+ };
426
+ }
427
+
428
+ export function getProfileContentLogo2(): TextStyle {
429
+ return {
430
+ fontSize: normalize(10),
431
+ color: 'black',
432
+ };
433
+ }
434
+
435
+ export function getProfilecardSubheadingTop(color: string): TextStyle {
436
+ return {
437
+ fontSize: normalize(10),
438
+ fontWeight: fontWeight.fontWeight_700,
439
+ color: color,
440
+ paddingBottom: 0,
441
+ paddingTop: 2,
442
+ };
443
+ }
444
+
445
+ export function getProfilecardSubheadingBottom(color: string, position: string): TextStyle {
446
+ return {
447
+ fontSize: normalize(10),
448
+ fontWeight: fontWeight.fontWeight_100,
449
+ color: color,
450
+ paddingLeft: position == 'right' ? 5 : 0,
451
+ paddingRight: position == 'left' ? 5 : 0,
452
+ };
453
+ }
454
+
455
+ export function getProfilecardMobileNO(color: string, position: string): TextStyle {
456
+ return {
457
+ fontSize: normalize(12),
458
+ fontWeight: fontWeight.fontWeight_Bold,
459
+ color: color,
460
+ paddingLeft: position == 'right' ? 5 : 0,
461
+ paddingRight: position == 'left' ? 5 : 0,
462
+ };
463
+ }
464
+
465
+ export function getProfilecardOnlineStatusBadgeContainer(backgroundcolor: string): ViewStyle {
466
+ return {
467
+ backgroundColor: backgroundcolor,
468
+ height: normalize(20),
469
+ paddingHorizontal: normalize(5),
470
+ borderRadius: 1000,
471
+ padding: 0,
472
+ };
473
+ }
474
+
475
+ export function getGroupButtonView(width: number): ViewStyle {
476
+ return {
477
+ justifyContent: 'center',
478
+ margin: 5,
479
+ width: width * 0.10,
480
+ alignContent: 'center',
481
+ alignItems: 'center',
482
+ };
483
+ }
484
+
485
+ // Media Functions
486
+ export function getMediaoverlayContainerStyle(height: number): ViewStyle {
487
+ return {
488
+ ...ComponentStyles.mediaoverlay_containerstyle,
489
+ height: height,
490
+ };
491
+ }
492
+
493
+ export function getMediaViewContainer(width: number, height: number, itemwidth: number): ViewStyle {
494
+ return {
495
+ ...ComponentStyles.View_col_center,
496
+ width: width * (itemwidth / 100),
497
+ margin: height * 0.003,
498
+ };
499
+ }
500
+
501
+ export function getMediaViewChildContainer(width: number, itemwidth: number): ViewStyle {
502
+ return {
503
+ borderWidth: 0.5,
504
+ borderRadius: 2,
505
+ width: width * (itemwidth / 100),
506
+ borderColor: colors.color_componentBordercolor,
507
+ };
508
+ }
509
+
510
+ export function getMediaIcon(width: number, itemwidth: number): ImageStyle {
511
+ return {
512
+ height: 120,
513
+ width: width * (itemwidth / 100),
514
+ };
515
+ }
516
+
517
+ export function getMediaoverlayChildrenwrapperStyle(
518
+ width: number,
519
+ height: number,
520
+ itemheight: number
521
+ ): ViewStyle {
522
+ return {
523
+ width: width,
524
+ height: itemheight,
525
+ padding: height * 0.01,
526
+ };
527
+ }
528
+
529
+ export function getMediaoverlayTopLineContainer(width: number, height: number): ViewStyle {
530
+ return {
531
+ ...ComponentStyles.View_col_center,
532
+ width: width * 0.15,
533
+ height: height * 0.02,
534
+ };
535
+ }
536
+
537
+ export function getMediaoverlayOptionRow(width: number, height: number): ViewStyle {
538
+ return {
539
+ ...ComponentStyles.View_row_spacearound,
540
+ borderRadius: 14,
541
+ marginTop: height * 0.02,
542
+ width: width * 0.90,
543
+ };
544
+ }
545
+
546
+ export function getMediaoverlayOptionContainer(width: number, height: number): ViewStyle {
547
+ return {
548
+ ...ComponentStyles.View_col_center,
549
+ margin: 5,
550
+ height: height * 0.1,
551
+ width: width * 0.20,
552
+ };
553
+ }
554
+
555
+ export function getMediaoverlayMsgorLoaderView(height: number): ViewStyle {
556
+ return {
557
+ height: height,
558
+ ...ComponentStyles.View_col_center,
559
+ };
560
+ }
561
+
562
+ export function getMediaGalleryChildContainer(width: number, height: number): ViewStyle {
563
+ return {
564
+ marginTop: height * 0.01,
565
+ width: width * 0.90,
566
+ justifyContent: 'center',
567
+ alignItems: 'center',
568
+ };
569
+ }
570
+
571
+ export function getMediaGalleryDeleteView(width: number, height: number): ViewStyle {
572
+ return {
573
+ borderWidth: 0.5,
574
+ borderRadius: 2,
575
+ height: height / 5,
576
+ width: width * 0.90,
577
+ borderColor: colors.color_componentBordercolor,
578
+ alignItems: 'center',
579
+ justifyContent: 'center',
580
+ };
581
+ }
582
+
583
+ export function getMediaIconStyle(width: number, height: number): ImageStyle {
584
+ return {
585
+ height: height / 5,
586
+ width: width * 0.90,
587
+ };
588
+ }
589
+
590
+ export function getMediaGalleryDeleteIcon(width: number): ImageStyle {
591
+ return {
592
+ height: '40%',
593
+ width: width * 0.90,
594
+ resizeMode: 'contain',
595
+ };
596
+ }