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
This commit is contained in:
2025-07-15 14:13:08 +08:00
parent 3376336c55
commit 24913a9f97
6 changed files with 49 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
import { DrawerCustom } from "@/components"; import { AlertCustom, DrawerCustom } from "@/components";
import LeftButtonCustom from "@/components/Button/BackButton"; import LeftButtonCustom from "@/components/Button/BackButton";
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper"; import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
import { MainColor } from "@/constants/color-palet"; import { MainColor } from "@/constants/color-palet";
@@ -7,13 +7,14 @@ import Portofolio_MenuDrawerSection from "@/screens/Portofolio/MenuDrawer";
import PorfofolioSection from "@/screens/Portofolio/PorfofolioSection"; import PorfofolioSection from "@/screens/Portofolio/PorfofolioSection";
import { GStyles } from "@/styles/global-styles"; import { GStyles } from "@/styles/global-styles";
import { Ionicons } from "@expo/vector-icons"; import { Ionicons } from "@expo/vector-icons";
import { Stack, useLocalSearchParams } from "expo-router"; import { Stack, useLocalSearchParams, router } from "expo-router";
import { useState } from "react"; import { useState } from "react";
import { TouchableOpacity } from "react-native"; import { TouchableOpacity } from "react-native";
export default function Portofolio() { export default function Portofolio() {
const { id } = useLocalSearchParams(); const { id } = useLocalSearchParams();
const [isDrawerOpen, setIsDrawerOpen] = useState(false); const [isDrawerOpen, setIsDrawerOpen] = useState(false);
const [deleteAlert, setDeleteAlert] = useState(false);
const openDrawer = () => { const openDrawer = () => {
setIsDrawerOpen(true); setIsDrawerOpen(true);
@@ -42,7 +43,7 @@ export default function Portofolio() {
headerTitleStyle: GStyles.headerTitleStyle, headerTitleStyle: GStyles.headerTitleStyle,
}} }}
/> />
<PorfofolioSection /> <PorfofolioSection setShowDeleteAlert={setDeleteAlert} />
</ViewWrapper> </ViewWrapper>
{/* Drawer Komponen Eksternal */} {/* Drawer Komponen Eksternal */}
@@ -56,6 +57,22 @@ export default function Portofolio() {
setIsDrawerOpen={setIsDrawerOpen} setIsDrawerOpen={setIsDrawerOpen}
/> />
</DrawerCustom> </DrawerCustom>
{/* Alert Delete */}
<AlertCustom
isVisible={deleteAlert}
onLeftPress={() => 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}
/>
</> </>
); );
} }

View File

@@ -103,14 +103,7 @@ export default function CreateProfile() {
required required
onChange={(value) => setData({ ...(data as any), gender: value })} onChange={(value) => setData({ ...(data as any), gender: value })}
/> />
<TextInputCustom <Spacing />
required
label="Alamat"
placeholder="Masukkan alamat"
value={data.address}
onChangeText={(text) => setData({ ...data, address: text })}
/>
{/* <Spacing /> */}
</StackCustom> </StackCustom>
</ViewWrapper> </ViewWrapper>
); );

View File

@@ -22,15 +22,8 @@ export default function ProfileEdit() {
}); });
const options = [ const options = [
{ label: "React", value: "react" }, { label: "Laki-laki", value: "laki-laki" },
{ label: "Vue", value: "vue" }, { label: "Perempuan", value: "perempuan" },
{ 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" },
]; ];
const handleSave = () => { const handleSave = () => {
@@ -59,16 +52,6 @@ export default function ProfileEdit() {
} }
> >
<StackCustom gap={"xs"}> <StackCustom gap={"xs"}>
<SelectCustom
label="Framework"
placeholder="Pilih framework favoritmu"
data={options}
value={data.selectedValue}
onChange={(value) => {
setData({ ...(data as any), selectedValue: value });
}}
/>
<TextInputCustom <TextInputCustom
label="Nama" label="Nama"
placeholder="Nama" placeholder="Nama"
@@ -96,6 +79,16 @@ export default function ProfileEdit() {
}} }}
required required
/> />
<SelectCustom
required
label="Jenis Kelamin"
placeholder="Pilih jenis kelamin"
data={options}
value={data.selectedValue}
onChange={(value) => {
setData({ ...(data as any), selectedValue: value });
}}
/>
</StackCustom> </StackCustom>
</ViewWrapper> </ViewWrapper>
); );

View File

@@ -30,14 +30,14 @@ const drawerItemsForumBeranda = ({
{ {
icon: icon:
status === "Open" ? ( status === "Open" ? (
<Ionicons name="open" size={ICON_SIZE_SMALL} color={MainColor.white} />
) : (
<Ionicons name="close" size={ICON_SIZE_SMALL} color={MainColor.white} /> <Ionicons name="close" size={ICON_SIZE_SMALL} color={MainColor.white} />
) : (
<Ionicons name="open" size={ICON_SIZE_SMALL} color={MainColor.white} />
), ),
label: status === "Open" ? "Buka forum" : "Tutup forum", label: status === "Open" ? "Tutup forum" : "Buka forum",
path: "", path: "",
color: status === "Open" ? MainColor.green : MainColor.orange, color: status === "Open" ? MainColor.orange : MainColor.green,
}, },
{ {
icon: ( icon: (

View File

@@ -2,9 +2,13 @@ import { ButtonCustom } from "@/components";
import { MainColor } from "@/constants/color-palet"; import { MainColor } from "@/constants/color-palet";
import { Ionicons } from "@expo/vector-icons"; import { Ionicons } from "@expo/vector-icons";
export default function Portofolio_ButtonDelete() { export default function Portofolio_ButtonDelete({
setShowDeleteAlert,
}: {
setShowDeleteAlert: (value: boolean) => void;
}) {
const handleDelete = () => { const handleDelete = () => {
console.log("Delete"); setShowDeleteAlert(true);
}; };
return ( return (
<ButtonCustom textColor={MainColor.white} iconLeft={<Ionicons name="trash-outline" size={20} color="white" />} onPress={handleDelete} backgroundColor={MainColor.red}> <ButtonCustom textColor={MainColor.white} iconLeft={<Ionicons name="trash-outline" size={20} color="white" />} onPress={handleDelete} backgroundColor={MainColor.red}>

View File

@@ -4,13 +4,17 @@ import Portofolio_Data from "./DataPortofolio";
import Portofolio_SocialMediaSection from "./SocialMediaSection"; import Portofolio_SocialMediaSection from "./SocialMediaSection";
import Portofolio_ButtonDelete from "./ButtonDelete"; import Portofolio_ButtonDelete from "./ButtonDelete";
export default function PorfofolioSection() { export default function PorfofolioSection({
setShowDeleteAlert,
}: {
setShowDeleteAlert: (value: boolean) => void;
}) {
return ( return (
<StackCustom> <StackCustom>
<Portofolio_Data /> <Portofolio_Data />
<Portofolio_BusinessLocation /> <Portofolio_BusinessLocation />
<Portofolio_SocialMediaSection /> <Portofolio_SocialMediaSection />
<Portofolio_ButtonDelete/> <Portofolio_ButtonDelete setShowDeleteAlert={setShowDeleteAlert}/>
<Spacing/> <Spacing/>
</StackCustom> </StackCustom>
); );