mg-library 1.0.382 → 1.0.383
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 +8 -8
- package/package.json +1 -1
package/functions.js
CHANGED
@@ -1,6 +1,6 @@
|
|
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
4
|
import { Text } from '@ui-kitten/components';
|
5
5
|
import moment from 'moment';
|
6
6
|
import 'moment/locale/es';
|
@@ -52,21 +52,21 @@ export function getCardHeader(text) {
|
|
52
52
|
// Local Storage
|
53
53
|
|
54
54
|
export const writeToLocalStorage = async (key, value) => {
|
55
|
-
|
55
|
+
try {
|
56
56
|
await AsyncStorage.setItem(key, value);
|
57
57
|
} catch (error) {
|
58
58
|
console.error(error);
|
59
|
-
}
|
59
|
+
}
|
60
60
|
}
|
61
61
|
|
62
62
|
export async function readFromLocalStorage(key) {
|
63
|
-
|
63
|
+
try {
|
64
64
|
const value = await AsyncStorage.getItem(key);
|
65
65
|
if (value !== null)
|
66
66
|
return value;
|
67
67
|
} catch (error) {
|
68
68
|
console.error(error);
|
69
|
-
}
|
69
|
+
}
|
70
70
|
}
|
71
71
|
|
72
72
|
// Strings
|
@@ -202,7 +202,7 @@ export function getBasicStyleSheet() {
|
|
202
202
|
// Toast
|
203
203
|
|
204
204
|
function showToast(config) {
|
205
|
-
|
205
|
+
Toast.show(config.message, {
|
206
206
|
duration: Toast.durations.LONG,
|
207
207
|
position: Toast.positions.CENTER,
|
208
208
|
shadow: true,
|
@@ -211,7 +211,7 @@ function showToast(config) {
|
|
211
211
|
backgroundColor: config.backgroundColor,
|
212
212
|
textColor: 'white',
|
213
213
|
delay: 0
|
214
|
-
});
|
214
|
+
});
|
215
215
|
}
|
216
216
|
|
217
217
|
export function showToastError(message) {
|