Add API Dashboard Donasi & Fix UI Dashboard
This commit is contained in:
@@ -26,6 +26,8 @@ import ComponentAdminVote_DetailHasil from "../../component/detail_hasil";
|
||||
import { adminVote_funGetListRiwayat } from "../../fun";
|
||||
import { AdminVote_getHasilById } from "../../fun/get/get_hasil_by_id";
|
||||
import { AdminVote_getListKontributorById } from "../../fun/get/get_list_kontributor_by_id";
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function AdminVote_Riwayat({
|
||||
dataVote,
|
||||
@@ -98,10 +100,10 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>{e?.Author?.username}</Center>
|
||||
<Center c={AccentColor.white}>{e?.Author?.username}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>{e?.title}</Center>
|
||||
<Center c={AccentColor.white}>{e?.title}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
@@ -119,18 +121,18 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
||||
<Stack>
|
||||
{e?.Voting_DaftarNamaVote.map((v) => (
|
||||
<Box key={v?.id}>
|
||||
<Text>- {v?.value}</Text>
|
||||
<Text c={AccentColor.white}>- {v?.value}</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</th>
|
||||
<td>
|
||||
<Center>
|
||||
<Center c={AccentColor.white}>
|
||||
{e?.awalVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Center c={AccentColor.white}>
|
||||
{e?.akhirVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
@@ -143,7 +145,7 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
||||
{/* <pre>{JSON.stringify(listUser, null, 2)}</pre> */}
|
||||
<ComponentAdminGlobal_TitlePage
|
||||
name="Riwayat"
|
||||
color="gray.4"
|
||||
color={AdminColor.softBlue}
|
||||
component={
|
||||
<TextInput
|
||||
icon={<IconSearch size={20} />}
|
||||
@@ -172,38 +174,37 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
||||
/>
|
||||
</Group> */}
|
||||
|
||||
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||
<Paper p={"md"} bg={AdminColor.softBlue} shadow="lg" h={"80vh"}>
|
||||
<ScrollArea w={"100%"} h={"90%"}>
|
||||
<Table
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"md"}
|
||||
p={"md"}
|
||||
w={1500}
|
||||
striped
|
||||
highlightOnHover
|
||||
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
<Center c={AccentColor.white}>Aksi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Username</Center>
|
||||
<Center c={AccentColor.white}>Username</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
<Center c={AccentColor.white}>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
<Center c={AccentColor.white}>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Pilihan</Center>
|
||||
<Center c={AccentColor.white}>Pilihan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Mulai Vote</Center>
|
||||
<Center c={AccentColor.white}>Mulai Vote</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Selesai Vote</Center>
|
||||
<Center c={AccentColor.white}>Selesai Vote</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -28,7 +28,7 @@ import { AdminVote_getListKontributorById } from "../../fun/get/get_list_kontrib
|
||||
import { adminVote_funGetListPublish } from "../../fun/get/status/get_list_publish";
|
||||
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
|
||||
import { MainColor } from "@/app_modules/_global/color";
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { AccentColor, AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function AdminVote_TablePublish({
|
||||
dataVote,
|
||||
@@ -101,10 +101,10 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>{e?.Author?.username}</Center>
|
||||
<Center c={AccentColor.white}>{e?.Author?.username}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>{e?.title}</Center>
|
||||
<Center c={AccentColor.white}>{e?.title}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
@@ -122,18 +122,18 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
||||
<Stack>
|
||||
{e?.Voting_DaftarNamaVote.map((v) => (
|
||||
<Box key={v?.id}>
|
||||
<Text>- {v?.value}</Text>
|
||||
<Text c={AccentColor.white}>- {v?.value}</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</th>
|
||||
<td>
|
||||
<Center>
|
||||
<Center c={AccentColor.white}>
|
||||
{e?.awalVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Center c={AccentColor.white}>
|
||||
{e?.akhirVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
@@ -146,7 +146,7 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
||||
{/* <pre>{JSON.stringify(listUser, null, 2)}</pre> */}
|
||||
<ComponentAdminGlobal_TitlePage
|
||||
name="Publish"
|
||||
color={AdminColor.green}
|
||||
color={AdminColor.softBlue}
|
||||
component={
|
||||
<TextInput
|
||||
icon={<IconSearch size={20} />}
|
||||
@@ -175,38 +175,36 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
||||
/>
|
||||
</Group> */}
|
||||
|
||||
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||
<Paper p={"md"} bg={AdminColor.softBlue} shadow="lg" h={"80vh"}>
|
||||
<ScrollArea w={"100%"} h={"90%"}>
|
||||
<Table
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"md"}
|
||||
p={"md"}
|
||||
w={1500}
|
||||
striped
|
||||
highlightOnHover
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
<Center c={AccentColor.white}>Aksi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Username</Center>
|
||||
<Center c={AccentColor.white}>Username</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
<Center c={AccentColor.white}>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
<Center c={AccentColor.white}>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Pilihan</Center>
|
||||
<Center c={AccentColor.white}>Pilihan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Mulai Vote</Center>
|
||||
<Center c={AccentColor.white}>Mulai Vote</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Selesai Vote</Center>
|
||||
<Center c={AccentColor.white}>Selesai Vote</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -29,7 +29,7 @@ import { adminVote_funGetListReject } from "../../fun";
|
||||
import { AdminVote_funEditCatatanRejectById } from "../../fun/edit/fun_edit_catatan_reject_by_id";
|
||||
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
|
||||
import { MainColor } from "@/app_modules/_global/color";
|
||||
import { AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { AccentColor, AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function AdminVote_TableReject({ dataVote }: { dataVote: any }) {
|
||||
return (
|
||||
@@ -109,7 +109,7 @@ function TableStatus({ listData }: { listData: any }) {
|
||||
setCatatan(e.catatan);
|
||||
}}
|
||||
>
|
||||
<Stack spacing={0}>
|
||||
<Stack c={AccentColor.white} spacing={0}>
|
||||
<Text fz={10}>Tambah</Text>
|
||||
<Text fz={10}>Catatan</Text>
|
||||
</Stack>
|
||||
@@ -129,10 +129,10 @@ function TableStatus({ listData }: { listData: any }) {
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>{e?.Author?.Profile?.name}</Center>
|
||||
<Center c={AccentColor.white}>{e?.Author?.Profile?.name}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>{e.title}</Center>
|
||||
<Center c={AccentColor.white}>{e.title}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
@@ -150,18 +150,18 @@ function TableStatus({ listData }: { listData: any }) {
|
||||
<Stack>
|
||||
{e.Voting_DaftarNamaVote.map((v) => (
|
||||
<Box key={v.id}>
|
||||
<Text>- {v.value}</Text>
|
||||
<Text c={AccentColor.white}>- {v.value}</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</th>
|
||||
<td>
|
||||
<Center>
|
||||
<Center c={AccentColor.white}>
|
||||
{e.awalVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Center c={AccentColor.white}>
|
||||
{e.akhirVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
@@ -174,7 +174,7 @@ function TableStatus({ listData }: { listData: any }) {
|
||||
{/* <pre>{JSON.stringify(listUser, null, 2)}</pre> */}
|
||||
<ComponentAdminGlobal_TitlePage
|
||||
name="Reject"
|
||||
color={AdminColor.red}
|
||||
color={AdminColor.softBlue}
|
||||
component={
|
||||
<TextInput
|
||||
icon={<IconSearch size={20} />}
|
||||
@@ -203,41 +203,40 @@ function TableStatus({ listData }: { listData: any }) {
|
||||
/>
|
||||
</Group> */}
|
||||
|
||||
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||
<Paper p={"md"} bg={AdminColor.softBlue} shadow="lg" h={"80vh"}>
|
||||
<ScrollArea w={"100%"} h={"90%"}>
|
||||
<Table
|
||||
verticalSpacing={"md"}
|
||||
horizontalSpacing={"md"}
|
||||
p={"md"}
|
||||
w={1500}
|
||||
striped
|
||||
highlightOnHover
|
||||
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
<Center c={AccentColor.white}>Aksi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Catatan</Center>
|
||||
<Center c={AccentColor.white}>Catatan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Author</Center>
|
||||
<Center c={AccentColor.white}>Author</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
<Center c={AccentColor.white}>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
<Center c={AccentColor.white}>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Pilihan</Center>
|
||||
<Center c={AccentColor.white}>Pilihan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Mulai Vote</Center>
|
||||
<Center c={AccentColor.white}>Mulai Vote</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Selesai Vote</Center>
|
||||
<Center c={AccentColor.white}>Selesai Vote</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -123,10 +123,10 @@ function TableStatus({ listData }: { listData: any }) {
|
||||
const TableRows = data.map((e, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<Center>{e?.Author?.username}</Center>
|
||||
<Center c={AccentColor.white}>{e?.Author?.username}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>{e.title}</Center>
|
||||
<Center c={AccentColor.white}>{e.title}</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
@@ -144,18 +144,18 @@ function TableStatus({ listData }: { listData: any }) {
|
||||
<Stack>
|
||||
{e.Voting_DaftarNamaVote.map((v) => (
|
||||
<Box key={v.id}>
|
||||
<Text>- {v.value}</Text>
|
||||
<Text c={AccentColor.white}>- {v.value}</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</th>
|
||||
<td>
|
||||
<Center>
|
||||
<Center c={AccentColor.white}>
|
||||
{e.awalVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
<td>
|
||||
<Center>
|
||||
<Center c={AccentColor.white}>
|
||||
{e.akhirVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
|
||||
</Center>
|
||||
</td>
|
||||
@@ -212,7 +212,7 @@ function TableStatus({ listData }: { listData: any }) {
|
||||
{/* <pre>{JSON.stringify(listUser, null, 2)}</pre> */}
|
||||
<ComponentAdminGlobal_TitlePage
|
||||
name="Review"
|
||||
color={AdminColor.orange}
|
||||
color={AdminColor.softBlue}
|
||||
component={
|
||||
<TextInput
|
||||
icon={<IconSearch size={20} />}
|
||||
@@ -241,7 +241,7 @@ function TableStatus({ listData }: { listData: any }) {
|
||||
/>
|
||||
</Group> */}
|
||||
|
||||
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||
<Paper p={"md"} bg={AdminColor.softBlue} shadow="lg" h={"80vh"}>
|
||||
{isShowReload && (
|
||||
<Affix position={{ top: rem(200) }} w={"100%"}>
|
||||
<Center>
|
||||
@@ -270,32 +270,31 @@ function TableStatus({ listData }: { listData: any }) {
|
||||
horizontalSpacing={"md"}
|
||||
p={"md"}
|
||||
w={1500}
|
||||
striped
|
||||
highlightOnHover
|
||||
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Center>Username</Center>
|
||||
<Center c={AccentColor.white}>Username</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Judul</Center>
|
||||
<Center c={AccentColor.white}>Judul</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Deskripsi</Center>
|
||||
<Center c={AccentColor.white}>Deskripsi</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Pilihan</Center>
|
||||
<Center c={AccentColor.white}>Pilihan</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Mulai Vote</Center>
|
||||
<Center c={AccentColor.white}>Mulai Vote</Center>
|
||||
</th>
|
||||
<th>
|
||||
<Center>Selesai Vote</Center>
|
||||
<Center c={AccentColor.white}>Selesai Vote</Center>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
<Center>Aksi</Center>
|
||||
<Center c={AccentColor.white}>Aksi</Center>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { Stack, SimpleGrid, Paper, Group, Title, Text } from "@mantine/core";
|
||||
import { Stack, SimpleGrid, Paper, Group, Title, Text, Flex, ThemeIcon } from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||
import { IconAlertTriangle, IconBookmark, IconHistory, IconUpload } from "@tabler/icons-react";
|
||||
import { AccentColor, AdminColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function AdminVote_Main({
|
||||
countPublish,
|
||||
@@ -25,18 +27,21 @@ export default function AdminVote_Main({
|
||||
name: "Publish",
|
||||
jumlah: countPublish,
|
||||
color: "green",
|
||||
icon: <IconUpload size={18} color="#4CAF4F"/>
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "Review",
|
||||
jumlah: countReview,
|
||||
color: "orange",
|
||||
icon: <IconBookmark size={18} color="#FF7043" />
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Reject",
|
||||
jumlah: countReject,
|
||||
color: "red",
|
||||
icon: <IconAlertTriangle size={18} color="#FF4B4C" />
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
@@ -44,6 +49,7 @@ export default function AdminVote_Main({
|
||||
jumlah: countDraft,
|
||||
path: "",
|
||||
color: "gray",
|
||||
icon: <IconHistory size={18} color="#007CBA" />
|
||||
},
|
||||
];
|
||||
|
||||
@@ -64,22 +70,31 @@ export default function AdminVote_Main({
|
||||
{listStatus.map((e, i) => (
|
||||
<Paper
|
||||
key={i}
|
||||
bg={`${e.color}.2`}
|
||||
bg={AdminColor.softBlue}
|
||||
shadow="md"
|
||||
radius="md"
|
||||
p="md"
|
||||
// sx={{ borderColor: e.color, borderStyle: "solid" }}
|
||||
// sx={{ borderColor: e.color, borderStyle: "solid" }}
|
||||
>
|
||||
<Group position="center">
|
||||
<Stack align="center" spacing={0}>
|
||||
<Text>{e.name}</Text>
|
||||
<Title>{e.jumlah ? e.jumlah : 0}</Title>
|
||||
</Stack>
|
||||
</Group>
|
||||
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"} c={AccentColor.white}>{e.name}</Text>
|
||||
<Flex align={"center"} justify={"space-between"}>
|
||||
<Title color={AccentColor.white}>{e.jumlah ? e.jumlah : 0}</Title>
|
||||
<ThemeIcon
|
||||
radius={"xl"}
|
||||
size={"md"}
|
||||
color={AccentColor.white}
|
||||
>
|
||||
{e.icon}
|
||||
</ThemeIcon>
|
||||
</Flex>
|
||||
</Stack>
|
||||
|
||||
</Paper>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
|
||||
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user