added games screen

games screen added to bottom navbar. Now user can go to games screen and select private or public game type
This commit is contained in:
suddenlyoranges committed 2026-04-08 21:03:03 +01:00
1 parent 93fb30a7bb
commit 4d5eac38b7
5 files changed
+463 -162

No files matched your search

+26 -9
View File
@@ -1,7 +1,7 @@
import {StatusBar} from "expo-status-bar";
import {StyleSheet, View} from "react-native";
import {useNavigation, useRoute} from "@react-navigation/native";
import {useSafeAreaInsets} from "react-native-safe-area-context";
import { StatusBar } from "expo-status-bar";
import { StyleSheet, View } from "react-native";
import { useNavigation, useRoute } from "@react-navigation/native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import TopNavbar from "./TopNavbar";
import BottomNavbar from "./BottomNavbar";
@@ -17,6 +17,7 @@ const Screen = ({ children, style, showBack = false }) => {
TeamScreen: "Current Team",
MapScreen: "Map",
GameSettingsScreen: "Game Settings",
GameSelectionScreen: "Games",
PlayersScreen: "Players",
ExpandedMapScreen: "Map View",
};
@@ -24,17 +25,34 @@ const Screen = ({ children, style, showBack = false }) => {
// State ----------------------
const routeName = route.name;
const isAuthScreen = routeName === "LoginScreen" || routeName === "RegisterScreen";
const isAuthScreen =
routeName === "LoginScreen" || routeName === "RegisterScreen";
const pageTitle = titleMap[routeName] || "Treasure Hunt";
// Handlers -------------------
// View -----------------------
return (
<View style={[styles.screen, isAuthScreen && {paddingTop: insets.top, paddingBottom: insets.bottom}]}>
{!isAuthScreen && <TopNavbar title={pageTitle} showBack={showBack} navigation={navigation} />}
<View
style={[
styles.screen,
isAuthScreen && {
paddingTop: insets.top,
paddingBottom: insets.bottom,
},
]}
>
{!isAuthScreen && (
<TopNavbar
title={pageTitle}
showBack={showBack}
navigation={navigation}
/>
)}
<View style={[styles.content, style]}>{children}</View>
{!isAuthScreen && <BottomNavbar navigation={navigation} routeName={routeName} />}
{!isAuthScreen && (
<BottomNavbar navigation={navigation} routeName={routeName} />
)}
<StatusBar style="light" />
</View>
);
@@ -52,4 +70,3 @@ const styles = StyleSheet.create({
});
export default Screen;