mg-library 1.0.484 → 1.0.486

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 (2) hide show
  1. package/functions.js +26 -1
  2. package/package.json +1 -1
package/functions.js CHANGED
@@ -1,7 +1,8 @@
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 { Text } from '@ui-kitten/components';
4
+ import { Text, Button, Layout } from '@ui-kitten/components';
5
+ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
5
6
  import moment from 'moment';
6
7
  import 'moment/locale/es';
7
8
  import 'moment/locale/en-gb';
@@ -9,6 +10,30 @@ import { Camera } from 'expo-camera';
9
10
 
10
11
  import * as mgConstants from './constants.js';
11
12
 
13
+ // Navigator
14
+
15
+ const logoutIcon = () => (
16
+ <MaterialCommunityIcons name='logout' color='white' size={20} style={{ flex: 1 }} />
17
+ );
18
+
19
+ export function navigatorHeader(insets, theme, onPressLogout, company) {
20
+ let companyDescription = company.description;
21
+ if (companyDescription.length > 25)
22
+ companyDescription = companyDescription.substring(0, 25) + '...';
23
+ return (
24
+ <Layout style={[safeAreaViewForNavigatorHeaderStyleSheet(insets).safeAreaView, { backgroundColor: theme['color-primary-500'], flexDirection:'column', justifyContent: 'flex-end' }]}>
25
+ <View style={{ flexDirection: 'row', flexGrow: 1 }}>
26
+ <View style={{ flexGrow: 0.9, marginLeft: 10, alignSelf: 'center' }}>
27
+ <Text category='h5' style={{ color: 'white' }}>{companyDescription}</Text>
28
+ </View>
29
+ <View style={{ flexGrow: 0.1, flexDirection: 'column' }}>
30
+ <Button style={{ alignSelf: 'center' }} accessoryLeft={logoutIcon} onPress={() => { onPressLogout() }} />
31
+ </View>
32
+ </View>
33
+ </Layout>
34
+ );
35
+ }
36
+
12
37
  // Camera
13
38
 
14
39
  export async function isCameraAvailable() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mg-library",
3
- "version": "1.0.484",
3
+ "version": "1.0.486",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {