2024-05-08 21:18:47 +02:00
|
|
|
import { StyleSheet, Text, View } from "react-native";
|
|
|
|
import Button from "@components/Button";
|
|
|
|
import { colors } from "@components/style";
|
|
|
|
import { useAuth } from "@context/AuthContext";
|
2024-05-09 20:06:20 +02:00
|
|
|
import { router } from "expo-router";
|
2024-05-08 21:18:47 +02:00
|
|
|
|
|
|
|
export default function Index() {
|
|
|
|
const { onLogout, authState } = useAuth();
|
|
|
|
const user = authState.user;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<View style={styles.container}>
|
2024-05-09 20:06:20 +02:00
|
|
|
<Text style={styles.h1}>Welcome {user.username}!</Text>
|
|
|
|
<Text style={styles.h2}>We hope, you're enjoying your beer.</Text>
|
|
|
|
<View style={styles.button}>
|
|
|
|
<Button
|
|
|
|
style={styles.button}
|
|
|
|
title="Add beer!"
|
|
|
|
color={colors.gold}
|
|
|
|
textColor={colors.white}
|
|
|
|
onPress={() => {
|
|
|
|
router.push("/beer");
|
|
|
|
}}
|
|
|
|
></Button>
|
|
|
|
</View>
|
2024-05-08 21:18:47 +02:00
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
flex: 1,
|
|
|
|
alignItems: "center",
|
|
|
|
},
|
|
|
|
h1: {
|
|
|
|
color: "#FFF",
|
|
|
|
fontSize: 30,
|
|
|
|
textAlign: "center",
|
|
|
|
paddingTop: "20%",
|
|
|
|
},
|
2024-05-09 20:06:20 +02:00
|
|
|
h2: {
|
|
|
|
color: "#FFF",
|
|
|
|
fontSize: 20,
|
|
|
|
textAlign: "center",
|
|
|
|
paddingTop: "1%",
|
|
|
|
},
|
|
|
|
button: {
|
|
|
|
color: colors.charcoal,
|
|
|
|
fontSize: 30,
|
|
|
|
textAlign: "center",
|
|
|
|
paddingTop: "2%",
|
|
|
|
},
|
2024-05-08 21:18:47 +02:00
|
|
|
});
|