# 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

@@ -43,6 +43,8 @@ export default function Event_DetailMain({
const router = useRouter();
const [total, setTotal] = useState(totalPeserta);
const [peserta, setPeserta] = useState(listPeserta);
const [isLoading, setLoading] = useState(false);
return (
<>
<Stack spacing={"lg"}>
@@ -53,10 +55,18 @@ export default function Event_DetailMain({
</Button>
) : (
<Button
loaderPosition="center"
loading={isLoading ? true : false}
radius={"xl"}
color="green"
onClick={() => {
onJoin(userLoginId, dataEvent.id, setPeserta, setTotal);
onJoin(
userLoginId,
dataEvent.id,
setPeserta,
setTotal,
setLoading
);
}}
>
JOIN
@@ -64,55 +74,6 @@ export default function Event_DetailMain({
)}
<ComponentEvent_ListPeserta listPeserta={listPeserta} total={total} />
{/* <Paper withBorder mt={"lg"}>
<Stack spacing={"md"} p={"md"}>
<Center>
<Title order={5}>Daftar Peserta ({total})</Title>
</Center>
{_.isEmpty(peserta) ? (
<Center>
<Text fz={"xs"} fw={"bold"}>
- Tidak ada peserta -
</Text>
</Center>
) : (
<Stack>
{peserta.map((e, i) => (
<Stack key={i} spacing={"sm"}>
<Grid>
<Grid.Col
span={"content"}
onClick={() => {
router.push(
RouterProfile.katalog + e.User.Profile.id
);
}}
>
<Avatar
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
radius={"xl"}
bg={"gray"}
size={30}
src={
RouterProfile.api_foto_profile +
e.User.Profile.imagesId
}
/>
</Grid.Col>
<Grid.Col span={"auto"}>
<Stack justify="center" h={"100%"}>
<Text>{e.User.Profile.name}</Text>
</Stack>
</Grid.Col>
</Grid>
<Divider />
</Stack>
))}
</Stack>
)}
</Stack>
</Paper> */}
</Stack>
</>
);
@@ -122,7 +83,8 @@ async function onJoin(
userId: string,
eventId: string,
setPeserta: any,
setTotal: any
setTotal: any,
setLoading: any
) {
const body = {
userId: userId,
@@ -135,6 +97,7 @@ async function onJoin(
await Event_countTotalPesertaById(eventId).then((ttl) => {
setPeserta(val);
setTotal(ttl);
setLoading(true);
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
});
});