mg-library 1.0.556 → 1.0.558
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.
- package/blocks.js +17 -17
- package/functions.js +28 -4
- package/package.json +1 -1
package/blocks.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { useCallback, useState, useEffect } from 'react';
|
2
2
|
import { useForm, Controller } from 'react-hook-form';
|
3
3
|
import { View, ActivityIndicator, Pressable, Image, FlatList, Keyboard, Dimensions } from 'react-native';
|
4
|
-
import {
|
4
|
+
import { Button, Popover, Card, Input } from '@ui-kitten/components';
|
5
5
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
6
6
|
import * as ImageManipulator from 'expo-image-manipulator';
|
7
7
|
import { Camera, CameraType, CameraView } from 'expo-camera';
|
@@ -401,8 +401,8 @@ export function MGCamera(props) {
|
|
401
401
|
);
|
402
402
|
const cardHeader = (
|
403
403
|
<View style={{ marginLeft: 15, marginTop: 10, marginBottom: 10 }}>
|
404
|
-
<
|
405
|
-
<
|
404
|
+
<MGText category='h6'>{mgFunctionsLib.i18nString('photo', props.language)}</MGText>
|
405
|
+
<MGText>{mgFunctionsLib.i18nString('takePhoto', props.language)}</MGText>
|
406
406
|
</View>
|
407
407
|
);
|
408
408
|
const cardFooter = (
|
@@ -418,7 +418,7 @@ export function MGCamera(props) {
|
|
418
418
|
facing === mgConstantsLib.CAMERA_FACING_BACK ? mgConstantsLib.CAMERA_FACING_FRONT : mgConstantsLib.CAMERA_FACING_BACK
|
419
419
|
)
|
420
420
|
}}>
|
421
|
-
<
|
421
|
+
<MGText>{mgFunctionsLib.i18nString('doInvertCamera', props.language)}</MGText>
|
422
422
|
</Button>
|
423
423
|
</View>
|
424
424
|
<View style={{ flex: 1, alignItems: 'center' }}>
|
@@ -427,7 +427,7 @@ export function MGCamera(props) {
|
|
427
427
|
status='primary'
|
428
428
|
accessoryLeft={TakeIcon}
|
429
429
|
onPress={__takePicture}>
|
430
|
-
<
|
430
|
+
<MGText>{mgFunctionsLib.i18nString('doTakePhoto', props.language)}</MGText>
|
431
431
|
</Button>
|
432
432
|
</View>
|
433
433
|
</View>
|
@@ -489,8 +489,8 @@ export function MGCameraPreview(props) {
|
|
489
489
|
);
|
490
490
|
const cardHeader = (
|
491
491
|
<View style={{ marginLeft: 15, marginTop: 10, marginBottom: 10 }}>
|
492
|
-
<
|
493
|
-
<
|
492
|
+
<MGText category='h6'>{mgFunctionsLib.i18nString('photo', props.language)}</MGText>
|
493
|
+
<MGText>{mgFunctionsLib.i18nString('previewPhoto', props.language)}</MGText>
|
494
494
|
</View>
|
495
495
|
);
|
496
496
|
const cardFooter = (
|
@@ -502,7 +502,7 @@ export function MGCameraPreview(props) {
|
|
502
502
|
status='primary'
|
503
503
|
accessoryLeft={SaveIcon}
|
504
504
|
onPress={__savePicture}>
|
505
|
-
<
|
505
|
+
<MGText>{mgFunctionsLib.i18nString('doSavePhoto', props.language)}</MGText>
|
506
506
|
</Button>
|
507
507
|
</View>
|
508
508
|
</View>
|
@@ -560,10 +560,10 @@ export function MGPopover(props) {
|
|
560
560
|
<>
|
561
561
|
<View style={{ flexGrow: 1, flexDirection: 'row', justifyContent: 'space-around', marginTop: 20, marginBottom: 20 }}>
|
562
562
|
<Button style={{ flexGrow: 0.3 }} onPress={() => { setVisible(false); props.callback() }}>
|
563
|
-
<
|
563
|
+
<MGText>{mgFunctionsLib.i18nString('yes', props.language)}</MGText>
|
564
564
|
</Button>
|
565
565
|
<Button style={{ flexGrow: 0.3 }} onPress={() => { setVisible(false) }}>
|
566
|
-
<
|
566
|
+
<MGText>{mgFunctionsLib.i18nString('no', props.language)}</MGText>
|
567
567
|
</Button>
|
568
568
|
</View>
|
569
569
|
</>
|
@@ -577,7 +577,7 @@ export function MGPopover(props) {
|
|
577
577
|
<Card footer={cardFooter}>
|
578
578
|
<View style={{ flexDirection: 'column', justifyContent: 'center', alignItems: 'center' }}>
|
579
579
|
<MaterialCommunityIcons name='alert-outline' color={props.theme['color-primary-500']} size={70} style={{ marginBottom: 10 }} />
|
580
|
-
<
|
580
|
+
<MGText>{mgFunctionsLib.i18nString('confirm', props.language)} ?</MGText>
|
581
581
|
</View>
|
582
582
|
</Card>
|
583
583
|
</Popover>
|
@@ -622,7 +622,7 @@ export function MGFlatListHeader(props) {
|
|
622
622
|
props.beforeTitle
|
623
623
|
}
|
624
624
|
<View style={{ marginHorizontal: 10, marginBottom: 20, paddingHorizontal: 10, paddingVertical: 10, borderColor: props.theme['color-primary-500'], borderRadius: 10, borderStyle: 'solid', borderWidth: 1 }}>
|
625
|
-
<
|
625
|
+
<MGText category='h6' style={{ marginLeft: 10 }}>{props.title}</MGText>
|
626
626
|
{props.subTitle != undefined &&
|
627
627
|
props.subTitle
|
628
628
|
}
|
@@ -640,15 +640,15 @@ export function MGSessionHeader(props) {
|
|
640
640
|
<View style={{ marginBottom: 10 }}>
|
641
641
|
<View style={{ display: 'flex', flexDirection: 'row', alignItems: 'stretch' }}>
|
642
642
|
<View style={{ flexGrow: 0.5, alignSelf: 'center' }}>
|
643
|
-
<
|
643
|
+
<MGText category='h5' style={{ color: props.theme['color-primary-500'], marginLeft: 5 }}>{props.module}</MGText>
|
644
644
|
</View>
|
645
645
|
<View style={{ flexGrow: 0.35, flexDirection: 'column', justifyContent: 'center' }}>
|
646
|
-
<
|
647
|
-
<
|
646
|
+
<MGText style={{ alignSelf: 'flex-end', marginBottom: -5 }} category='h6'>{props.person.lastName}</MGText>
|
647
|
+
<MGText style={{ alignSelf: 'flex-end' }}>{props.person.firstName}</MGText>
|
648
648
|
</View>
|
649
649
|
<View style={{ flexGrow: 0.15, flexDirection: 'column' }}>
|
650
650
|
<MaterialCommunityIcons name='account' size={40} style={{ alignSelf: 'center', color: props.theme['color-primary-700'] }} />
|
651
|
-
<
|
651
|
+
<MGText category='c1' style={{ alignSelf: 'center', marginTop: -5 }}>{props.person.profile}</MGText>
|
652
652
|
</View>
|
653
653
|
</View>
|
654
654
|
<MGDivider />
|
@@ -678,7 +678,7 @@ export function MGCardHeader(props) {
|
|
678
678
|
<>
|
679
679
|
<View style={{ flexDirection: 'row', marginVertical: 10, marginLeft: 10 }}>
|
680
680
|
<View style={{ flexGrow: 0.95 }}>
|
681
|
-
<
|
681
|
+
<MGText category='h6'>{props.title}</MGText>
|
682
682
|
</View>
|
683
683
|
</View>
|
684
684
|
</>
|
package/functions.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
import Toast from 'react-native-root-toast';
|
2
2
|
import { StyleSheet, View, Dimensions } from 'react-native';
|
3
3
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
4
|
-
import { Button } from '
|
5
|
-
import { Box } from 'native-base';
|
4
|
+
import { Box, Button } from 'native-base';
|
6
5
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
7
6
|
import moment from 'moment';
|
8
7
|
import 'moment/locale/es';
|
@@ -18,7 +17,7 @@ const logoutIcon = () => (
|
|
18
17
|
<MaterialCommunityIcons name='logout' color='white' size={20} style={{ flex: 1 }} />
|
19
18
|
);
|
20
19
|
|
21
|
-
export function navigatorHeader(insets, theme, onPressLogout, company) {
|
20
|
+
/* export function navigatorHeader(insets, theme, onPressLogout, company) {
|
22
21
|
let companyDescription = company.description;
|
23
22
|
if (companyDescription.length > 25)
|
24
23
|
companyDescription = companyDescription.substring(0, 25) + '...';
|
@@ -34,6 +33,31 @@ export function navigatorHeader(insets, theme, onPressLogout, company) {
|
|
34
33
|
</View>
|
35
34
|
</Box>
|
36
35
|
);
|
36
|
+
} */
|
37
|
+
|
38
|
+
export function navigatorHeader(insets, theme, onPressLogout, company) {
|
39
|
+
let companyDescription = company.description;
|
40
|
+
if (companyDescription.length > 25)
|
41
|
+
companyDescription = companyDescription.substring(0, 25) + '...';
|
42
|
+
return (
|
43
|
+
<Box style={[safeAreaViewForNavigatorHeaderStyleSheet(insets).safeAreaView, { backgroundColor: theme['color-primary-500'], flexDirection: 'column', justifyContent: 'flex-end' }]}>
|
44
|
+
<View style={{ flexDirection: 'row', flexGrow: 1 }}>
|
45
|
+
<View style={{ flexGrow: 0.9, marginLeft: 10, alignSelf: 'center' }}>
|
46
|
+
<MGText category='h5' style={{ color: 'white' }}>{companyDescription}</MGText>
|
47
|
+
</View>
|
48
|
+
<View style={{ flexGrow: 0.1, flexDirection: 'column' }}>
|
49
|
+
<Button
|
50
|
+
style={{ alignSelf: 'center' }}
|
51
|
+
leftIcon={
|
52
|
+
<Icon as={MaterialCommunityIcons} name="logout" size="sm" color="white" />
|
53
|
+
}
|
54
|
+
bg="transparent"
|
55
|
+
onPress={onPressLogout}
|
56
|
+
/>
|
57
|
+
</View>
|
58
|
+
</View>
|
59
|
+
</Box>
|
60
|
+
);
|
37
61
|
}
|
38
62
|
|
39
63
|
// Camera
|
@@ -255,7 +279,7 @@ function showToast(config) {
|
|
255
279
|
});
|
256
280
|
}
|
257
281
|
|
258
|
-
export function showToastWithError(error, subMessage) {
|
282
|
+
export function showToastWithError(error, subMessage) {
|
259
283
|
let message = '';
|
260
284
|
if (error.message != undefined)
|
261
285
|
message = error.message;
|