Move debug banner to AppStack from AppDrawer
If we have it on the drawer instead of the stack it will dissapear when navigating to certain screens.
This commit is contained in:
parent
3c0f4ce8ad
commit
e3d3aad153
|
@ -10,7 +10,6 @@ import SetList from "./SetList";
|
|||
import SettingsPage from "./SettingsPage";
|
||||
import TimerPage from "./TimerPage";
|
||||
import WeightList from "./WeightList";
|
||||
import { StyleSheet, Text, View } from "react-native";
|
||||
|
||||
const Drawer = createDrawerNavigator<DrawerParams>();
|
||||
|
||||
|
@ -24,12 +23,6 @@ export default function AppDrawer({
|
|||
const { dark } = useTheme();
|
||||
|
||||
return (
|
||||
<>
|
||||
{__DEV__ && (
|
||||
<View style={styles.debugBanner}>
|
||||
<Text style={styles.debugText}>DEBUG</Text>
|
||||
</View>
|
||||
)}
|
||||
<Drawer.Navigator
|
||||
screenOptions={{
|
||||
headerTintColor: dark ? "white" : "black",
|
||||
|
@ -85,25 +78,5 @@ export default function AppDrawer({
|
|||
options={{ drawerIcon: () => <IconButton icon="cog-outline" /> }}
|
||||
/>
|
||||
</Drawer.Navigator>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
},
|
||||
debugBanner: {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
right: 0,
|
||||
transform: [{ rotate: '45deg' }],
|
||||
backgroundColor: 'red',
|
||||
zIndex: 1000,
|
||||
},
|
||||
debugText: {
|
||||
color: 'white',
|
||||
padding: 5,
|
||||
fontSize: 10,
|
||||
},
|
||||
});
|
||||
|
|
27
AppStack.tsx
27
AppStack.tsx
|
@ -13,6 +13,7 @@ import ViewGraph from "./ViewGraph";
|
|||
import ViewSetList from "./ViewSetList";
|
||||
import ViewWeightGraph from "./ViewWeightGraph";
|
||||
import Weight from "./weight";
|
||||
import { View, Text, StyleSheet } from "react-native";
|
||||
|
||||
export type StackParams = {
|
||||
Drawer: {};
|
||||
|
@ -51,6 +52,12 @@ const Stack = createStackNavigator<StackParams>();
|
|||
|
||||
export default function AppStack({ startup }: { startup: string }) {
|
||||
return (
|
||||
<>
|
||||
{__DEV__ && (
|
||||
<View style={styles.debugBanner}>
|
||||
<Text style={styles.debugText}>DEBUG</Text>
|
||||
</View>
|
||||
)}
|
||||
<Stack.Navigator
|
||||
screenOptions={{ headerShown: false, animationEnabled: false }}
|
||||
>
|
||||
|
@ -70,5 +77,25 @@ export default function AppStack({ startup }: { startup: string }) {
|
|||
<Stack.Screen name="EditExercises" component={EditExercises} />
|
||||
<Stack.Screen name="ViewSetList" component={ViewSetList} />
|
||||
</Stack.Navigator>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
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,
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue