Compare commits

..

No commits in common. "7268a93b0290e35face6adda5d3507d21c2a62bc" and "2cac03a68182b369449b0a6fe012883d12ebd052" have entirely different histories.

4 changed files with 16 additions and 77 deletions

41
App.tsx
View File

@ -1,31 +1,20 @@
import * as React from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import HomeScreen from "@/screens/Home";
import ProfileScreen from "@/screens/Profile";
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
export type RootStackParamList = {
Home: undefined;
Profile: undefined;
};
const Stack = createNativeStackNavigator<RootStackParamList>();
function App() {
export default function App() {
return (
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerLargeTitle: true }}>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="Profile" component={ProfileScreen} />
</Stack.Navigator>
</NavigationContainer>
<View style={styles.container}>
<Text>Open up App.tsx to start working on your app!</Text>
<StatusBar style="auto" />
</View>
);
}
declare global {
namespace ReactNavigation {
interface RootParamList extends RootStackParamList {}
}
}
export default App;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});

View File

@ -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",
},
});

View File

@ -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",
},
});

View File

@ -1,10 +1,6 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
"strict": true
}
}