Skip to content

Commit c4babee

Browse files
committed
Refactor authentication flow and remove login screen
- Simplified the Index component by removing loading state handling and directly redirecting to the home screen. - Deleted the login screen component to streamline the authentication process. - Updated AccountScreen to redirect to home instead of login upon logout. - Adjusted home screen background image source for better asset management.
1 parent ec5924f commit c4babee

File tree

6 files changed

+13
-254
lines changed

6 files changed

+13
-254
lines changed

mobile/app/(auth)/_layout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export default function AuthLayout() {
99
contentStyle: { backgroundColor: colors.background },
1010
}}
1111
>
12-
<Stack.Screen name="login" />
1312
<Stack.Screen name="set-username" />
1413
</Stack>
1514
);

mobile/app/(auth)/login.tsx

Lines changed: 0 additions & 224 deletions
This file was deleted.

mobile/app/(tabs)/account.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default function AccountScreen() {
6060
style: 'destructive',
6161
onPress: async () => {
6262
await logout();
63-
router.replace('/(auth)/login');
63+
router.replace('/(tabs)/home');
6464
},
6565
},
6666
]
@@ -75,7 +75,9 @@ export default function AccountScreen() {
7575
<Text style={styles.notLoggedIn}>Not logged in</Text>
7676
<Pressable
7777
style={styles.loginButton}
78-
onPress={() => router.push('/(auth)/login')}
78+
onPress={() => {
79+
// TODO: Implement Google Sign-In directly
80+
}}
7981
>
8082
<Text style={styles.loginButtonText}>Login</Text>
8183
</Pressable>

mobile/app/(tabs)/home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default function HomeScreen() {
192192
<View style={styles.container}>
193193
{/* Background Image */}
194194
<ImageBackground
195-
source={{ uri: 'https://www.worldguessr.com/street2christmas.jpg' }}
195+
source={require('../../assets/street2.jpg')}
196196
style={styles.backgroundImage}
197197
resizeMode="cover"
198198
/>

mobile/app/index.tsx

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,14 @@
11
import { useEffect } from 'react';
2-
import { View, ActivityIndicator, StyleSheet } from 'react-native';
32
import { Redirect } from 'expo-router';
43
import { useAuthStore } from '../src/store/authStore';
5-
import { colors } from '../src/shared';
64

75
export default function Index() {
8-
const { isLoading, isAuthenticated, loadSession } = useAuthStore();
6+
const { loadSession } = useAuthStore();
97

8+
// Load auth session in the background — don't block navigation
109
useEffect(() => {
1110
loadSession();
1211
}, []);
1312

14-
if (isLoading) {
15-
return (
16-
<View style={styles.container}>
17-
<ActivityIndicator size="large" color={colors.primary} />
18-
</View>
19-
);
20-
}
21-
22-
// Redirect based on auth state
23-
if (isAuthenticated) {
24-
return <Redirect href="/(tabs)/home" />;
25-
}
26-
27-
return <Redirect href="/(auth)/login" />;
13+
return <Redirect href="/(tabs)/home" />;
2814
}
29-
30-
const styles = StyleSheet.create({
31-
container: {
32-
flex: 1,
33-
justifyContent: 'center',
34-
alignItems: 'center',
35-
backgroundColor: colors.background,
36-
},
37-
});

spec-claude/01-overview.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# WorldGuessr - Overview & Architecture
2+
Hi Claude, today we will primarily be working on stuff for the WorldGuessr mobile app located in the mobile/ folder of this directory. To
3+
get more context about this project please read the files in spec-claude/ which are a good starting place to understand this proj. I
4+
suggest you take a bit of time to immerse yourself with that and the codebase in mobile/ first and we will proceed!
25

36
## What is WorldGuessr
47
- Free GeoGuessr alternative web game
@@ -18,6 +21,8 @@
1821
- **i18n**: Custom hook-based system, 5 languages (en, es, fr, de, ru)
1922
- **Key Libraries**: react-responsive-modal, react-toastify, chart.js, react-icons, bad-words, @googlemaps/js-api-loader
2023

24+
Our goal with this project is to create an exact replica of this web client in React Native, while minimizing bloat and ensuring a smoother experience (so not just a simple iframe, need to rebuild everything in a better manner while keeping exact same style and functionality)
25+
2126
## Project Structure
2227
```
2328
worldguessr/

0 commit comments

Comments
 (0)