# Fix
- Loading card
- Create : saat memilih jam sesuai dengan batas jam di hari itu
## No isuuee
This commit is contained in:
2024-05-23 17:17:40 +08:00
parent 10cf9c3a46
commit 166b1349f5
22 changed files with 484 additions and 400 deletions

View File

@@ -29,9 +29,10 @@ import ComponentEvent_BoxListStatus from "../component/box_list_status";
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
import _ from "lodash";
import { IconCirclePlus } from "@tabler/icons-react";
import { IconCirclePlus, IconPencilPlus } from "@tabler/icons-react";
import ComponentEvent_IsEmptyData from "../component/is_empty_data";
import { useWindowScroll } from "@mantine/hooks";
import ComponentGlobal_CardLoadingOverlay from "@/app_modules/component_global/loading_card";
export default function Event_Beranda({
dataEvent,
@@ -41,6 +42,8 @@ export default function Event_Beranda({
const router = useRouter();
const [isLoading, setLoading] = useState(false);
const [scroll, scrollTo] = useWindowScroll();
const [eventId, setEventId] = useState("");
const [visible, setVisible] = useState(false);
return (
<>
@@ -60,50 +63,56 @@ export default function Event_Beranda({
router.push(RouterEvent.create);
}}
>
<IconCirclePlus color="white" size={40} />
<IconPencilPlus color="white" />
</ActionIcon>
</Affix>
{_.isEmpty(dataEvent) ? (
<ComponentEvent_IsEmptyData text="Tidak ada data" />
) : (
<Box>
{Array(10)
.fill(0)
.map((e, i) => (
<Card key={i} shadow="lg" radius={"md"} withBorder mb={"sm"}>
<Card.Section px={"sm"} pt={"sm"}>
<ComponentGlobal_AuthorNameOnHeader
profileId={e?.Author.Profile.id}
imagesId={e?.Author.Profile.imagesId}
authorName={e?.Author.Profile.name}
/>
</Card.Section>
<Card.Section
p={"sm"}
onClick={() => router.push(RouterEvent.detail_main + e?.id)}
>
<Stack>
<Grid>
<Grid.Col span={8}>
<Title order={6} truncate>
{e?.title}
</Title>
</Grid.Col>
<Grid.Col span={4}>
<Text fz={"sm"} truncate>
{moment(e?.tanggal).format("ll")}
</Text>
</Grid.Col>
</Grid>
<Text fz={"sm"} lineClamp={2}>
{e?.deskripsi}
dataEvent.map((e, i) => (
<Card key={i} shadow="lg" radius={"md"} withBorder mb={"sm"}>
<Card.Section px={"sm"} pt={"sm"}>
<ComponentGlobal_AuthorNameOnHeader
profileId={e?.Author?.Profile?.id}
imagesId={e?.Author?.Profile?.imagesId}
authorName={e?.Author?.Profile?.name}
isPembatas={true}
/>
</Card.Section>
<Card.Section
p={"sm"}
onClick={() => {
setEventId(e?.id);
setVisible(true);
router.push(RouterEvent.detail_main + e?.id);
}}
>
<Stack>
<Grid>
<Grid.Col span={8}>
<Title order={6} truncate>
{e?.title}
</Title>
</Grid.Col>
<Grid.Col span={4}>
<Text fz={"sm"} truncate>
{moment(e?.tanggal).format("ll")}
</Text>
</Stack>
</Card.Section>
</Card>
))}
</Box>
</Grid.Col>
</Grid>
<Text fz={"sm"} lineClamp={2}>
{e?.deskripsi}
</Text>
</Stack>
</Card.Section>
{visible && e?.id === eventId ? (
<ComponentGlobal_CardLoadingOverlay />
) : (
""
)}
</Card>
))
)}
</>
);

View File

@@ -23,6 +23,7 @@ import { MODEL_EVENT_PESERTA } from "../../model/interface";
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
import _ from "lodash";
import ComponentGlobal_CardLoadingOverlay from "@/app_modules/component_global/loading_card";
export default function Event_Kontribusi({
listKontribusi,
@@ -30,19 +31,8 @@ export default function Event_Kontribusi({
listKontribusi: MODEL_EVENT_PESERTA[];
}) {
const router = useRouter();
const [tabsKontribusi, setTabsKontribusi] = useState<string | any>("Panitia");
const listTabs = [
{
id: 1,
path: <Event_KontribusiPanitia />,
value: "Panitia",
},
{
id: 2,
path: <Event_KontribusiPeserta />,
value: "Peserta",
},
];
const [eventId, setEventId] = useState("");
const [visible, setVisible] = useState(false);
if (_.isEmpty(listKontribusi))
return (
@@ -67,9 +57,10 @@ export default function Event_Kontribusi({
</Card.Section>
<Card.Section
p={"sm"}
onClick={() =>
router.push(RouterEvent.detail_kontribusi + e.Event.id)
}
onClick={() => {
setEventId(e?.id), setVisible(true);
router.push(RouterEvent.detail_kontribusi + e.Event.id);
}}
>
<Stack>
<Grid>
@@ -90,15 +81,15 @@ export default function Event_Kontribusi({
</Text> */}
<Group position="center">
{e.Event.Event_Peserta.map((val) => (
<Box key={val.id}>
{e.Event.Event_Peserta.map((val, i) => (
<Box key={i}>
<Avatar
size={"lg"}
radius={"xl"}
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
src={
RouterProfile.api_foto_profile +
val.User.Profile.imagesId
val?.User?.Profile?.imagesId
}
/>
</Box>
@@ -106,40 +97,13 @@ export default function Event_Kontribusi({
</Group>
</Stack>
</Card.Section>
{visible && eventId === e?.id ? (
<ComponentGlobal_CardLoadingOverlay />
) : (
""
)}
</Card>
))}
</>
);
// return (
// <>
// <Tabs
// color="blue"
// variant="pills"
// radius="xl"
// defaultValue="Panitia"
// value={tabsKontribusi}
// onTabChange={setTabsKontribusi}
// >
// <Stack>
// <Tabs.List grow>
// {listTabs.map((e) => (
// <Tabs.Tab
// key={e.id}
// value={e.value}
// bg={tabsKontribusi === e.value ? "blue" : "gray.1"}
// >
// Sebagai {e.value}
// </Tabs.Tab>
// ))}
// </Tabs.List>
// {listTabs.map((e) => (
// <Tabs.Panel key={e.id} value={e.value}>
// {e.path}
// </Tabs.Panel>
// ))}
// </Stack>
// </Tabs>
// </>
// );
}

View File

@@ -44,7 +44,7 @@ export default function LayoutEvent_Main({
{
id: "2",
name: "Status Event",
name: "Status",
path: RouterEvent.status_page,
icon: <IconTimelineEventText />,
},

View File

@@ -8,28 +8,25 @@ import { MODEL_EVENT } from "../../model/interface";
import { useState } from "react";
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
import _ from "lodash";
import ComponentEvent_IsEmptyData from "../../component/is_empty_data";
export default function Event_StatusDraft({
listDraft,
}: {
listDraft: MODEL_EVENT[];
}) {
const router = useRouter();
if (_.isEmpty(listDraft))
return (
<Center h={"50vh"} fz={"sm"} fw={"bold"}>
Tidak Ada Event
</Center>
);
return <ComponentEvent_IsEmptyData text="Tidak ada data" />;
return (
<>
{listDraft
.map((e, i) => (
<Box key={e.id}>
<ComponentEvent_BoxListStatus data={e} path={RouterEvent.detail_draft}/>
</Box>
))}
{listDraft.map((e, i) => (
<Box key={e.id}>
<ComponentEvent_BoxListStatus
data={e}
path={RouterEvent.detail_draft}
/>
</Box>
))}
</>
);
}

View File

@@ -7,6 +7,9 @@ import { useRouter } from "next/navigation";
import { MODEL_EVENT } from "../../model/interface";
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
import _ from "lodash";
import ComponentEvent_IsEmptyData from "../../component/is_empty_data";
import { useState } from "react";
import ComponentGlobal_CardLoadingOverlay from "@/app_modules/component_global/loading_card";
export default function Event_StatusPublish({
listPublish,
@@ -14,22 +17,29 @@ export default function Event_StatusPublish({
listPublish: MODEL_EVENT[];
}) {
const router = useRouter();
if (_.isEmpty(listPublish))
return (
<Center h={"50vh"} fz={"sm"} fw={"bold"}>
Tidak Ada Event
</Center>
);
return <ComponentEvent_IsEmptyData text="Tidak ada data" />;
return (
<>
{listPublish
.map((e, i) => (
<Box key={e.id}>
<ComponentEvent_BoxListStatus data={e} path={RouterEvent.detail_publish}/>
</Box>
))}
{listPublish.map((e, i) => (
<Box key={e.id}>
<Box>
<ComponentEvent_BoxListStatus
data={e}
path={RouterEvent.detail_publish}
/>
{/* {visible && e?.id === eventId ? (
<ComponentGlobal_CardLoadingOverlay />
) : (
""
)} */}
</Box>
</Box>
))}
</>
);
}

View File

@@ -7,19 +7,15 @@ import { useRouter } from "next/navigation";
import { MODEL_EVENT } from "../../model/interface";
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
import _ from "lodash";
import ComponentEvent_IsEmptyData from "../../component/is_empty_data";
export default function Event_StatusReject({
listReject,
}: {
listReject: MODEL_EVENT[];
}) {
const router = useRouter();
if (_.isEmpty(listReject))
return (
<Center h={"50vh"} fz={"sm"} fw={"bold"}>
Tidak Ada Event
</Center>
);
return <ComponentEvent_IsEmptyData text="Tidak ada data" />;
return (
<>
{listReject.map((e, i) => (

View File

@@ -9,7 +9,8 @@ import { useState } from "react";
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
import _ from "lodash";
import { useShallowEffect } from "@mantine/hooks";
import { Event_getByStatusId } from "../../fun/get/get_event_by_status_id";
import { Event_getListByStatusId } from "../../fun/get/get_list_event_by_status_id";
import ComponentEvent_IsEmptyData from "../../component/is_empty_data";
export default function Event_StatusReview({
listReview,
@@ -21,12 +22,8 @@ export default function Event_StatusReview({
const router = useRouter();
if (_.isEmpty(listReview))
return (
<Center h={"50vh"} fz={"sm"} fw={"bold"}>
Tidak Ada Event
</Center>
);
if (_.isEmpty(listReview))
return <ComponentEvent_IsEmptyData text="Tidak ada data"/>
return (
<>
{listReview.map((e, i) => (