2023-08-12 03:22:50 +00:00
|
|
|
import { createDrawerNavigator } from "@react-navigation/drawer";
|
2023-11-13 04:33:32 +00:00
|
|
|
import { StackScreenProps } from "@react-navigation/stack";
|
2023-11-14 01:47:08 +00:00
|
|
|
import { IconButton, useTheme } from "react-native-paper";
|
2023-11-14 22:21:49 +00:00
|
|
|
import { DrawerParams } from "./drawer-params";
|
2023-11-12 04:05:37 +00:00
|
|
|
import ExerciseList from "./ExerciseList";
|
2023-10-28 02:59:03 +00:00
|
|
|
import GraphsList from "./GraphsList";
|
|
|
|
import InsightsPage from "./InsightsPage";
|
|
|
|
import PlanList from "./PlanList";
|
|
|
|
import SetList from "./SetList";
|
2023-08-12 03:22:50 +00:00
|
|
|
import SettingsPage from "./SettingsPage";
|
|
|
|
import TimerPage from "./TimerPage";
|
2023-11-12 04:05:37 +00:00
|
|
|
import WeightList from "./WeightList";
|
2022-07-15 04:34:06 +00:00
|
|
|
|
2023-10-28 02:59:03 +00:00
|
|
|
const Drawer = createDrawerNavigator<DrawerParams>();
|
2022-09-25 04:49:26 +00:00
|
|
|
|
2023-11-12 10:27:28 +00:00
|
|
|
interface AppDrawerParams {
|
2023-11-13 04:33:32 +00:00
|
|
|
startup: string;
|
2023-11-12 10:27:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default function AppDrawer({
|
|
|
|
route,
|
2023-11-13 04:33:32 +00:00
|
|
|
}: StackScreenProps<{ startup: AppDrawerParams }>) {
|
2023-11-14 01:47:08 +00:00
|
|
|
const { dark } = useTheme();
|
2022-07-15 04:34:06 +00:00
|
|
|
|
|
|
|
return (
|
2023-11-15 01:30:05 +00:00
|
|
|
<Drawer.Navigator
|
|
|
|
screenOptions={{
|
|
|
|
headerTintColor: dark ? "white" : "black",
|
|
|
|
swipeEdgeWidth: 1000,
|
|
|
|
headerShown: false,
|
|
|
|
}}
|
|
|
|
initialRouteName={
|
|
|
|
(route.params.startup as keyof DrawerParams) || "History"
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<Drawer.Screen
|
|
|
|
name="History"
|
|
|
|
component={SetList}
|
|
|
|
options={{ drawerIcon: () => <IconButton icon="history" /> }}
|
|
|
|
/>
|
|
|
|
<Drawer.Screen
|
|
|
|
name="Exercises"
|
|
|
|
component={ExerciseList}
|
|
|
|
options={{ drawerIcon: () => <IconButton icon="dumbbell" /> }}
|
|
|
|
/>
|
|
|
|
<Drawer.Screen
|
|
|
|
name="Plans"
|
|
|
|
component={PlanList}
|
|
|
|
options={{ drawerIcon: () => <IconButton icon="calendar-outline" /> }}
|
|
|
|
/>
|
|
|
|
<Drawer.Screen
|
|
|
|
name="Graphs"
|
|
|
|
component={GraphsList}
|
|
|
|
options={{
|
|
|
|
drawerIcon: () => <IconButton icon="chart-bell-curve-cumulative" />,
|
2023-10-20 22:57:31 +00:00
|
|
|
}}
|
2023-11-15 01:30:05 +00:00
|
|
|
/>
|
|
|
|
<Drawer.Screen
|
|
|
|
name="Timer"
|
|
|
|
component={TimerPage}
|
|
|
|
options={{ drawerIcon: () => <IconButton icon="timer-outline" /> }}
|
|
|
|
/>
|
|
|
|
<Drawer.Screen
|
|
|
|
name="Weight"
|
|
|
|
component={WeightList}
|
|
|
|
options={{ drawerIcon: () => <IconButton icon="scale-bathroom" /> }}
|
|
|
|
/>
|
|
|
|
<Drawer.Screen
|
|
|
|
name="Insights"
|
|
|
|
component={InsightsPage}
|
|
|
|
options={{
|
|
|
|
drawerIcon: () => <IconButton icon="lightbulb-on-outline" />,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Drawer.Screen
|
|
|
|
name="Settings"
|
|
|
|
component={SettingsPage}
|
|
|
|
options={{ drawerIcon: () => <IconButton icon="cog-outline" /> }}
|
|
|
|
/>
|
|
|
|
</Drawer.Navigator>
|
2023-08-12 03:22:50 +00:00
|
|
|
);
|
2022-07-15 04:34:06 +00:00
|
|
|
}
|