#style:
- UI Event - Perbaiki create button ke beberapa app ## No Issuee
This commit is contained in:
@@ -118,13 +118,9 @@ export default function ComponentVote_CardViewPublish({
|
||||
<Text>{v.value}</Text>
|
||||
<Text>{v.jumlah}</Text>
|
||||
</Group>
|
||||
<Progress
|
||||
size={"xl"}
|
||||
radius={"xl"}
|
||||
value={v.jumlah}
|
||||
color="yellow"
|
||||
/>
|
||||
<Progress size={"xl"} radius={"xl"} value={v.jumlah} color="yellow" />
|
||||
</Stack>
|
||||
|
||||
))}
|
||||
</Stack>
|
||||
) : (
|
||||
|
||||
@@ -1,28 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import {
|
||||
ActionIcon,
|
||||
Affix,
|
||||
Box,
|
||||
Center,
|
||||
Loader,
|
||||
Stack,
|
||||
rem,
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect, useWindowScroll } from "@mantine/hooks";
|
||||
import { IconPencilPlus } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import ComponentVote_CardViewPublish from "../component/card_view_publish";
|
||||
import ComponentVote_IsEmptyData from "../component/is_empty_data";
|
||||
import { vote_getAllListPublish } from "../fun/get/get_all_list_publish";
|
||||
import { MODEL_VOTING } from "../model/interface";
|
||||
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import job_getAllStatusPublish from "@/app_modules/job/fun/get/status/get_list_publish";
|
||||
import { Box, Center, Loader } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import _ from "lodash";
|
||||
import { ScrollOnly } from "next-scroll-loader";
|
||||
import { useState } from "react";
|
||||
import ComponentVote_CardViewPublish from "../component/card_view_publish";
|
||||
import { vote_getAllListPublish } from "../fun/get/get_all_list_publish";
|
||||
import { MODEL_VOTING } from "../model/interface";
|
||||
|
||||
export default function Vote_Beranda({
|
||||
dataVote,
|
||||
@@ -30,6 +18,7 @@ export default function Vote_Beranda({
|
||||
dataVote: MODEL_VOTING[];
|
||||
}) {
|
||||
const [data, setData] = useState(dataVote);
|
||||
const [activePage, setActivePage] = useState(1);
|
||||
|
||||
useShallowEffect(() => {
|
||||
onLoad({
|
||||
@@ -44,42 +33,44 @@ export default function Vote_Beranda({
|
||||
setData(loadData);
|
||||
}
|
||||
|
||||
const [activePage, setActivePage] = useState(1);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box>
|
||||
<ComponentGlobal_CreateButton path={RouterVote.create} />
|
||||
|
||||
{_.isEmpty(data) ? (
|
||||
<ComponentGlobal_IsEmptyData />
|
||||
) : (
|
||||
<Box>
|
||||
<ScrollOnly
|
||||
height="82vh"
|
||||
renderLoading={() => (
|
||||
<Center mt={"lg"}>
|
||||
<Loader color={"yellow"} />
|
||||
</Center>
|
||||
)}
|
||||
data={data}
|
||||
setData={setData}
|
||||
moreData={async () => {
|
||||
const loadData = await vote_getAllListPublish({
|
||||
page: activePage + 1,
|
||||
});
|
||||
|
||||
setActivePage((val) => val + 1);
|
||||
|
||||
return loadData;
|
||||
}}
|
||||
>
|
||||
{(item) => (
|
||||
<ComponentVote_CardViewPublish
|
||||
data={item}
|
||||
path={RouterVote.main_detail}
|
||||
authorName={true}
|
||||
/>
|
||||
)}
|
||||
</ScrollOnly>
|
||||
</Box>
|
||||
// --- Main component --- //
|
||||
<ScrollOnly
|
||||
height="82vh"
|
||||
renderLoading={() => (
|
||||
<Center mt={"lg"}>
|
||||
<Loader color={"yellow"} />
|
||||
</Center>
|
||||
)}
|
||||
data={data}
|
||||
setData={setData}
|
||||
moreData={async () => {
|
||||
const loadData = await vote_getAllListPublish({
|
||||
page: activePage + 1,
|
||||
});
|
||||
|
||||
setActivePage((val) => val + 1);
|
||||
|
||||
return loadData;
|
||||
}}
|
||||
>
|
||||
{(item) => (
|
||||
<ComponentVote_CardViewPublish
|
||||
data={item}
|
||||
path={RouterVote.main_detail}
|
||||
authorName={true}
|
||||
/>
|
||||
)}
|
||||
</ScrollOnly>
|
||||
)}
|
||||
</>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,33 +1,22 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
ActionIcon,
|
||||
AppShell,
|
||||
Center,
|
||||
Footer,
|
||||
Grid,
|
||||
SimpleGrid,
|
||||
Stack,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import React, { useState } from "react";
|
||||
import ComponentVote_HeaderTamplate from "../component/header_tamplate";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
||||
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { ActionIcon, SimpleGrid, Stack, Text } from "@mantine/core";
|
||||
import {
|
||||
IconClick,
|
||||
IconHistory,
|
||||
IconHome,
|
||||
IconReservedLine,
|
||||
} from "@tabler/icons-react";
|
||||
import { gs_vote_hotMenu } from "../global_state";
|
||||
import { useAtom } from "jotai";
|
||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
import { gs_vote_hotMenu } from "../global_state";
|
||||
|
||||
export default function LayoutVote_Main({
|
||||
children,
|
||||
@@ -75,7 +64,7 @@ export default function LayoutVote_Main({
|
||||
/>
|
||||
}
|
||||
footer={
|
||||
<SimpleGrid cols={4} h={"9vh"} mx={"xs"} >
|
||||
<SimpleGrid cols={4} h={"9vh"} mx={"xs"}>
|
||||
{listFooter.map((e, i) => (
|
||||
<Stack key={i} align="center" justify="center" spacing={0}>
|
||||
<ActionIcon
|
||||
@@ -100,40 +89,9 @@ export default function LayoutVote_Main({
|
||||
</Stack>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
// <Footer
|
||||
// height={"10vh"}
|
||||
// bg={"dark"}
|
||||
// sx={{ borderTop: "px solid blue" }}
|
||||
// >
|
||||
// <Stack h={"100%"} justify="center">
|
||||
// <Grid>
|
||||
// {listFooter.map((e, i) => (
|
||||
// <Grid.Col key={e.id} span={"auto"} pt={"md"}>
|
||||
// <Center
|
||||
// onClick={() => {
|
||||
// router.replace(e.path);
|
||||
// setHotMenu(i);
|
||||
// }}
|
||||
// >
|
||||
// <Stack align="center" spacing={0}>
|
||||
// <ActionIcon
|
||||
// variant="transparent"
|
||||
// c={hotMenu === i ? "blue" : "white"}
|
||||
// >
|
||||
// {e.icon}
|
||||
// </ActionIcon>
|
||||
// <Text fz={10} c={hotMenu === i ? "blue" : "white"}>
|
||||
// {e.name}
|
||||
// </Text>
|
||||
// </Stack>
|
||||
// </Center>
|
||||
// </Grid.Col>
|
||||
// ))}
|
||||
// </Grid>
|
||||
// </Stack>
|
||||
// </Footer>
|
||||
}
|
||||
>
|
||||
|
||||
{children}
|
||||
</UIGlobal_LayoutTamplate>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user