Compare commits
No commits in common. "7268a93b0290e35face6adda5d3507d21c2a62bc" and "2cac03a68182b369449b0a6fe012883d12ebd052" have entirely different histories.
7268a93b02
...
2cac03a681
41
App.tsx
41
App.tsx
@ -1,31 +1,20 @@
|
|||||||
import * as React from "react";
|
import { StatusBar } from 'expo-status-bar';
|
||||||
import { NavigationContainer } from "@react-navigation/native";
|
import { StyleSheet, Text, View } from 'react-native';
|
||||||
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
|
||||||
import HomeScreen from "@/screens/Home";
|
|
||||||
import ProfileScreen from "@/screens/Profile";
|
|
||||||
|
|
||||||
export type RootStackParamList = {
|
export default function App() {
|
||||||
Home: undefined;
|
|
||||||
Profile: undefined;
|
|
||||||
};
|
|
||||||
|
|
||||||
const Stack = createNativeStackNavigator<RootStackParamList>();
|
|
||||||
|
|
||||||
function App() {
|
|
||||||
return (
|
return (
|
||||||
<NavigationContainer>
|
<View style={styles.container}>
|
||||||
<Stack.Navigator screenOptions={{ headerLargeTitle: true }}>
|
<Text>Open up App.tsx to start working on your app!</Text>
|
||||||
<Stack.Screen name="Home" component={HomeScreen} />
|
<StatusBar style="auto" />
|
||||||
<Stack.Screen name="Profile" component={ProfileScreen} />
|
</View>
|
||||||
</Stack.Navigator>
|
|
||||||
</NavigationContainer>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
const styles = StyleSheet.create({
|
||||||
namespace ReactNavigation {
|
container: {
|
||||||
interface RootParamList extends RootStackParamList {}
|
flex: 1,
|
||||||
}
|
backgroundColor: '#fff',
|
||||||
}
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
export default App;
|
},
|
||||||
|
});
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
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";
|
|
||||||
|
|
||||||
export default function HomeScreen() {
|
|
||||||
const navigation = useNavigation();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<View style={styles.container}>
|
|
||||||
<Text>Open up App.tsx to start working on your app!</Text>
|
|
||||||
|
|
||||||
<Button title="profile" onPress={() => navigation.navigate("Profile")} />
|
|
||||||
<StatusBar style="auto" />
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
backgroundColor: "#fff",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
},
|
|
||||||
});
|
|
@ -1,20 +0,0 @@
|
|||||||
import { StatusBar } from "expo-status-bar";
|
|
||||||
import { StyleSheet, Text, View } from "react-native";
|
|
||||||
|
|
||||||
export default function ProfileScreen() {
|
|
||||||
return (
|
|
||||||
<View style={styles.container}>
|
|
||||||
<Text>This is a profile screen</Text>
|
|
||||||
<StatusBar style="auto" />
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
backgroundColor: "#fff",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
},
|
|
||||||
});
|
|
@ -1,10 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "expo/tsconfig.base",
|
"extends": "expo/tsconfig.base",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"strict": true,
|
"strict": true
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"@/*": ["src/*"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user