frostbyte-native/App.tsx

49 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-12-14 20:21:57 +01:00
import { StatusBar } from "expo-status-bar";
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-15 03:07:15 +01:00
import { NativeStackNavigationProp } from "@react-navigation/native-stack";
type RootStackParamList = {
Home: undefined;
New: undefined;
};
export type HomeScreenNavigationProp = NativeStackNavigationProp<
RootStackParamList,
"Home"
>;
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"
2023-12-15 02:08:29 +01:00
component={PostsContainer}
options={options}
/>
<Stack.Screen
name="New"
options={options}
component={NewPostContainer}
2023-12-15 01:31:02 +01:00
/>
</Stack.Navigator>
</NavigationContainer>
</>
2023-12-14 23:51:05 +01:00
);
}
2023-12-15 02:08:29 +01:00
const options = {
2023-12-15 01:31:02 +01:00
headerStyle: style.header,
headerTitleStyle: style.headerTitle,
headerTintColor: "#fff",
};