2022-07-10 12:04:13 +00:00
|
|
|
import {createDrawerNavigator} from '@react-navigation/drawer';
|
2022-06-30 06:50:52 +00:00
|
|
|
import {
|
2022-07-15 06:06:33 +00:00
|
|
|
DarkTheme as NavigationDarkTheme,
|
|
|
|
DefaultTheme as NavigationDefaultTheme,
|
2022-07-03 01:50:01 +00:00
|
|
|
NavigationContainer,
|
|
|
|
} from '@react-navigation/native';
|
2022-09-11 03:35:20 +00:00
|
|
|
import React from 'react';
|
2022-08-27 01:40:16 +00:00
|
|
|
import {useColorScheme} from 'react-native';
|
2022-07-06 09:03:56 +00:00
|
|
|
import {
|
2022-07-15 06:06:33 +00:00
|
|
|
DarkTheme as PaperDarkTheme,
|
|
|
|
DefaultTheme as PaperDefaultTheme,
|
2022-07-06 09:03:56 +00:00
|
|
|
Provider,
|
|
|
|
} from 'react-native-paper';
|
2022-07-07 02:18:38 +00:00
|
|
|
import Ionicon from 'react-native-vector-icons/Ionicons';
|
2022-09-11 03:35:20 +00:00
|
|
|
import MassiveSnack from './MassiveSnack';
|
2022-07-15 04:34:06 +00:00
|
|
|
import Routes from './Routes';
|
2022-07-03 01:50:01 +00:00
|
|
|
|
2022-07-15 04:34:06 +00:00
|
|
|
export const Drawer = createDrawerNavigator<DrawerParamList>();
|
2022-07-10 12:04:13 +00:00
|
|
|
export type DrawerParamList = {
|
2022-07-03 01:50:01 +00:00
|
|
|
Home: {};
|
|
|
|
Settings: {};
|
2022-07-08 03:20:03 +00:00
|
|
|
Best: {};
|
2022-07-11 00:28:30 +00:00
|
|
|
Plans: {};
|
2022-08-26 03:10:28 +00:00
|
|
|
Workouts: {};
|
2022-08-30 11:21:25 +00:00
|
|
|
Loading: {};
|
2022-07-03 01:50:01 +00:00
|
|
|
};
|
|
|
|
|
2022-08-26 01:54:51 +00:00
|
|
|
export const CombinedDefaultTheme = {
|
2022-07-15 06:06:33 +00:00
|
|
|
...PaperDefaultTheme,
|
|
|
|
...NavigationDefaultTheme,
|
|
|
|
colors: {
|
|
|
|
...PaperDefaultTheme.colors,
|
|
|
|
...NavigationDefaultTheme.colors,
|
|
|
|
},
|
|
|
|
};
|
2022-08-26 01:54:51 +00:00
|
|
|
export const CombinedDarkTheme = {
|
2022-07-15 06:06:33 +00:00
|
|
|
...PaperDarkTheme,
|
|
|
|
...NavigationDarkTheme,
|
|
|
|
colors: {
|
|
|
|
...PaperDarkTheme.colors,
|
|
|
|
...NavigationDarkTheme.colors,
|
2022-08-26 01:54:51 +00:00
|
|
|
primary: '#B3E5fC',
|
2022-08-27 04:15:24 +00:00
|
|
|
background: '#0e0e0e',
|
2022-07-15 06:06:33 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2022-07-01 01:42:42 +00:00
|
|
|
const App = () => {
|
|
|
|
const dark = useColorScheme() === 'dark';
|
2022-07-06 09:03:56 +00:00
|
|
|
|
2022-06-30 06:50:52 +00:00
|
|
|
return (
|
2022-07-06 09:03:56 +00:00
|
|
|
<Provider
|
2022-07-15 06:06:33 +00:00
|
|
|
theme={dark ? CombinedDarkTheme : CombinedDefaultTheme}
|
2022-07-06 09:03:56 +00:00
|
|
|
settings={{icon: props => <Ionicon {...props} />}}>
|
2022-07-15 06:06:33 +00:00
|
|
|
<NavigationContainer
|
|
|
|
theme={dark ? CombinedDarkTheme : CombinedDefaultTheme}>
|
2022-09-11 03:35:20 +00:00
|
|
|
<MassiveSnack>
|
2022-08-30 11:21:25 +00:00
|
|
|
<Routes />
|
2022-09-11 03:35:20 +00:00
|
|
|
</MassiveSnack>
|
2022-07-06 09:03:56 +00:00
|
|
|
</NavigationContainer>
|
|
|
|
</Provider>
|
2022-06-30 06:50:52 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default App;
|