move status bar to main screen only
This commit is contained in:
parent
7268a93b02
commit
5d00017ee6
5
App.tsx
5
App.tsx
@ -3,6 +3,7 @@ import { NavigationContainer } from "@react-navigation/native";
|
|||||||
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
||||||
import HomeScreen from "@/screens/Home";
|
import HomeScreen from "@/screens/Home";
|
||||||
import ProfileScreen from "@/screens/Profile";
|
import ProfileScreen from "@/screens/Profile";
|
||||||
|
import { StatusBar } from "expo-status-bar";
|
||||||
|
|
||||||
export type RootStackParamList = {
|
export type RootStackParamList = {
|
||||||
Home: undefined;
|
Home: undefined;
|
||||||
@ -14,10 +15,12 @@ const Stack = createNativeStackNavigator<RootStackParamList>();
|
|||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<NavigationContainer>
|
<NavigationContainer>
|
||||||
<Stack.Navigator screenOptions={{ headerLargeTitle: true }}>
|
<Stack.Navigator>
|
||||||
<Stack.Screen name="Home" component={HomeScreen} />
|
<Stack.Screen name="Home" component={HomeScreen} />
|
||||||
<Stack.Screen name="Profile" component={ProfileScreen} />
|
<Stack.Screen name="Profile" component={ProfileScreen} />
|
||||||
</Stack.Navigator>
|
</Stack.Navigator>
|
||||||
|
|
||||||
|
<StatusBar style="auto" />
|
||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import { useNavigation } from "@react-navigation/native";
|
import { useNavigation } from "@react-navigation/native";
|
||||||
import { type RootStackParamList } from "App";
|
|
||||||
import { StatusBar } from "expo-status-bar";
|
|
||||||
import { Button, StyleSheet, Text, View } from "react-native";
|
import { Button, StyleSheet, Text, View } from "react-native";
|
||||||
|
|
||||||
export default function HomeScreen() {
|
export default function HomeScreen() {
|
||||||
@ -11,7 +9,6 @@ export default function HomeScreen() {
|
|||||||
<Text>Open up App.tsx to start working on your app!</Text>
|
<Text>Open up App.tsx to start working on your app!</Text>
|
||||||
|
|
||||||
<Button title="profile" onPress={() => navigation.navigate("Profile")} />
|
<Button title="profile" onPress={() => navigation.navigate("Profile")} />
|
||||||
<StatusBar style="auto" />
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import { StatusBar } from "expo-status-bar";
|
|
||||||
import { StyleSheet, Text, View } from "react-native";
|
import { StyleSheet, Text, View } from "react-native";
|
||||||
|
|
||||||
export default function ProfileScreen() {
|
export default function ProfileScreen() {
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Text>This is a profile screen</Text>
|
<Text>This is a profile screen</Text>
|
||||||
<StatusBar style="auto" />
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user