2023-10-28 02:59:03 +00:00
|
|
|
import { createStackNavigator } from "@react-navigation/stack";
|
|
|
|
import AppDrawer from "./AppDrawer";
|
2023-11-12 04:05:37 +00:00
|
|
|
import EditExercise from "./EditExercise";
|
|
|
|
import EditExercises from "./EditExercises";
|
2023-10-28 02:59:03 +00:00
|
|
|
import EditPlan from "./EditPlan";
|
|
|
|
import EditSet from "./EditSet";
|
|
|
|
import EditSets from "./EditSets";
|
|
|
|
import EditWeight from "./EditWeight";
|
2023-11-14 22:21:49 +00:00
|
|
|
import GymSet from "./gym-set";
|
|
|
|
import { Plan } from "./plan";
|
2023-10-28 02:59:03 +00:00
|
|
|
import StartPlan from "./StartPlan";
|
|
|
|
import ViewGraph from "./ViewGraph";
|
2023-11-12 04:05:37 +00:00
|
|
|
import ViewSetList from "./ViewSetList";
|
2023-10-28 02:59:03 +00:00
|
|
|
import ViewWeightGraph from "./ViewWeightGraph";
|
|
|
|
import Weight from "./weight";
|
2024-02-15 02:26:14 +00:00
|
|
|
import { View, Text, StyleSheet } from "react-native";
|
2023-10-28 02:59:03 +00:00
|
|
|
|
|
|
|
export type StackParams = {
|
|
|
|
Drawer: {};
|
|
|
|
EditSet: {
|
2023-11-13 05:13:23 +00:00
|
|
|
set: Partial<GymSet>;
|
2023-10-28 02:59:03 +00:00
|
|
|
};
|
|
|
|
EditSets: {
|
|
|
|
ids: number[];
|
|
|
|
};
|
|
|
|
EditPlan: {
|
2023-11-13 05:13:23 +00:00
|
|
|
plan: Partial<Plan>;
|
2023-10-28 02:59:03 +00:00
|
|
|
};
|
|
|
|
StartPlan: {
|
|
|
|
plan: Plan;
|
2023-11-13 05:13:23 +00:00
|
|
|
first: Partial<GymSet>;
|
2023-10-28 02:59:03 +00:00
|
|
|
};
|
|
|
|
ViewGraph: {
|
|
|
|
name: string;
|
|
|
|
};
|
|
|
|
EditWeight: {
|
2023-11-13 05:13:23 +00:00
|
|
|
weight: Partial<Weight>;
|
2023-10-28 02:59:03 +00:00
|
|
|
};
|
|
|
|
ViewWeightGraph: {};
|
2023-11-09 05:52:50 +00:00
|
|
|
EditExercise: {
|
2023-11-13 05:13:23 +00:00
|
|
|
gymSet: Partial<GymSet>;
|
2023-10-28 02:59:03 +00:00
|
|
|
};
|
2023-11-09 05:52:50 +00:00
|
|
|
EditExercises: {
|
2023-10-28 02:59:03 +00:00
|
|
|
names: string[];
|
|
|
|
};
|
2023-10-28 03:10:52 +00:00
|
|
|
ViewSetList: {
|
|
|
|
name: string;
|
|
|
|
};
|
2023-10-28 02:59:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const Stack = createStackNavigator<StackParams>();
|
|
|
|
|
2023-11-13 04:33:32 +00:00
|
|
|
export default function AppStack({ startup }: { startup: string }) {
|
2023-10-28 02:59:03 +00:00
|
|
|
return (
|
2024-02-15 02:26:14 +00:00
|
|
|
<>
|
|
|
|
{__DEV__ && (
|
|
|
|
<View style={styles.debugBanner}>
|
|
|
|
<Text style={styles.debugText}>DEBUG</Text>
|
|
|
|
</View>
|
|
|
|
)}
|
|
|
|
<Stack.Navigator
|
|
|
|
screenOptions={{ headerShown: false, animationEnabled: false }}
|
|
|
|
>
|
|
|
|
<Stack.Screen
|
|
|
|
name="Drawer"
|
|
|
|
component={AppDrawer}
|
|
|
|
initialParams={{ startup }}
|
|
|
|
/>
|
|
|
|
<Stack.Screen name="EditSet" component={EditSet} />
|
|
|
|
<Stack.Screen name="EditSets" component={EditSets} />
|
|
|
|
<Stack.Screen name="EditPlan" component={EditPlan} />
|
|
|
|
<Stack.Screen name="StartPlan" component={StartPlan} />
|
|
|
|
<Stack.Screen name="ViewGraph" component={ViewGraph} />
|
|
|
|
<Stack.Screen name="EditWeight" component={EditWeight} />
|
|
|
|
<Stack.Screen name="ViewWeightGraph" component={ViewWeightGraph} />
|
|
|
|
<Stack.Screen name="EditExercise" component={EditExercise} />
|
|
|
|
<Stack.Screen name="EditExercises" component={EditExercises} />
|
|
|
|
<Stack.Screen name="ViewSetList" component={ViewSetList} />
|
|
|
|
</Stack.Navigator>
|
|
|
|
</>
|
2023-10-28 02:59:03 +00:00
|
|
|
);
|
|
|
|
}
|
2024-02-15 02:26:14 +00:00
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
debugBanner: {
|
|
|
|
position: 'absolute',
|
|
|
|
top: 20,
|
|
|
|
right: 50,
|
|
|
|
backgroundColor: 'red',
|
|
|
|
zIndex: 1000,
|
|
|
|
borderRadius: 5,
|
|
|
|
},
|
|
|
|
debugText: {
|
|
|
|
color: 'white',
|
|
|
|
padding: 5,
|
|
|
|
fontSize: 10,
|
|
|
|
},
|
|
|
|
});
|