mg-library 1.0.557 → 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/functions.js +28 -4
- package/package.json +1 -1
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;
|