Refactor navigation routes to include prefix and add new page components for admin hub, game lobby, game type, join private game, manage private subtask, manage subgroups, and team

This commit is contained in:
bobbert committed 2026-03-17 22:22:15 +00:00
1 parent 884f9e818b
commit 33f73105ad
32 files changed
+88 -77

No files matched your search

+3 -3
View File
@@ -15,7 +15,7 @@ const AdminHubPage = () => {
gameType: 'private',
isBusiness: true,
});
navigation.navigate('game-lobby');
navigation.navigate('(routes)/game-lobby');
};
return (
@@ -25,10 +25,10 @@ const AdminHubPage = () => {
<Pressable style={styles.button} onPress={handleCreateGame}>
<Text style={styles.buttonText}>Create a Game</Text>
</Pressable>
<Pressable style={styles.button} onPress={() => navigation.navigate('game-lobby')}>
<Pressable style={styles.button} onPress={() => navigation.navigate('(routes)/game-lobby')}>
<Text style={styles.buttonText}>Manage Existing Game</Text>
</Pressable>
<Pressable style={styles.button} onPress={() => navigation.navigate('manage-subgroups')}>
<Pressable style={styles.button} onPress={() => navigation.navigate('(routes)/manage-subgroups')}>
<Text style={styles.buttonText}>Manage Subgroups</Text>
</Pressable>
</View>
+3 -3
View File
@@ -17,7 +17,7 @@ const GameLobbyPage = () => {
return;
}
setHasTeam(true);
navigation.navigate('team');
navigation.navigate('(routes)/team');
};
const handleJoinTeam = async () => {
@@ -26,7 +26,7 @@ const GameLobbyPage = () => {
return;
}
setHasTeam(true);
navigation.navigate('team');
navigation.navigate('(routes)/team');
};
return (
@@ -47,7 +47,7 @@ const GameLobbyPage = () => {
<Pressable style={styles.primaryButton} onPress={handleCreateTeam}>
<Text style={styles.buttonText}>Create Team</Text>
</Pressable>
<Pressable style={styles.secondaryButton} onPress={() => navigation.navigate('map')}>
<Pressable style={styles.secondaryButton} onPress={() => navigation.navigate('(routes)/map')}>
<Text style={styles.buttonText}>Open Map</Text>
</Pressable>
{!!error && <Text style={styles.errorText}>{error}</Text>}
+3 -3
View File
@@ -9,14 +9,14 @@ const GameTypePage = () => {
const navigateByType = (label) => {
if (label === 'Join Global Game') {
navigation.navigate('game-lobby');
navigation.navigate('(routes)/game-lobby');
return;
}
if (label === 'Join Private Game') {
navigation.navigate('join-private-game');
navigation.navigate('(routes)/join-private-game');
return;
}
navigation.navigate('manage-private-subtask');
navigation.navigate('(routes)/manage-private-subtask');
};
return (
+1 -1
View File
@@ -15,7 +15,7 @@ const JoinPrivateGamePage = () => {
if (!group) {
return;
}
navigation.navigate('game-lobby');
navigation.navigate('(routes)/game-lobby');
};
return (
+3 -3
View File
@@ -23,10 +23,10 @@ const LoginPage = () => {
return;
}
if (user.SGid === 0) {
navigation.navigate('admin-hub');
navigation.navigate('(routes)/admin-hub');
return;
}
navigation.navigate('game-type');
navigation.navigate('(routes)/game-type');
};
return (
@@ -48,7 +48,7 @@ const LoginPage = () => {
onChangeText={setPassword}
/>
<View style={styles.row}>
<Pressable style={styles.leftButton} onPress={() => navigation.navigate('register')}>
<Pressable style={styles.leftButton} onPress={() => navigation.navigate('(routes)/register')}>
<Text style={styles.buttonText}>Register</Text>
</Pressable>
<Pressable style={styles.rightButton} onPress={handleLogin}>
+2 -2
View File
@@ -21,7 +21,7 @@ const ManagePrivateSubtaskPage = () => {
if (!group) {
return;
}
navigation.navigate('admin-hub');
navigation.navigate('(routes)/admin-hub');
};
const handleJoinAdmin = async () => {
@@ -31,7 +31,7 @@ const ManagePrivateSubtaskPage = () => {
if (!response) {
return;
}
navigation.navigate('admin-hub');
navigation.navigate('(routes)/admin-hub');
};
return (
+2 -2
View File
@@ -28,7 +28,7 @@ const RegisterPage = () => {
if (!user) {
return;
}
navigation.navigate(user.SGid === 0 ? 'admin-hub' : 'game-type');
navigation.navigate(user.SGid === 0 ? '(routes)/admin-hub' : '(routes)/game-type');
};
return (
@@ -68,7 +68,7 @@ const RegisterPage = () => {
<Pressable style={styles.submitButton} onPress={handleRegister}>
<Text style={styles.submitText}>{submitting ? 'Creating...' : 'Create Account'}</Text>
</Pressable>
<Pressable onPress={() => navigation.navigate('login')}>
<Pressable onPress={() => navigation.navigate('(routes)/login')}>
<Text style={styles.backText}>Back to Login</Text>
</Pressable>
{!!error && <Text style={styles.errorText}>{error}</Text>}