Fix:
- UI: status, detail status, delete button, detail utama, tampilan utama
- Semua terintergrasi ke API mobile

### No Issue
This commit is contained in:
2025-09-12 14:14:37 +08:00
parent b6d4c0e6a6
commit 005b798688
9 changed files with 180 additions and 81 deletions

View File

@@ -80,7 +80,7 @@ export default function EventEdit() {
}
};
const validateDate = () => {
const validateDate = async () => {
if (
data?.title === "" ||
data?.lokasi === "" ||
@@ -92,7 +92,8 @@ export default function EventEdit() {
text1: "Info",
text2: "Lengkapi semua data",
});
return;
return false;
}
const startDate = new Date(selectedDate as any);
@@ -104,12 +105,17 @@ export default function EventEdit() {
text1: "Info",
text2: "Ubah tanggal berakhirnya event",
});
return;
return false;
}
return true;
};
const handlerSubmit = async () => {
validateDate();
const isValid = await validateDate();
if (!isValid) return;
try {
setIsLoading(true);
const newData = {

View File

@@ -1,23 +1,42 @@
/* eslint-disable react-hooks/exhaustive-deps */
import {
ButtonCustom,
DotButton,
DrawerCustom,
MenuDrawerDynamicGrid,
Spacing,
ViewWrapper
ButtonCustom,
DotButton,
DrawerCustom,
MenuDrawerDynamicGrid,
Spacing,
ViewWrapper,
} from "@/components";
import { IMenuDrawerItem } from "@/components/_Interface/types";
import LeftButtonCustom from "@/components/Button/BackButton";
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
import { menuDrawerPublishEvent } from "@/screens/Event/menuDrawerPublish";
import { apiEventGetOne } from "@/service/api-client/api-event";
import { router, Stack, useLocalSearchParams } from "expo-router";
import { useState } from "react";
import { useEffect, useState } from "react";
import { Alert } from "react-native";
export default function EventDetailPublish() {
const { id } = useLocalSearchParams();
const [openDrawer, setOpenDrawer] = useState(false);
const [data, setData] = useState();
useEffect(() => {
onLoadData();
}, [id]);
async function onLoadData() {
try {
const response = await apiEventGetOne({ id: id as string });
if (response.success) {
setData(response.data);
}
} catch (error) {
console.log("[ERROR]", error);
}
}
const handlePress = (item: IMenuDrawerItem) => {
console.log("PATH ", item.path);
router.navigate(item.path as any);
@@ -44,19 +63,19 @@ export default function EventDetailPublish() {
}}
/>
<ViewWrapper>
<Event_BoxDetailPublishSection footerButton={footerButton} />
<Event_BoxDetailPublishSection data={data} footerButton={footerButton} />
<Spacing />
</ViewWrapper>
<DrawerCustom
isVisible={openDrawer}
closeDrawer={() => setOpenDrawer(false)}
height={250}
height={"auto"}
>
<MenuDrawerDynamicGrid
data={menuDrawerPublishEvent({ id: id as string })}
columns={4}
onPressItem={handlePress}
// onPressItem={handlePress}
/>
</DrawerCustom>
</>