fix ( event )
deskripsi: - fix API detail dan pindah list peserta ke halaman beebeda
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { RouterEvent } from '@/app/lib/router_hipmi/router_event';
|
||||
import { AccentColor, MainColor } from '@/app_modules/_global/color';
|
||||
import { ActionIcon, Flex, Paper, Text, Loader } from '@mantine/core';
|
||||
import { IconUser } from '@tabler/icons-react';
|
||||
import { useParams, useRouter } from 'next/navigation';
|
||||
import React, { useState } from 'react';
|
||||
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
||||
import { ActionIcon, Flex, Loader, Paper, Text } from "@mantine/core";
|
||||
import { IconUsersGroup } from "@tabler/icons-react";
|
||||
import { useParams, useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
function Event_ComponentBoxDaftarPeserta({ eventId }: { eventId?: string }) {
|
||||
const params = useParams<{ id: string }>()
|
||||
const params = useParams<{ id: string }>();
|
||||
const router = useRouter();
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
return (
|
||||
@@ -28,12 +28,14 @@ function Event_ComponentBoxDaftarPeserta({ eventId }: { eventId?: string }) {
|
||||
}}
|
||||
>
|
||||
<Flex direction={"column"} align={"center"} justify={"center"}>
|
||||
<Text c={MainColor.white} fz={12}>Daftar Peserta</Text>
|
||||
<Text c={MainColor.white} fz={12}>
|
||||
Daftar Peserta
|
||||
</Text>
|
||||
<ActionIcon radius={"xl"} variant="transparent" size={60}>
|
||||
{isLoading ? (
|
||||
<Loader color="yellow" />
|
||||
) : (
|
||||
<IconUser size={70} color={MainColor.white} />
|
||||
<IconUsersGroup size={40} color={MainColor.white} />
|
||||
)}
|
||||
</ActionIcon>
|
||||
</Flex>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { RouterEvent } from '@/app/lib/router_hipmi/router_event';
|
||||
import { AccentColor, MainColor } from '@/app_modules/_global/color';
|
||||
import { ActionIcon, Flex, Loader, Paper, Text } from '@mantine/core';
|
||||
import { IconStar } from '@tabler/icons-react';
|
||||
import { useParams, useRouter } from 'next/navigation';
|
||||
import { useState } from 'react';
|
||||
import { TfiCup } from "react-icons/tfi";
|
||||
|
||||
function Event_ComponentBoxDaftarSponsor() {
|
||||
const router = useRouter();
|
||||
@@ -28,12 +28,14 @@ function Event_ComponentBoxDaftarSponsor() {
|
||||
}}
|
||||
>
|
||||
<Flex direction={"column"} align={"center"} justify={"center"}>
|
||||
<Text c={MainColor.white} fz={12}>Daftar Sponsor</Text>
|
||||
<Text c={MainColor.white} fz={12}>
|
||||
Daftar Sponsor
|
||||
</Text>
|
||||
<ActionIcon radius={"xl"} variant="transparent" size={60}>
|
||||
{isLoading ? (
|
||||
<Loader color="yellow" />
|
||||
) : (
|
||||
<TfiCup size={70} color={MainColor.white} />
|
||||
<IconStar size={40} color={MainColor.white} />
|
||||
)}
|
||||
</ActionIcon>
|
||||
</Flex>
|
||||
|
||||
@@ -1,26 +1,32 @@
|
||||
"use client";
|
||||
|
||||
import { MainColor } from "@/app_modules/_global/color";
|
||||
import {
|
||||
ComponentGlobal_AvatarAndUsername,
|
||||
ComponentGlobal_CardStyles,
|
||||
} from "@/app_modules/_global/component";
|
||||
import { Center, Grid, SimpleGrid, Skeleton, Stack, Text, Title } from "@mantine/core";
|
||||
import { MODEL_EVENT } from "../../model/interface";
|
||||
import { clientLogger } from "@/util/clientLogger";
|
||||
import {
|
||||
Grid,
|
||||
SimpleGrid,
|
||||
Stack,
|
||||
Text,
|
||||
Title
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useState } from "react";
|
||||
import { API_RouteEvent } from "@/app/lib/api_user_router/route_api_event";
|
||||
import { Event_ComponentSkeletonDetail } from "../skeleton/comp_skeleton_detail";
|
||||
import moment from "moment";
|
||||
import "moment/locale/id";
|
||||
import { MainColor } from "@/app_modules/_global/color";
|
||||
import { useParams } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { apiGetEventDetailById } from "../../_lib/api_event";
|
||||
import { MODEL_EVENT } from "../../model/interface";
|
||||
import { Event_ComponentSkeletonDetail } from "../skeleton/comp_skeleton_detail";
|
||||
import Event_ComponentBoxDaftarPeserta from "./comp_box_daftar_peserta";
|
||||
import Event_ComponentBoxDaftarSponsor from "./comp_box_sponsor";
|
||||
|
||||
export default function ComponentEvent_DetailMainData({
|
||||
eventId,
|
||||
}: {
|
||||
eventId: string;
|
||||
}) {
|
||||
export default function ComponentEvent_DetailMainData() {
|
||||
const params = useParams<{ id: string }>();
|
||||
const eventId = params.id as string;
|
||||
const [data, setData] = useState<MODEL_EVENT | null>(null);
|
||||
|
||||
useShallowEffect(() => {
|
||||
@@ -28,11 +34,17 @@ export default function ComponentEvent_DetailMainData({
|
||||
}, []);
|
||||
|
||||
async function onLoadData() {
|
||||
const data = await fetch(
|
||||
API_RouteEvent.get_one_by_id({ eventId: eventId })
|
||||
);
|
||||
const res = await data.json();
|
||||
setData(res.data);
|
||||
try {
|
||||
const respone = await apiGetEventDetailById({
|
||||
id: eventId,
|
||||
});
|
||||
|
||||
if (respone) {
|
||||
setData(respone.data);
|
||||
}
|
||||
} catch (error) {
|
||||
clientLogger.error("Error get data detail event", error);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -52,7 +64,9 @@ export default function ComponentEvent_DetailMainData({
|
||||
</Title>
|
||||
<Grid>
|
||||
<Grid.Col span={4}>
|
||||
<Text c={MainColor.white} fw={"bold"}>Lokasi</Text>
|
||||
<Text c={MainColor.white} fw={"bold"}>
|
||||
Lokasi
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={1}>:</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
@@ -61,19 +75,27 @@ export default function ComponentEvent_DetailMainData({
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.Col span={4}>
|
||||
<Text c={MainColor.white} fw={"bold"}>Tipe Acara</Text>
|
||||
<Text c={MainColor.white} fw={"bold"}>
|
||||
Tipe Acara
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={1}>:</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text c={MainColor.white}>{data ? data.EventMaster_TipeAcara.name : null}</Text>
|
||||
<Text c={MainColor.white}>
|
||||
{data ? data.EventMaster_TipeAcara.name : null}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
<Stack spacing={"xs"}>
|
||||
<Text c={MainColor.white} fw={"bold"}>Tanggal & Waktu</Text>
|
||||
<Text c={MainColor.white} fw={"bold"}>
|
||||
Tanggal & Waktu
|
||||
</Text>
|
||||
<Grid>
|
||||
<Grid.Col span={4}>
|
||||
<Text c={MainColor.white} fw={"bold"}>Mulai</Text>
|
||||
<Text c={MainColor.white} fw={"bold"}>
|
||||
Mulai
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={1}>:</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
@@ -88,7 +110,9 @@ export default function ComponentEvent_DetailMainData({
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.Col span={4}>
|
||||
<Text c={MainColor.white} fw={"bold"}>Selesai</Text>
|
||||
<Text c={MainColor.white} fw={"bold"}>
|
||||
Selesai
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={1}>:</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
@@ -104,7 +128,9 @@ export default function ComponentEvent_DetailMainData({
|
||||
</Stack>
|
||||
|
||||
<Stack spacing={2}>
|
||||
<Text c={MainColor.white} fw={"bold"}>Deskripsi</Text>
|
||||
<Text c={MainColor.white} fw={"bold"}>
|
||||
Deskripsi
|
||||
</Text>
|
||||
<Text c={MainColor.white}>{data ? data?.deskripsi : null}</Text>
|
||||
</Stack>
|
||||
<SimpleGrid
|
||||
@@ -114,8 +140,8 @@ export default function ComponentEvent_DetailMainData({
|
||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||
]}
|
||||
>
|
||||
<Event_ComponentBoxDaftarPeserta/>
|
||||
<Event_ComponentBoxDaftarSponsor />
|
||||
<Event_ComponentBoxDaftarPeserta />
|
||||
<Event_ComponentBoxDaftarSponsor />
|
||||
</SimpleGrid>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
Reference in New Issue
Block a user