Fakultas Ilmu Komputer UI

Commit 744e6e1c authored by Muhammad Zahran Agung Dewantoro's avatar Muhammad Zahran Agung Dewantoro
Browse files

Merge branch 'profile-screen' into 'dev'

Update Auth Screen

See merge request !44
parents 523941ec d190e1d6
......@@ -6,11 +6,11 @@ export default {
slug: "Clicks",
version: "1.0.0",
orientation: "portrait",
icon: "./assets/images/icon.png",
icon: "./assets/images/clickIcon.png",
scheme: "myapp",
userInterfaceStyle: "automatic",
splash: {
image: "./assets/images/splash.png",
image: "./assets/images/adaptive-logo.png",
resizeMode: "contain",
backgroundColor: "#ffffff",
},
......
import { useNavigation } from "@react-navigation/core";
import * as React from "react";
import React, { useEffect } from "react";
import { StyleSheet, Image } from "react-native";
import { TouchableOpacity } from "react-native-gesture-handler";
import { View } from "../../components/Themed";
import Colors from "../../constants/Colors";
import { RootTabScreenProps } from "../../types/navigation";
......@@ -13,12 +12,10 @@ export default function LandingScreen({
const nav = useNavigation();
return (
<View style={styles.container}>
{/* <TouchableOpacity onPress={() => nav.navigate("OnBoard")}> */}
<Image
style={styles.logo}
source={require("../../../assets/images/ClickLogo.png")}
/>
{/* </TouchableOpacity> */}
</View>
);
}
......
......@@ -63,7 +63,7 @@ const LoginScreen = ({ navigation }: RootTabScreenProps<"TabOne">) => {
<MainButton
text="Masuk"
colors="primary"
onPress={() => nav.navigate("Auth", { screen: "Login" })}
onPress={() => nav.navigate("Profile", { screen: "ProfileScreen" })}
/>
</View>
<Spacer variant={"l"} />
......
......@@ -61,7 +61,7 @@ const styles = StyleSheet.create({
justifyContent: "center",
alignItems: "center",
backgroundColor: Colors.background,
paddingHorizontal: 24,
padding: 24,
display: "flex",
},
imageCointainer: {
......
......@@ -2,31 +2,45 @@ import { useNavigation } from "@react-navigation/core";
import * as React from "react";
import { useState } from "react";
import { StyleSheet, Image } from "react-native";
import { TouchableOpacity } from "react-native-gesture-handler";
import { Text, View } from "../../components/Themed";
import Colors from "../../constants/Colors";
import { RootTabScreenProps } from "../../types/navigation";
import SmallButton from "../../components/button/SmallButton";
import { Avatar, Title, Caption } from "react-native-paper";
import { Title } from "react-native-paper";
import { MaterialIcons } from "@expo/vector-icons";
import Spacer from "../../components/Spacer/Spacer";
import { useSelector } from "react-redux";
import { RootState } from "../../redux/store";
import { IUser } from "../../types/firebase/User";
export default function ProfileScreen({
navigation,
}: RootTabScreenProps<"Profile">) {
const nav = useNavigation();
const [name, setName] = useState("Test User");
// const [image, setImage] = useState("");
const user: IUser = useSelector((state: RootState) => state.user);
return (
<View style={styles.container}>
<View style={styles.imageWrapper}>
<Image
style={styles.image}
source={require("../../../assets/images/defaultProfilePic.png")}
source={
user.pic !== ""
? { uri: user.pic }
: require("../../../assets/images/defaultProfilePic.png")
}
/>
{/* {user.pic !== "" ? (
<Image style={styles.image} source={{ uri: user.pic }} />
) : (
<Image
style={styles.image}
source={require("../../../assets/images/defaultProfilePic.png")}
/>
)} */}
<View style={styles.textWrapper}>
<Title style={styles.userName}>{name}</Title>
<Title style={styles.userName}>
{user.firstName} {user.lastName}
</Title>
<Spacer variant={"xl"} />
<SmallButton
onPress={() => nav.navigate("AccountSettings")}
......
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