fix route

deskripsi:
- perbaiki route tujuan pada create profile
This commit is contained in:
2025-07-08 14:18:50 +08:00
parent 3d9672154c
commit 0698e14d36
4 changed files with 28 additions and 11 deletions

View File

@@ -11,10 +11,12 @@ import InformationBox from "@/components/Box/InformationBox";
import ButtonUpload from "@/components/Button/ButtonUpload"; import ButtonUpload from "@/components/Button/ButtonUpload";
import LandscapeFrameUploaded from "@/components/Image/LandscapeFrameUploaded"; import LandscapeFrameUploaded from "@/components/Image/LandscapeFrameUploaded";
import { GStyles } from "@/styles/global-styles"; import { GStyles } from "@/styles/global-styles";
import { router, useLocalSearchParams } from "expo-router";
import { useState } from "react"; import { useState } from "react";
import { View } from "react-native"; import { View } from "react-native";
export default function CreateProfile() { export default function CreateProfile() {
const { id } = useLocalSearchParams();
const [data, setData] = useState({ const [data, setData] = useState({
name: "", name: "",
email: "", email: "",
@@ -24,7 +26,7 @@ export default function CreateProfile() {
const handlerSave = () => { const handlerSave = () => {
console.log("data create profile >>", data); console.log("data create profile >>", data);
// router.back(); router.back();
}; };
const footerComponent = ( const footerComponent = (
@@ -32,7 +34,7 @@ export default function CreateProfile() {
<View style={GStyles.bottomBarContainer}> <View style={GStyles.bottomBarContainer}>
<ButtonCustom <ButtonCustom
onPress={handlerSave} onPress={handlerSave}
disabled={!data.name || !data.email || !data.address || !data.gender} // disabled={!data.name || !data.email || !data.address || !data.gender}
> >
Simpan Simpan
</ButtonCustom> </ButtonCustom>
@@ -47,7 +49,9 @@ export default function CreateProfile() {
<View style={{ alignItems: "center" }}> <View style={{ alignItems: "center" }}>
<AvatarCustom size="xl" /> <AvatarCustom size="xl" />
<Spacing /> <Spacing />
<ButtonUpload onPress={() => console.log("pressed")} /> <ButtonUpload
onPress={() => router.navigate(`/take-picture/${id}`)}
/>
</View> </View>
<Spacing /> <Spacing />
@@ -56,7 +60,9 @@ export default function CreateProfile() {
<InformationBox text="Upload foto latar belakang anda." /> <InformationBox text="Upload foto latar belakang anda." />
<LandscapeFrameUploaded /> <LandscapeFrameUploaded />
<Spacing /> <Spacing />
<ButtonUpload onPress={() => console.log("pressed")} /> <ButtonUpload
onPress={() => router.navigate(`/take-picture/${id}`)}
/>
</View> </View>
<Spacing /> <Spacing />

View File

@@ -1,9 +1,16 @@
import { Text, View } from "react-native"; import { StackCustom, TextCustom, ViewWrapper } from "@/components";
export default function NotFoundScreen() { export default function NotFoundScreen() {
return ( return (
<View> <ViewWrapper>
<Text>Not Found</Text> <StackCustom align="center" gap={0} style={{justifyContent: "center", alignItems: "center", flex: 1}}>
</View> <TextCustom size="large" bold style={{fontSize: 100}}>
) 404
</TextCustom>
<TextCustom size="large" bold>
Sorry, File Not Found
</TextCustom>
</StackCustom>
</ViewWrapper>
);
} }

View File

@@ -15,6 +15,7 @@ export default function RootLayout() {
}} }}
> >
<Stack.Screen name="index" options={{ title: "" }} /> <Stack.Screen name="index" options={{ title: "" }} />
<Stack.Screen name="+not-found" options={{ title: "" }} />
<Stack.Screen <Stack.Screen
name="verification" name="verification"
options={{ title: "", headerBackVisible: false }} options={{ title: "", headerBackVisible: false }}

View File

@@ -3,7 +3,7 @@ import { BaseBox, Grid, Spacing, TextCustom } from "@/components";
import { MainColor } from "@/constants/color-palet"; import { MainColor } from "@/constants/color-palet";
import { ICON_SIZE_SMALL } from "@/constants/constans-value"; import { ICON_SIZE_SMALL } from "@/constants/constans-value";
import { FontAwesome5, Ionicons } from "@expo/vector-icons"; import { FontAwesome5, Ionicons } from "@expo/vector-icons";
import { useLocalSearchParams } from "expo-router"; import { router, useLocalSearchParams } from "expo-router";
import { View } from "react-native"; import { View } from "react-native";
import AvatarAndBackground from "./AvatarAndBackground"; import AvatarAndBackground from "./AvatarAndBackground";
@@ -85,7 +85,10 @@ export default function ProfilSection() {
<BaseBox <BaseBox
key={index} key={index}
style={{ backgroundColor: MainColor.darkblue }} style={{ backgroundColor: MainColor.darkblue }}
onPress={() => console.log("pressed")} onPress={() => {
console.log("press to Portofolio");
router.push(`/portofolio/${id}`);
}}
> >
<Grid> <Grid>
<Grid.Col <Grid.Col