frostbyte-native/App.tsx

51 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-12-14 20:21:57 +01:00
import { StatusBar } from "expo-status-bar";
2023-12-14 23:51:05 +01:00
import { View } from "react-native";
2023-12-14 20:21:57 +01:00
import { style } from "./src/util/style";
2023-12-14 20:21:57 +01:00
import { PostsContainer } from "./src/components/PostsContainer";
2023-12-14 23:51:05 +01:00
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
2023-12-15 01:31:02 +01:00
import { NewPostContainer } from "./src/components/NewPostContainer";
2023-12-14 23:51:05 +01:00
const Stack = createNativeStackNavigator();
2023-12-14 20:09:12 +01:00
export default function App(): JSX.Element {
2023-12-14 23:51:05 +01:00
return (
2023-12-15 01:31:02 +01:00
<>
<StatusBar style="light" />
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={HomeScreen}
options={homeOptions}
/>
<Stack.Screen name="New" component={PostScreen} />
</Stack.Navigator>
</NavigationContainer>
</>
2023-12-14 23:51:05 +01:00
);
}
2023-12-15 01:31:02 +01:00
const homeOptions = {
headerStyle: style.header,
headerTitleStyle: style.headerTitle,
headerTintColor: "#fff",
};
2023-12-14 23:51:05 +01:00
function HomeScreen(): JSX.Element {
return (
2023-12-14 20:21:57 +01:00
<View style={style.app}>
<PostsContainer />
</View>
);
}
2023-12-15 01:31:02 +01:00
function PostScreen(): JSX.Element {
return (
<View style={style.app}>
<NewPostContainer />
</View>
);
}