-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathApp.tsx
97 lines (85 loc) · 2.22 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import 'react-native-gesture-handler';
import './shim.js';
import React from 'react';
import {StatusBar, StyleSheet, useColorScheme, View} from 'react-native';
import {Colors} from 'react-native/Libraries/NewAppScreen';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {NavigationContainer} from '@react-navigation/native';
import {navigationRef} from './NavigationService';
import Navigation from './Navigation';
import {ShopSettingsProvider} from './contexts/ShopSettingsContext';
import Toast, { SuccessToast, ErrorToast } from 'react-native-toast-message';
const currency = require('./helper/currency');
const toastConfig = {
/*
Overwrite 'success' type,
by modifying the existing `BaseToast` component
*/
success: props => (
<SuccessToast
{...props}
contentContainerStyle={{paddingHorizontal: 15}}
text2NumberOfLines={5}
text1Style={{
fontSize: 15,
fontWeight: '400',
}} />
),
/*
Overwrite 'error' type,
by modifying the existing `ErrorToast` component
*/
error: props => (
<ErrorToast
{...props}
text1Style={{
fontSize: 17,
}}
text2Style={{
fontSize: 15,
}}
text2NumberOfLines={5}
style={{
paddingVertical:20,
height:100,
borderLeftColor: 'red'
}}
/>
),
};
function App(): JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
const backgroundStyle = {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
};
return (
<>
<ShopSettingsProvider>
<SafeAreaProvider>
<View style={styles.root}>
<StatusBar
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
backgroundColor={backgroundStyle.backgroundColor}
/>
<NavigationContainer ref={navigationRef}>
<Navigation />
</NavigationContainer>
</View>
</SafeAreaProvider>
</ShopSettingsProvider>
<Toast config={toastConfig} />
</>
);
}
const styles = StyleSheet.create({
root: {
flex: 1,
},
});
export default App;