2022-07-10 12:04:13 +00:00
|
|
|
import {DrawerNavigationProp} from '@react-navigation/drawer';
|
2022-07-10 12:06:48 +00:00
|
|
|
import {useNavigation} from '@react-navigation/native';
|
2022-07-10 23:14:24 +00:00
|
|
|
import {createStackNavigator} from '@react-navigation/stack';
|
2022-07-10 12:04:13 +00:00
|
|
|
import React from 'react';
|
|
|
|
import {IconButton} from 'react-native-paper';
|
|
|
|
import {DrawerParamList} from './App';
|
2022-07-03 01:50:01 +00:00
|
|
|
import EditSet from './EditSet';
|
2022-07-04 04:03:48 +00:00
|
|
|
import Set from './set';
|
2022-07-10 23:26:45 +00:00
|
|
|
import SetList from './SetList';
|
2022-07-03 01:50:01 +00:00
|
|
|
|
2022-07-11 00:28:30 +00:00
|
|
|
const Stack = createStackNavigator<HomePageParams>();
|
|
|
|
export type HomePageParams = {
|
2022-07-10 12:04:13 +00:00
|
|
|
Sets: {};
|
|
|
|
EditSet: {
|
|
|
|
set: Set;
|
2022-08-24 03:36:49 +00:00
|
|
|
workouts?: string[];
|
2022-07-10 12:04:13 +00:00
|
|
|
};
|
|
|
|
};
|
2022-07-03 01:50:01 +00:00
|
|
|
|
2022-07-08 03:20:03 +00:00
|
|
|
export default function HomePage() {
|
2022-07-10 12:04:13 +00:00
|
|
|
const navigation = useNavigation<DrawerNavigationProp<DrawerParamList>>();
|
2022-07-10 05:40:11 +00:00
|
|
|
|
2022-07-03 01:50:01 +00:00
|
|
|
return (
|
2022-07-10 23:14:24 +00:00
|
|
|
<Stack.Navigator
|
|
|
|
screenOptions={{headerShown: false, animationEnabled: false}}>
|
2022-07-10 23:26:45 +00:00
|
|
|
<Stack.Screen name="Sets" component={SetList} />
|
2022-07-10 12:04:13 +00:00
|
|
|
<Stack.Screen
|
|
|
|
name="EditSet"
|
|
|
|
component={EditSet}
|
|
|
|
listeners={{
|
|
|
|
beforeRemove: () => {
|
|
|
|
navigation.setOptions({
|
|
|
|
headerLeft: () => (
|
|
|
|
<IconButton icon="menu" onPress={navigation.openDrawer} />
|
|
|
|
),
|
|
|
|
title: 'Home',
|
|
|
|
});
|
|
|
|
},
|
|
|
|
}}
|
2022-07-03 01:50:01 +00:00
|
|
|
/>
|
2022-07-10 12:04:13 +00:00
|
|
|
</Stack.Navigator>
|
2022-07-03 01:50:01 +00:00
|
|
|
);
|
|
|
|
}
|