QC Voting

- # fix
- Beranda dan mandatori input
## No issuee
This commit is contained in:
2024-05-21 15:24:37 +08:00
parent dbeb740d1f
commit ce35aa8f51
32 changed files with 568 additions and 234 deletions

View File

@@ -19,7 +19,7 @@ import {
Title,
rem,
} from "@mantine/core";
import { IconCirclePlus } from "@tabler/icons-react";
import { IconCirclePlus, IconPencilPlus } from "@tabler/icons-react";
import moment from "moment";
import { useRouter } from "next/navigation";
import ComponentVote_CardViewPublish from "../component/card_view_publish";
@@ -27,6 +27,8 @@ import { MODEL_VOTING } from "../model/interface";
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
import _ from "lodash";
import ComponentVote_IsEmptyData from "../component/is_empty_data";
import { useState } from "react";
import { useWindowScroll } from "@mantine/hooks";
export default function Vote_Beranda({
dataVote,
@@ -34,25 +36,33 @@ export default function Vote_Beranda({
dataVote: MODEL_VOTING[];
}) {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
const [scroll, scrollTo] = useWindowScroll();
return (
<>
<Affix position={{ bottom: rem(150), right: rem(30) }}>
<ActionIcon
loading={isLoading ? true : false}
opacity={scroll.y > 0 ? 0.5 : ""}
style={{
transition: "0.5s",
}}
size={"xl"}
radius={"xl"}
variant="transparent"
bg={"blue"}
onClick={() => {
setIsLoading(true);
router.push(RouterVote.create);
}}
>
<IconCirclePlus color="white" size={40} />
<IconPencilPlus color="white" />
</ActionIcon>
</Affix>
{_.isEmpty(dataVote) ? (
<ComponentVote_IsEmptyData text="Tidak ada data"/>
<ComponentVote_IsEmptyData text="Tidak ada data" />
) : (
<Stack>
{dataVote.map((e, i) => (