-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
42 lines (37 loc) · 1.29 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
import { StyleSheet, Text, View } from 'react-native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import AppNavigator from './src/navigation/AppNavigator';
import { ToastProvider } from 'react-native-toast-notifications';
import colors from './colors';
import { AuthProvider } from './src/context/AuthContext';
const Tab = createBottomTabNavigator();
export default function App() {
return (
<AuthProvider>
<ToastProvider renderType={{
custom_type: (toast) => (
<View style={[toasterStyles.style, toast.style]}>
{toast.data?.title && <Text style={{ fontWeight: 'bold', color: toast.data?.color ?? colors.primary }}>{toast.data.title}</Text>}
<Text style={{ color: toast.data?.color ?? colors.primary, fontWeight: toast.data?.title ? "normal" : "bold" }}>{toast.message}</Text>
</View>
)
}}>
<AppNavigator />
</ToastProvider >
</AuthProvider>
);
}
const toasterStyles = StyleSheet.create({
style: {
borderRadius: 5,
borderLeftWidth: 12,
borderRightWidth: 12,
borderTopWidth: 1,
borderBottomWidth: 1,
padding: 10,
marginVertical: 5,
borderColor: colors.secondary,
backgroundColor: colors.background,
width: "80%",
}
});