Layouts & Navigation - app/(application)/_layout.tsx - app/(application)/(user)/_layout.tsx - app/(application)/(user)/event/(tabs)/_layout.tsx - app/(application)/(user)/job/(tabs)/_layout.tsx - app/(application)/(user)/voting/(tabs)/_layout.tsx - app/(application)/(user)/portofolio/_layout.tsx - app/(application)/(user)/profile/_layout.tsx - app/(application)/admin/_layout.tsx - app/+not-found.tsx User – File - app/(application)/(file)/[id].tsx User – Collaboration - app/(application)/(user)/collaboration/[id]/index.tsx - app/(application)/(user)/collaboration/[id]/detail-project-main.tsx - app/(application)/(user)/collaboration/[id]/detail-participant.tsx - app/(application)/(user)/collaboration/[id]/[detail]/info.tsx - app/(application)/(user)/collaboration/[id]/[detail]/room-chat.tsx User – Donation - app/(application)/(user)/donation/[id]/index.tsx - app/(application)/(user)/donation/[id]/[status]/detail.tsx - app/(application)/(user)/donation/[id]/(news)/[news]/index.tsx User – Event - app/(application)/(user)/event/[id]/[status]/detail-event.tsx - app/(application)/(user)/event/[id]/confirmation.tsx - app/(application)/(user)/event/[id]/contribution.tsx - app/(application)/(user)/event/[id]/history.tsx - app/(application)/(user)/event/[id]/publish.tsx User – Investment - app/(application)/(user)/investment/[id]/index.tsx - app/(application)/(user)/investment/[id]/[status]/detail.tsx - app/(application)/(user)/investment/[id]/(my-holding)/[id].tsx - app/(application)/(user)/investment/[id]/(news)/[news]/index.tsx User – Job - app/(application)/(user)/job/[id]/[status]/detail.tsx User – Portofolio - app/(application)/(user)/portofolio/[id]/index.tsx User – Profile - app/(application)/(user)/profile/[id]/index.tsx User – Voting - app/(application)/(user)/voting/[id]/index.tsx - app/(application)/(user)/voting/[id]/[status]/detail.tsx - app/(application)/(user)/voting/[id]/contribution.tsx - app/(application)/(user)/voting/[id]/history.tsx Components - components/Button/BackButtonFromNotification.tsx - components/_ShareComponent/AppHeader.tsx Admin Screens - screens/Admin/Notification-Admin/ScreenNotificationAdmin.tsx - screens/Admin/Notification-Admin/ScreenNotificationAdmin2.tsx Screens – Donation - screens/Donation/ScreenListOfNews.tsx - screens/Donation/ScreenRecapOfNews.tsx Screens – Forum - screens/Forum/ViewBeranda.tsx - screens/Forum/ViewBeranda2.tsx - screens/Forum/ViewBeranda3.tsx Screens – Investment - screens/Invesment/Document/ScreenRecapOfDocument.tsx - screens/Invesment/News/ScreenListOfNews.tsx - screens/Invesment/News/ScreenRecapOfNews.tsx Screens – Notification - screens/Notification/ScreenNotification_V1.tsx - screens/Notification/ScreenNotification_V2.tsx iOS - ios/HIPMIBadungConnect.xcodeproj/project.pbxproj Docs - QWEN.md ### Issue: Tabs can't clicked
137 lines
3.5 KiB
TypeScript
137 lines
3.5 KiB
TypeScript
/* eslint-disable react-hooks/exhaustive-deps */
|
|
import {
|
|
BaseBox,
|
|
DotButton,
|
|
DrawerCustom,
|
|
Grid,
|
|
MenuDrawerDynamicGrid,
|
|
Spacing,
|
|
StackCustom,
|
|
TextCustom,
|
|
ViewWrapper,
|
|
} from "@/components";
|
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
|
import Event_ButtonStatusSection from "@/screens/Event/ButtonStatusSection";
|
|
import { menuDrawerDraftEvent } from "@/screens/Event/menuDrawerDraft";
|
|
import { apiEventGetOne } from "@/service/api-client/api-event";
|
|
import { dateTimeView } from "@/utils/dateTimeView";
|
|
import {
|
|
router,
|
|
Stack,
|
|
useFocusEffect,
|
|
useLocalSearchParams,
|
|
} from "expo-router";
|
|
import { useCallback, useState } from "react";
|
|
|
|
export default function EventDetailStatus() {
|
|
const { id, status } = useLocalSearchParams();
|
|
const [openDrawer, setOpenDrawer] = useState(false);
|
|
// const [openAlert, setOpenAlert] = useState(false);
|
|
|
|
const [data, setData] = useState<any>();
|
|
|
|
useFocusEffect(
|
|
useCallback(() => {
|
|
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 listData = [
|
|
{
|
|
title: "Lokasi",
|
|
value: data?.lokasi || "-",
|
|
},
|
|
{
|
|
title: "Tipe Acara",
|
|
value: data?.EventMaster_TipeAcara?.name || "-",
|
|
},
|
|
{
|
|
title: "Tanggal Mulai",
|
|
value: dateTimeView({ date: data?.tanggal }) || "-",
|
|
},
|
|
{
|
|
title: "Tanggal Berakhir",
|
|
value: dateTimeView({ date: data?.tanggalSelesai }) || "-",
|
|
},
|
|
{
|
|
title: "Deskripsi",
|
|
value: data?.deskripsi || "-",
|
|
},
|
|
];
|
|
|
|
const handlePress = (item: IMenuDrawerItem) => {
|
|
console.log("PATH >> ", item.path);
|
|
router.navigate(item.path as any);
|
|
setOpenDrawer(false);
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<Stack.Screen
|
|
options={{
|
|
header: () => (
|
|
<AppHeader
|
|
title={`Detail ${status === "publish" ? "" : status}`}
|
|
left={<LeftButtonCustom />}
|
|
right={
|
|
status === "draft" ? (
|
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
|
) : null
|
|
}
|
|
/>
|
|
),
|
|
}}
|
|
/>
|
|
<ViewWrapper>
|
|
<BaseBox>
|
|
<StackCustom>
|
|
<TextCustom bold align="center" size="xlarge">
|
|
{data?.title || "-"}
|
|
</TextCustom>
|
|
{listData.map((item, index) => (
|
|
<Grid key={index}>
|
|
<Grid.Col span={4}>
|
|
<TextCustom bold>{item.title}</TextCustom>
|
|
</Grid.Col>
|
|
<Grid.Col span={8}>
|
|
<TextCustom>{item.value}</TextCustom>
|
|
</Grid.Col>
|
|
</Grid>
|
|
))}
|
|
</StackCustom>
|
|
</BaseBox>
|
|
<Event_ButtonStatusSection
|
|
id={id as string}
|
|
status={status as string}
|
|
/>
|
|
<Spacing />
|
|
</ViewWrapper>
|
|
|
|
<DrawerCustom
|
|
isVisible={openDrawer}
|
|
closeDrawer={() => setOpenDrawer(false)}
|
|
height={"auto"}
|
|
>
|
|
<MenuDrawerDynamicGrid
|
|
data={menuDrawerDraftEvent({ id: id as string }) as any}
|
|
columns={4}
|
|
onPressItem={handlePress as any}
|
|
/>
|
|
</DrawerCustom>
|
|
</>
|
|
);
|
|
}
|