From 24913a9f9750a560630f95c90c423475bcd520c8 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Tue, 15 Jul 2025 14:13:08 +0800 Subject: [PATCH] deskripsi: Fix: portofolio: alert hapus porto Fix: profile create hapus text input alamat & edit ganti select jenis kelamin Fix: menu forum Fix: button porto # No Issue --- .../(user)/portofolio/[id]/index.tsx | 23 ++++++++++++-- .../(user)/profile/[id]/create.tsx | 9 +----- .../(user)/profile/[id]/edit.tsx | 31 +++++++------------ screens/Forum/ListPage.tsx | 8 ++--- screens/Portofolio/ButtonDelete.tsx | 8 +++-- screens/Portofolio/PorfofolioSection.tsx | 8 +++-- 6 files changed, 49 insertions(+), 38 deletions(-) diff --git a/app/(application)/(user)/portofolio/[id]/index.tsx b/app/(application)/(user)/portofolio/[id]/index.tsx index b9baa62..beec8d5 100644 --- a/app/(application)/(user)/portofolio/[id]/index.tsx +++ b/app/(application)/(user)/portofolio/[id]/index.tsx @@ -1,4 +1,4 @@ -import { DrawerCustom } from "@/components"; +import { AlertCustom, DrawerCustom } from "@/components"; import LeftButtonCustom from "@/components/Button/BackButton"; import ViewWrapper from "@/components/_ShareComponent/ViewWrapper"; import { MainColor } from "@/constants/color-palet"; @@ -7,13 +7,14 @@ import Portofolio_MenuDrawerSection from "@/screens/Portofolio/MenuDrawer"; import PorfofolioSection from "@/screens/Portofolio/PorfofolioSection"; import { GStyles } from "@/styles/global-styles"; import { Ionicons } from "@expo/vector-icons"; -import { Stack, useLocalSearchParams } from "expo-router"; +import { Stack, useLocalSearchParams, router } from "expo-router"; import { useState } from "react"; import { TouchableOpacity } from "react-native"; export default function Portofolio() { const { id } = useLocalSearchParams(); const [isDrawerOpen, setIsDrawerOpen] = useState(false); + const [deleteAlert, setDeleteAlert] = useState(false); const openDrawer = () => { setIsDrawerOpen(true); @@ -42,7 +43,7 @@ export default function Portofolio() { headerTitleStyle: GStyles.headerTitleStyle, }} /> - + {/* Drawer Komponen Eksternal */} @@ -56,6 +57,22 @@ export default function Portofolio() { setIsDrawerOpen={setIsDrawerOpen} /> + + {/* Alert Delete */} + setDeleteAlert(false)} + onRightPress={() => { + setDeleteAlert(false); + console.log("Hapus portofolio"); + router.back(); + }} + title="Hapus Portofolio" + message="Apakah Anda yakin ingin menghapus portofolio ini?" + textLeft="Batal" + textRight="Hapus" + colorRight={MainColor.red} + /> ); } diff --git a/app/(application)/(user)/profile/[id]/create.tsx b/app/(application)/(user)/profile/[id]/create.tsx index f0d2343..a8d2792 100644 --- a/app/(application)/(user)/profile/[id]/create.tsx +++ b/app/(application)/(user)/profile/[id]/create.tsx @@ -103,14 +103,7 @@ export default function CreateProfile() { required onChange={(value) => setData({ ...(data as any), gender: value })} /> - setData({ ...data, address: text })} - /> - {/* */} + ); diff --git a/app/(application)/(user)/profile/[id]/edit.tsx b/app/(application)/(user)/profile/[id]/edit.tsx index 3ed0078..d0ae6c9 100644 --- a/app/(application)/(user)/profile/[id]/edit.tsx +++ b/app/(application)/(user)/profile/[id]/edit.tsx @@ -22,15 +22,8 @@ export default function ProfileEdit() { }); const options = [ - { label: "React", value: "react" }, - { label: "Vue", value: "vue" }, - { label: "Angular", value: "angular" }, - { label: "Svelte", value: "svelte" }, - { label: "Next.js", value: "nextjs" }, - { label: "Nuxt.js", value: "nuxtjs" }, - { label: "Remix", value: "remix" }, - { label: "Sapper", value: "sapper" }, - { label: "SvelteKit", value: "sveltekit" }, + { label: "Laki-laki", value: "laki-laki" }, + { label: "Perempuan", value: "perempuan" }, ]; const handleSave = () => { @@ -59,16 +52,6 @@ export default function ProfileEdit() { } > - { - setData({ ...(data as any), selectedValue: value }); - }} - /> - + { + setData({ ...(data as any), selectedValue: value }); + }} + /> ); diff --git a/screens/Forum/ListPage.tsx b/screens/Forum/ListPage.tsx index bd5e544..3415231 100644 --- a/screens/Forum/ListPage.tsx +++ b/screens/Forum/ListPage.tsx @@ -30,14 +30,14 @@ const drawerItemsForumBeranda = ({ { icon: status === "Open" ? ( - - ) : ( + ) : ( + ), - label: status === "Open" ? "Buka forum" : "Tutup forum", + label: status === "Open" ? "Tutup forum" : "Buka forum", path: "", - color: status === "Open" ? MainColor.green : MainColor.orange, + color: status === "Open" ? MainColor.orange : MainColor.green, }, { icon: ( diff --git a/screens/Portofolio/ButtonDelete.tsx b/screens/Portofolio/ButtonDelete.tsx index fb2c6f7..39ae5df 100644 --- a/screens/Portofolio/ButtonDelete.tsx +++ b/screens/Portofolio/ButtonDelete.tsx @@ -2,9 +2,13 @@ import { ButtonCustom } from "@/components"; import { MainColor } from "@/constants/color-palet"; import { Ionicons } from "@expo/vector-icons"; -export default function Portofolio_ButtonDelete() { +export default function Portofolio_ButtonDelete({ + setShowDeleteAlert, +}: { + setShowDeleteAlert: (value: boolean) => void; +}) { const handleDelete = () => { - console.log("Delete"); + setShowDeleteAlert(true); }; return ( } onPress={handleDelete} backgroundColor={MainColor.red}> diff --git a/screens/Portofolio/PorfofolioSection.tsx b/screens/Portofolio/PorfofolioSection.tsx index a945e40..fa02046 100644 --- a/screens/Portofolio/PorfofolioSection.tsx +++ b/screens/Portofolio/PorfofolioSection.tsx @@ -4,13 +4,17 @@ import Portofolio_Data from "./DataPortofolio"; import Portofolio_SocialMediaSection from "./SocialMediaSection"; import Portofolio_ButtonDelete from "./ButtonDelete"; -export default function PorfofolioSection() { +export default function PorfofolioSection({ + setShowDeleteAlert, +}: { + setShowDeleteAlert: (value: boolean) => void; +}) { return ( - + );