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:
@@ -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,
|
||||
}}
|
||||
/>
|
||||
<PorfofolioSection />
|
||||
<PorfofolioSection setShowDeleteAlert={setDeleteAlert} />
|
||||
</ViewWrapper>
|
||||
|
||||
{/* Drawer Komponen Eksternal */}
|
||||
@@ -56,6 +57,22 @@ export default function Portofolio() {
|
||||
setIsDrawerOpen={setIsDrawerOpen}
|
||||
/>
|
||||
</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}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -103,14 +103,7 @@ export default function CreateProfile() {
|
||||
required
|
||||
onChange={(value) => setData({ ...(data as any), gender: value })}
|
||||
/>
|
||||
<TextInputCustom
|
||||
required
|
||||
label="Alamat"
|
||||
placeholder="Masukkan alamat"
|
||||
value={data.address}
|
||||
onChangeText={(text) => setData({ ...data, address: text })}
|
||||
/>
|
||||
{/* <Spacing /> */}
|
||||
<Spacing />
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
);
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
>
|
||||
<StackCustom gap={"xs"}>
|
||||
<SelectCustom
|
||||
label="Framework"
|
||||
placeholder="Pilih framework favoritmu"
|
||||
data={options}
|
||||
value={data.selectedValue}
|
||||
onChange={(value) => {
|
||||
setData({ ...(data as any), selectedValue: value });
|
||||
}}
|
||||
/>
|
||||
|
||||
<TextInputCustom
|
||||
label="Nama"
|
||||
placeholder="Nama"
|
||||
@@ -96,6 +79,16 @@ export default function ProfileEdit() {
|
||||
}}
|
||||
required
|
||||
/>
|
||||
<SelectCustom
|
||||
required
|
||||
label="Jenis Kelamin"
|
||||
placeholder="Pilih jenis kelamin"
|
||||
data={options}
|
||||
value={data.selectedValue}
|
||||
onChange={(value) => {
|
||||
setData({ ...(data as any), selectedValue: value });
|
||||
}}
|
||||
/>
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
);
|
||||
|
||||
@@ -30,14 +30,14 @@ const drawerItemsForumBeranda = ({
|
||||
{
|
||||
icon:
|
||||
status === "Open" ? (
|
||||
<Ionicons name="open" 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: "",
|
||||
color: status === "Open" ? MainColor.green : MainColor.orange,
|
||||
color: status === "Open" ? MainColor.orange : MainColor.green,
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
|
||||
@@ -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 (
|
||||
<ButtonCustom textColor={MainColor.white} iconLeft={<Ionicons name="trash-outline" size={20} color="white" />} onPress={handleDelete} backgroundColor={MainColor.red}>
|
||||
|
||||
@@ -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 (
|
||||
<StackCustom>
|
||||
<Portofolio_Data />
|
||||
<Portofolio_BusinessLocation />
|
||||
<Portofolio_SocialMediaSection />
|
||||
<Portofolio_ButtonDelete/>
|
||||
<Portofolio_ButtonDelete setShowDeleteAlert={setShowDeleteAlert}/>
|
||||
<Spacing/>
|
||||
</StackCustom>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user