Jkdsjkdjw
This commit is contained in:
@@ -1,18 +1,5 @@
|
||||
import { Stack, useRouter } from "expo-router";
|
||||
import { useAuth } from "@/context/auth-context";
|
||||
import { useEffect } from "react";
|
||||
import { Stack } from "expo-router";
|
||||
|
||||
export default function AuthLayout() {
|
||||
const { user } = useAuth();
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (user) {
|
||||
router.replace("/(tabs)");
|
||||
} else {
|
||||
router.replace("/(auth)/login");
|
||||
}
|
||||
}, [user]);
|
||||
|
||||
return <Stack />;
|
||||
}
|
||||
return <Stack screenOptions={{ headerShown: false }} />;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ function LoginScreen({ onSwitch }) {
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity onPress={onSwitch}>
|
||||
<Text style={styles.link}>Don't have an account? Register</Text>
|
||||
<Text style={styles.link}>Don't have an account? Register</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
@@ -142,4 +142,4 @@ const styles = StyleSheet.create({
|
||||
textAlign: "center",
|
||||
color: "#007BFF",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user