Commit 058d4fab authored by Peter Skaar Nordby's avatar Peter Skaar Nordby
Browse files

Endrer profilsiden basert på om man er logget inn

parent d4cdd1b8
......@@ -11,20 +11,22 @@ import { ApplicationState } from '../store/interface';
export default function Profile() {
const auth: AuthState = useSelector(({ auth }: ApplicationState) => auth);
if (auth.user) {
if (!auth.loggedIn) {
return (
<View style={styles.container}>
<Login/>
<Login />
</View>
);
}
return (
<View style={styles.container}>
<Text style={styles.title}>{auth.user.username}</Text>
<View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" />
<ProfileInfo user={auth.user} />
</View>
);
else if (auth.user) {
return (
<View style={styles.container}>
<Text style={styles.title}>{auth.user.username}</Text>
<View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" />
<ProfileInfo user={auth.user} />
</View>
);
} else return;
}
const styles = StyleSheet.create({
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment