Added biome for formatting, code formatted

This commit is contained in:
2024-05-08 16:50:25 +02:00
parent dc446fe8dc
commit e62ef8695b
15 changed files with 678 additions and 510 deletions

View File

@ -4,19 +4,19 @@ import { useAuth } from "../context/AuthContext";
import { View, Text } from "react-native";
export default function AppLayout() {
const { authState } = useAuth();
const { authState } = useAuth();
if (authState.authenticated === null) {
// micro loading co neni skoro videt ale get the fuck out se uz neloguje
return (
<View>
<Text>Loading...</Text>
</View>
);
}
if (!authState.authenticated) {
console.log("get the fuck out");
return <Redirect href="/login" />;
}
return <Stack />;
if (authState.authenticated === null) {
// micro loading co neni skoro videt ale get the fuck out se uz neloguje
return (
<View>
<Text>Loading...</Text>
</View>
);
}
if (!authState.authenticated) {
console.log("get the fuck out");
return <Redirect href="/login" />;
}
return <Stack />;
}

View File

@ -3,21 +3,21 @@ import { Text, View } from "react-native";
import { useAuth } from "../context/AuthContext";
export default function Index() {
const { onLogout, authState } = useAuth();
const { onLogout, authState } = useAuth();
const user = authState.user;
const user = authState.user;
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Text>Welcome {user.username}</Text>
<Text
onPress={() => {
// The `app/(app)/_layout.tsx` will redirect to the sign-in screen.
onLogout();
}}
>
Sign Out
</Text>
</View>
);
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Text>Welcome {user.username}</Text>
<Text
onPress={() => {
// The `app/(app)/_layout.tsx` will redirect to the sign-in screen.
onLogout();
}}
>
Sign Out
</Text>
</View>
);
}