fix event
deskripsi: - mengubah tampilan text biasa ke html view - menambahkan text editor pada create & edit
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
export const MainColor = {
|
export const MainColor = {
|
||||||
black: "#202020",
|
black: "#202020",
|
||||||
darkblue: "#001D3D",
|
darkblue: "#001D3D",
|
||||||
soft_darkblue: "#17406E",
|
soft_darkblue: "#0e3763",
|
||||||
yellow: "#E1B525",
|
yellow: "#E1B525",
|
||||||
white: "#D4D0D0",
|
white: "#D4D0D0",
|
||||||
red: "#FF4B4C",
|
red: "#FF4B4C",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Center, Grid, Group, Paper, Stack, Text, Title } from "@mantine/core";
|
import { Grid, Stack, Text } from "@mantine/core";
|
||||||
import { AccentColor, MainColor } from "../color/color_pallet";
|
|
||||||
import { IconInfoCircle } from "@tabler/icons-react";
|
import { IconInfoCircle } from "@tabler/icons-react";
|
||||||
|
import { MainColor } from "../color/color_pallet";
|
||||||
|
import { ComponentGlobal_CardStyles } from "./comp_card_box_and_background";
|
||||||
|
|
||||||
export default function ComponentGlobal_BoxInformation({
|
export default function ComponentGlobal_BoxInformation({
|
||||||
informasi,
|
informasi,
|
||||||
@@ -13,15 +14,7 @@ export default function ComponentGlobal_BoxInformation({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Paper
|
<ComponentGlobal_CardStyles>
|
||||||
bg={"blue.3"}
|
|
||||||
p={10}
|
|
||||||
style={{
|
|
||||||
backgroundColor: AccentColor.blue,
|
|
||||||
border: `2px solid ${AccentColor.softblue}`,
|
|
||||||
borderRadius: "10px",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{isReport ? (
|
{isReport ? (
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text
|
<Text
|
||||||
@@ -54,7 +47,7 @@ export default function ComponentGlobal_BoxInformation({
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
</Paper>
|
</ComponentGlobal_CardStyles>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { MainColor } from "@/app_modules/_global/color";
|
||||||
|
import { Grid, Paper, Text } from "@mantine/core";
|
||||||
|
|
||||||
|
export function Component_V3_GridDetailData({
|
||||||
|
item,
|
||||||
|
}: {
|
||||||
|
item: Record<string, any>;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Paper
|
||||||
|
bg={MainColor.soft_darkblue}
|
||||||
|
style={{
|
||||||
|
color: MainColor.white,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Grid m={0}>
|
||||||
|
<Grid.Col lg={3} md={3} sm={3} xs={3} span={4}>
|
||||||
|
<Text fw={"bold"}>{item.title || item.label}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Text>{item.value}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Paper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import { Text } from "@mantine/core";
|
||||||
|
import moment from "moment";
|
||||||
|
import "moment/locale/id";
|
||||||
|
import { MainColor } from "../../color/color_pallet";
|
||||||
|
|
||||||
|
export const Component_V3_MomentDateAndTime = ({
|
||||||
|
dateTime,
|
||||||
|
color,
|
||||||
|
}: {
|
||||||
|
dateTime: Date | string | undefined
|
||||||
|
color?: string;
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Text c={color ?? MainColor.white}>
|
||||||
|
{dateTime
|
||||||
|
? moment(
|
||||||
|
dateTime.toLocaleString("id-ID", {
|
||||||
|
dateStyle: "full",
|
||||||
|
})
|
||||||
|
).format("dddd, DD MMMM YYYY, LT")
|
||||||
|
: "-"}
|
||||||
|
</Text>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -12,13 +12,9 @@ const ReactQuill = dynamic(() => import("react-quill"), { ssr: false });
|
|||||||
export function Component_V3_TextEditor({
|
export function Component_V3_TextEditor({
|
||||||
data,
|
data,
|
||||||
onSetData,
|
onSetData,
|
||||||
// lengthData,
|
|
||||||
onSetLengthData,
|
|
||||||
}: {
|
}: {
|
||||||
data: string;
|
data: string;
|
||||||
onSetData: (value: string) => void;
|
onSetData: (value: string) => void;
|
||||||
// lengthData: number;
|
|
||||||
onSetLengthData: (value: number) => void;
|
|
||||||
}) {
|
}) {
|
||||||
const [isReady, setIsReady] = useState<boolean>(false);
|
const [isReady, setIsReady] = useState<boolean>(false);
|
||||||
|
|
||||||
@@ -31,14 +27,13 @@ export function Component_V3_TextEditor({
|
|||||||
// if (text.length <= maxInputLength) {
|
// if (text.length <= maxInputLength) {
|
||||||
// }
|
// }
|
||||||
onSetData(input);
|
onSetData(input);
|
||||||
onSetLengthData(text.length);
|
|
||||||
// Input diabaikan jika panjang > maxLength
|
// Input diabaikan jika panjang > maxLength
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isReady ? (
|
{isReady ? (
|
||||||
<Paper p="sm" withBorder shadow="lg" mah={300} bg={MainColor.white} >
|
<Paper p={5} withBorder shadow="lg" mah={300} bg={MainColor.white} >
|
||||||
<ScrollArea h={280}>
|
<ScrollArea h={280}>
|
||||||
<ReactQuill
|
<ReactQuill
|
||||||
placeholder="Apa yang sedang ingin dibahas ?"
|
placeholder="Apa yang sedang ingin dibahas ?"
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import React from "react";
|
|
||||||
import { MainColor } from "../../color";
|
import { MainColor } from "../../color";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
|
||||||
|
|
||||||
export function Comp_DangerouslySetInnerHTML({
|
export function Comp_DangerouslySetInnerHTML({
|
||||||
props,
|
props,
|
||||||
@@ -9,23 +7,6 @@ export function Comp_DangerouslySetInnerHTML({
|
|||||||
props: string;
|
props: string;
|
||||||
color?: string;
|
color?: string;
|
||||||
}) {
|
}) {
|
||||||
// useShallowEffect(() => {
|
|
||||||
// // Add custom style for stickers inside Quill editor
|
|
||||||
// const style = document.createElement("style");
|
|
||||||
// style.textContent = `
|
|
||||||
// .chat-content img {
|
|
||||||
// max-width: 100px !important;
|
|
||||||
// max-height: 100px !important;
|
|
||||||
// }
|
|
||||||
// `;
|
|
||||||
// document.head.appendChild(style);
|
|
||||||
|
|
||||||
// return () => {
|
|
||||||
// // Clean up when component unmounts
|
|
||||||
// document.head.removeChild(style);
|
|
||||||
// };
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export {
|
|||||||
|
|
||||||
const modulesReactQuill = {
|
const modulesReactQuill = {
|
||||||
toolbar: [
|
toolbar: [
|
||||||
[{ header: [1, 2, false] }],
|
[{ header: [1, 2, 3, 4, 5, 6, false] }],
|
||||||
["bold", "italic", "underline", "strike", "blockquote"],
|
["bold", "italic", "underline", "strike", "blockquote"],
|
||||||
[{ list: "ordered" }, { list: "bullet" }],
|
[{ list: "ordered" }, { list: "bullet" }],
|
||||||
["link"],
|
["link"],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { MainColor } from "@/app_modules/_global/color";
|
import { MainColor } from "@/app_modules/_global/color";
|
||||||
import { Grid, Text } from "@mantine/core";
|
import { Grid, Paper, Text } from "@mantine/core";
|
||||||
|
|
||||||
export function Admin_V3_ComponentDetail({
|
export function Admin_V3_ComponentDetail({
|
||||||
item,
|
item,
|
||||||
@@ -8,17 +8,22 @@ export function Admin_V3_ComponentDetail({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Grid m={0} bg={MainColor.soft_darkblue}>
|
<Paper
|
||||||
<Grid.Col lg={3} md={3} sm={3} xs={3} span={4}>
|
bg={MainColor.soft_darkblue}
|
||||||
<Text fw={"bold"}>{item.title || item.label}</Text>
|
style={{
|
||||||
</Grid.Col>
|
color: MainColor.white,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Grid m={0}>
|
||||||
|
<Grid.Col lg={3} md={3} sm={3} xs={3} span={4}>
|
||||||
|
<Text fw={"bold"}>{item.title || item.label}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
|
||||||
<Grid.Col span={"auto"}>
|
<Grid.Col span={"auto"}>
|
||||||
<Text>
|
<Text>{item.value}</Text>
|
||||||
{item.value}
|
</Grid.Col>
|
||||||
</Text>
|
</Grid>
|
||||||
</Grid.Col>
|
</Paper>
|
||||||
</Grid>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import {
|
import {
|
||||||
ComponentGlobal_CardLoadingOverlay,
|
ComponentGlobal_CardLoadingOverlay,
|
||||||
ComponentGlobal_CardStyles,
|
ComponentGlobal_CardStyles,
|
||||||
} from "@/app_modules/_global/component";
|
} from "@/app_modules/_global/component";
|
||||||
import { Card, Group, Stack, Text, Title } from "@mantine/core";
|
import { Group, Stack, Text, Title } from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { MODEL_EVENT } from "../_lib/interface";
|
import { MODEL_EVENT } from "../_lib/interface";
|
||||||
|
import { Comp_DangerouslySetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
|
||||||
|
|
||||||
export default function ComponentEvent_BoxListStatus({
|
export default function ComponentEvent_BoxListStatus({
|
||||||
data,
|
data,
|
||||||
@@ -44,7 +45,7 @@ export default function ComponentEvent_BoxListStatus({
|
|||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Text c={MainColor.white} fz={"sm"} lineClamp={2}>
|
<Text c={MainColor.white} fz={"sm"} lineClamp={2}>
|
||||||
{data.deskripsi}
|
<Comp_DangerouslySetInnerHTML props={data.deskripsi} />
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
{visible && eventId !== "" ? (
|
{visible && eventId !== "" ? (
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import { WibuRealtime } from "wibu-pkg";
|
|||||||
import { Event_funCreate } from "../../fun/create/fun_create";
|
import { Event_funCreate } from "../../fun/create/fun_create";
|
||||||
import { gs_event_hotMenu } from "../../global_state";
|
import { gs_event_hotMenu } from "../../global_state";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
|
import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
|
||||||
|
import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
|
||||||
|
|
||||||
export default function Event_ComponentCreateButton({
|
export default function Event_ComponentCreateButton({
|
||||||
value,
|
value,
|
||||||
@@ -82,14 +84,16 @@ export default function Event_ComponentCreateButton({
|
|||||||
disabled={
|
disabled={
|
||||||
value.title === "" ||
|
value.title === "" ||
|
||||||
value.lokasi === "" ||
|
value.lokasi === "" ||
|
||||||
value.deskripsi === "" ||
|
|
||||||
value.eventMaster_TipeAcaraId === 0 ||
|
value.eventMaster_TipeAcaraId === 0 ||
|
||||||
value.tanggal === "function Date() { [native code] }" ||
|
value.tanggal === "function Date() { [native code] }" ||
|
||||||
// moment(value.tanggal).diff(moment(), "minutes") < 0
|
// moment(value.tanggal).diff(moment(), "minutes") < 0
|
||||||
diffTimeEnd - 1 < diffTimeStart
|
diffTimeEnd - 1 < diffTimeStart ||
|
||||||
|
// value.deskripsi === "" ||
|
||||||
|
funReplaceHtml({ html: value.deskripsi }).length > maxInputLength ||
|
||||||
|
funReplaceHtml({ html: value.deskripsi }).length === 0
|
||||||
}
|
}
|
||||||
loaderPosition="center"
|
loaderPosition="center"
|
||||||
loading={isLoading ? true : false}
|
loading={isLoading}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
mt={"xl"}
|
mt={"xl"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { Admin_V3_ComponentBreakpoint } from "@/app_modules/admin/_components_v3/comp_simple_grid_breakpoint";
|
||||||
|
import Event_ComponentBoxDaftarPeserta from "../detail/comp_box_daftar_peserta";
|
||||||
|
import Event_ComponentBoxDaftarSponsor from "../detail/comp_box_sponsor";
|
||||||
|
|
||||||
|
export const Event_ComponentDaftarPesertaDanSponsor = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Admin_V3_ComponentBreakpoint>
|
||||||
|
<Event_ComponentBoxDaftarPeserta />
|
||||||
|
{/* <Event_ComponentBoxDaftarSponsor /> */}
|
||||||
|
</Admin_V3_ComponentBreakpoint>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
import { Box, Group, Stack, Text, Title } from "@mantine/core";
|
import { Box, Group, Stack, Text, Title } from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { Comp_DangerouslySetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
|
||||||
|
|
||||||
export function ComponentEvent_CardBeranda({ data }: { data: any }) {
|
export function ComponentEvent_CardBeranda({ data }: { data: any }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -43,7 +44,7 @@ export function ComponentEvent_CardBeranda({ data }: { data: any }) {
|
|||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Text c={MainColor.white} fz={"sm"} lineClamp={2}>
|
<Text c={MainColor.white} fz={"sm"} lineClamp={2}>
|
||||||
{data.deskripsi}
|
<Comp_DangerouslySetInnerHTML props={data.deskripsi} />
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { MODEL_EVENT } from "../../_lib/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
|
import { Comp_DangerouslySetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
|
||||||
|
|
||||||
export function ComponentEvent_CardRiwayat({ data }: { data: MODEL_EVENT }) {
|
export function ComponentEvent_CardRiwayat({ data }: { data: MODEL_EVENT }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -43,7 +44,7 @@ export function ComponentEvent_CardRiwayat({ data }: { data: MODEL_EVENT }) {
|
|||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Text fz={"sm"} lineClamp={2}>
|
<Text fz={"sm"} lineClamp={2}>
|
||||||
{data.deskripsi}
|
<Comp_DangerouslySetInnerHTML props={data.deskripsi}/>
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,14 @@ import {
|
|||||||
ComponentGlobal_BoxInformation,
|
ComponentGlobal_BoxInformation,
|
||||||
ComponentGlobal_CardStyles,
|
ComponentGlobal_CardStyles,
|
||||||
} from "@/app_modules/_global/component";
|
} from "@/app_modules/_global/component";
|
||||||
import { Grid, SimpleGrid, Stack, Text, Title } from "@mantine/core";
|
import { Comp_DangerouslySetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
|
||||||
|
import { Component_V3_GridDetailData } from "@/app_modules/_global/component/new/comp_V3_grid_detail_data";
|
||||||
|
import { Component_V3_MomentDateAndTime } from "@/app_modules/_global/component/new/comp_V3_moment_date_and_time";
|
||||||
|
import { SimpleGrid, Stack, Title } from "@mantine/core";
|
||||||
|
import "moment/locale/id";
|
||||||
import { MODEL_EVENT } from "../../_lib/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
import { Event_ComponentSkeletonDetail } from "../skeleton/comp_skeleton_detail";
|
import { Event_ComponentSkeletonDetail } from "../skeleton/comp_skeleton_detail";
|
||||||
import Event_ComponentBoxDaftarPeserta from "./comp_box_daftar_peserta";
|
import Event_ComponentBoxDaftarPeserta from "./comp_box_daftar_peserta";
|
||||||
import Event_ComponentBoxDaftarSponsor from "./comp_box_sponsor";
|
|
||||||
|
|
||||||
export default function ComponentEvent_DetailData({
|
export default function ComponentEvent_DetailData({
|
||||||
isDaftarPeserta,
|
isDaftarPeserta,
|
||||||
isReport,
|
isReport,
|
||||||
@@ -20,114 +22,61 @@ export default function ComponentEvent_DetailData({
|
|||||||
isReport?: boolean;
|
isReport?: boolean;
|
||||||
data: MODEL_EVENT | null;
|
data: MODEL_EVENT | null;
|
||||||
}) {
|
}) {
|
||||||
|
const listData = [
|
||||||
|
{
|
||||||
|
title: "Lokasi",
|
||||||
|
value: data?.lokasi ?? "-",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Tipe Acara",
|
||||||
|
value: `${data?.EventMaster_TipeAcara?.name}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Tanggal Mulai ",
|
||||||
|
value: <Component_V3_MomentDateAndTime dateTime={data?.tanggal} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Tanggal Selesai ",
|
||||||
|
value: <Component_V3_MomentDateAndTime dateTime={data?.tanggalSelesai} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Deskripsi",
|
||||||
|
value: <Comp_DangerouslySetInnerHTML props={data?.deskripsi ?? ""} />,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!data ? (
|
{!data ? (
|
||||||
<Event_ComponentSkeletonDetail />
|
<Event_ComponentSkeletonDetail />
|
||||||
) : (
|
) : (
|
||||||
<Stack>
|
<Stack>
|
||||||
{isReport && (
|
{isReport && data.catatan ? (
|
||||||
<ComponentGlobal_BoxInformation
|
<ComponentGlobal_BoxInformation
|
||||||
isReport
|
isReport
|
||||||
informasi={data?.catatan}
|
informasi={data?.catatan}
|
||||||
/>
|
/>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<ComponentGlobal_CardStyles marginBottom={"16px"}>
|
<ComponentGlobal_CardStyles marginBottom={"16px"}>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Stack px={"sm"} spacing={"xl"}>
|
<Stack spacing={"xl"}>
|
||||||
<Title
|
<Title
|
||||||
color={MainColor.white}
|
color={MainColor.white}
|
||||||
lineClamp={2}
|
// lineClamp={2}
|
||||||
align="center"
|
align="center"
|
||||||
w={"100%"}
|
w={"100%"}
|
||||||
order={4}
|
order={4}
|
||||||
>
|
>
|
||||||
{data ? data?.title : null}
|
{data ? data?.title : null}
|
||||||
</Title>
|
</Title>
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={4}>
|
|
||||||
<Text c={MainColor.white} fw={"bold"}>
|
|
||||||
Lokasi
|
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={1}>:</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text c={MainColor.white}>
|
|
||||||
{data ? data?.lokasi : null}
|
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={4}>
|
|
||||||
<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>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Stack spacing={"xs"}>
|
|
||||||
<Text c={MainColor.white} fw={"bold"}>
|
|
||||||
Tanggal & Waktu
|
|
||||||
</Text>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={4}>
|
|
||||||
<Text c={MainColor.white} fw={"bold"}>
|
|
||||||
Mulai
|
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={1}>:</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text c={MainColor.white}>
|
|
||||||
{" "}
|
|
||||||
{new Intl.DateTimeFormat("id-ID", {
|
|
||||||
dateStyle: "full",
|
|
||||||
}).format(new Date(data?.tanggal))}
|
|
||||||
,{" "}
|
|
||||||
<Text span inherit c={MainColor.white}>
|
|
||||||
{new Intl.DateTimeFormat("id-ID", {
|
|
||||||
timeStyle: "short",
|
|
||||||
}).format(new Date(data?.tanggal))}
|
|
||||||
</Text>
|
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={4}>
|
|
||||||
<Text c={MainColor.white} fw={"bold"}>
|
|
||||||
Selesai
|
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={1}>:</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text c={MainColor.white}>
|
|
||||||
{" "}
|
|
||||||
{new Intl.DateTimeFormat("id-ID", {
|
|
||||||
dateStyle: "full",
|
|
||||||
}).format(new Date(data?.tanggalSelesai))}
|
|
||||||
,{" "}
|
|
||||||
<Text span inherit c={MainColor.white}>
|
|
||||||
{new Intl.DateTimeFormat("id-ID", {
|
|
||||||
timeStyle: "short",
|
|
||||||
}).format(new Date(data?.tanggalSelesai))}
|
|
||||||
</Text>
|
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
</Stack>
|
|
||||||
|
|
||||||
<Stack spacing={2}>
|
<Stack>
|
||||||
<Text c={MainColor.white} fw={"bold"}>
|
{listData.map((e, i) => (
|
||||||
Deskripsi
|
<Component_V3_GridDetailData item={e} key={i} />
|
||||||
</Text>
|
))}
|
||||||
<Text c={MainColor.white}>
|
|
||||||
{data ? data?.deskripsi : null}
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
@@ -140,7 +89,7 @@ export default function ComponentEvent_DetailData({
|
|||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Event_ComponentBoxDaftarPeserta />
|
<Event_ComponentBoxDaftarPeserta />
|
||||||
<Event_ComponentBoxDaftarSponsor />
|
{/* <Event_ComponentBoxDaftarSponsor /> */}
|
||||||
</SimpleGrid>
|
</SimpleGrid>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -5,18 +5,19 @@ import {
|
|||||||
ComponentGlobal_AvatarAndUsername,
|
ComponentGlobal_AvatarAndUsername,
|
||||||
ComponentGlobal_CardStyles,
|
ComponentGlobal_CardStyles,
|
||||||
} from "@/app_modules/_global/component";
|
} from "@/app_modules/_global/component";
|
||||||
|
import { Comp_DangerouslySetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
|
||||||
|
import { Component_V3_GridDetailData } from "@/app_modules/_global/component/new/comp_V3_grid_detail_data";
|
||||||
|
import { Component_V3_MomentDateAndTime } from "@/app_modules/_global/component/new/comp_V3_moment_date_and_time";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
import { Grid, SimpleGrid, Stack, Text, Title } from "@mantine/core";
|
import { Stack, Title } from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import moment from "moment";
|
|
||||||
import "moment/locale/id";
|
import "moment/locale/id";
|
||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { apiGetEventDetailById } from "../../_lib/api_event";
|
import { apiGetEventDetailById } from "../../_lib/api_event";
|
||||||
import { MODEL_EVENT } from "../../_lib/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
|
import { Event_ComponentDaftarPesertaDanSponsor } from "../button/comp_daftar_peserta_dan_sponsor";
|
||||||
import { Event_ComponentSkeletonDetail } from "../skeleton/comp_skeleton_detail";
|
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() {
|
export default function ComponentEvent_DetailMainData() {
|
||||||
const params = useParams<{ id: string }>();
|
const params = useParams<{ id: string }>();
|
||||||
@@ -41,13 +42,36 @@ export default function ComponentEvent_DetailMainData() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const listData = [
|
||||||
|
{
|
||||||
|
title: "Lokasi",
|
||||||
|
value: data?.lokasi ?? "-",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Tipe Acara",
|
||||||
|
value: `${data?.EventMaster_TipeAcara?.name}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Tanggal Mulai ",
|
||||||
|
value: <Component_V3_MomentDateAndTime dateTime={data?.tanggal} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Tanggal Selesai ",
|
||||||
|
value: <Component_V3_MomentDateAndTime dateTime={data?.tanggalSelesai} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Deskripsi",
|
||||||
|
value: <Comp_DangerouslySetInnerHTML props={data?.deskripsi ?? ""} />,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{data == null ? (
|
{data == null ? (
|
||||||
<Event_ComponentSkeletonDetail />
|
<Event_ComponentSkeletonDetail />
|
||||||
) : (
|
) : (
|
||||||
<ComponentGlobal_CardStyles>
|
<ComponentGlobal_CardStyles>
|
||||||
<Stack px={"xs"} spacing={"xl"}>
|
<Stack spacing={"xl"}>
|
||||||
<ComponentGlobal_AvatarAndUsername
|
<ComponentGlobal_AvatarAndUsername
|
||||||
profile={data?.Author?.Profile as any}
|
profile={data?.Author?.Profile as any}
|
||||||
/>
|
/>
|
||||||
@@ -56,87 +80,12 @@ export default function ComponentEvent_DetailMainData() {
|
|||||||
<Title color={MainColor.white} align="center" order={4}>
|
<Title color={MainColor.white} align="center" order={4}>
|
||||||
{data ? data.title : null}
|
{data ? data.title : null}
|
||||||
</Title>
|
</Title>
|
||||||
<Grid>
|
<Stack>
|
||||||
<Grid.Col span={4}>
|
{listData.map((e, i) => (
|
||||||
<Text c={MainColor.white} fw={"bold"}>
|
<Component_V3_GridDetailData item={e} key={i} />
|
||||||
Lokasi
|
))}
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={1}>:</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text c={MainColor.white}>{data ? data.lokasi : null}</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={4}>
|
|
||||||
<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>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Stack spacing={"xs"}>
|
|
||||||
<Text c={MainColor.white} fw={"bold"}>
|
|
||||||
Tanggal & Waktu
|
|
||||||
</Text>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={4}>
|
|
||||||
<Text c={MainColor.white} fw={"bold"}>
|
|
||||||
Mulai
|
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={1}>:</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text c={MainColor.white}>
|
|
||||||
{moment(
|
|
||||||
data.tanggal?.toLocaleString("id-ID", {
|
|
||||||
dateStyle: "full",
|
|
||||||
})
|
|
||||||
).format("dddd, DD MMMM YYYY, LT")}
|
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={4}>
|
|
||||||
<Text c={MainColor.white} fw={"bold"}>
|
|
||||||
Selesai
|
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={1}>:</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text c={MainColor.white}>
|
|
||||||
{moment(
|
|
||||||
data.tanggalSelesai?.toLocaleString("id-ID", {
|
|
||||||
dateStyle: "full",
|
|
||||||
})
|
|
||||||
).format("dddd, DD MMMM YYYY, LT")}
|
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
|
<Event_ComponentDaftarPesertaDanSponsor />
|
||||||
<Stack spacing={2}>
|
|
||||||
<Text c={MainColor.white} fw={"bold"}>
|
|
||||||
Deskripsi
|
|
||||||
</Text>
|
|
||||||
<Text c={MainColor.white}>{data ? data?.deskripsi : null}</Text>
|
|
||||||
</Stack>
|
|
||||||
<SimpleGrid
|
|
||||||
cols={2}
|
|
||||||
breakpoints={[
|
|
||||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
|
||||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Event_ComponentBoxDaftarPeserta />
|
|
||||||
<Event_ComponentBoxDaftarSponsor />
|
|
||||||
</SimpleGrid>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</ComponentGlobal_CardStyles>
|
</ComponentGlobal_CardStyles>
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ import { useState } from "react";
|
|||||||
import { Event_ComponentCreateButton } from "../component";
|
import { Event_ComponentCreateButton } from "../component";
|
||||||
import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input";
|
import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input";
|
||||||
import { MainColor } from "@/app_modules/_global/color";
|
import { MainColor } from "@/app_modules/_global/color";
|
||||||
|
import { Component_V3_TextEditor } from "@/app_modules/_global/component/new/comp_V3_text_editor";
|
||||||
|
import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
|
||||||
|
import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
|
||||||
|
|
||||||
export default function Event_Create({
|
export default function Event_Create({
|
||||||
listTipeAcara,
|
listTipeAcara,
|
||||||
@@ -55,7 +58,7 @@ export default function Event_Create({
|
|||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
label="Judul"
|
label="Judul"
|
||||||
placeholder="Masukan judul"
|
placeholder="Masukan judul"
|
||||||
@@ -81,7 +84,7 @@ export default function Event_Create({
|
|||||||
},
|
},
|
||||||
dropdown: {
|
dropdown: {
|
||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Tipe Acara"
|
label="Tipe Acara"
|
||||||
@@ -108,7 +111,7 @@ export default function Event_Create({
|
|||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
label="Lokasi"
|
label="Lokasi"
|
||||||
placeholder="Masukan lokasi acara"
|
placeholder="Masukan lokasi acara"
|
||||||
@@ -122,7 +125,6 @@ export default function Event_Create({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
<DateTimePicker
|
<DateTimePicker
|
||||||
styles={{
|
styles={{
|
||||||
label: {
|
label: {
|
||||||
@@ -133,7 +135,7 @@ export default function Event_Create({
|
|||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
excludeDate={(date) => {
|
excludeDate={(date) => {
|
||||||
return moment(date).diff(Date.now(), "days") < 0;
|
return moment(date).diff(Date.now(), "days") < 0;
|
||||||
@@ -179,7 +181,7 @@ export default function Event_Create({
|
|||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
excludeDate={(date) => {
|
excludeDate={(date) => {
|
||||||
return moment(date).diff(Date.now(), "days") < 0;
|
return moment(date).diff(Date.now(), "days") < 0;
|
||||||
@@ -218,6 +220,30 @@ export default function Event_Create({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack spacing={5}>
|
<Stack spacing={5}>
|
||||||
|
<Text c={MainColor.white} fz={"sm"}>
|
||||||
|
Deskripsi
|
||||||
|
<Text inherit span c={"red"} px={5}>
|
||||||
|
*
|
||||||
|
</Text>
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Component_V3_TextEditor
|
||||||
|
data={value.deskripsi}
|
||||||
|
onSetData={(val) => {
|
||||||
|
setValue({
|
||||||
|
...value,
|
||||||
|
deskripsi: val,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ComponentGlobal_InputCountDown
|
||||||
|
lengthInput={funReplaceHtml({ html: value.deskripsi }).length}
|
||||||
|
maxInput={maxInputLength}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
{/* <Stack spacing={5}>
|
||||||
<Textarea
|
<Textarea
|
||||||
styles={{
|
styles={{
|
||||||
label: {
|
label: {
|
||||||
@@ -228,7 +254,7 @@ export default function Event_Create({
|
|||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
label="Deskripsi"
|
label="Deskripsi"
|
||||||
placeholder="Deskripsikan acara yang akan di selenggarakan"
|
placeholder="Deskripsikan acara yang akan di selenggarakan"
|
||||||
@@ -246,7 +272,7 @@ export default function Event_Create({
|
|||||||
lengthInput={value.deskripsi.length}
|
lengthInput={value.deskripsi.length}
|
||||||
maxInput={300}
|
maxInput={300}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack> */}
|
||||||
|
|
||||||
<Event_ComponentCreateButton
|
<Event_ComponentCreateButton
|
||||||
value={value}
|
value={value}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ import { Event_funEditById } from "../fun/edit/fun_edit_by_id";
|
|||||||
import { MODEL_EVENT } from "../_lib/interface";
|
import { MODEL_EVENT } from "../_lib/interface";
|
||||||
import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input";
|
import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
|
import { Component_V3_TextEditor } from "@/app_modules/_global/component/new/comp_V3_text_editor";
|
||||||
|
import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
|
||||||
|
import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
|
||||||
|
|
||||||
export default function Event_Edit({
|
export default function Event_Edit({
|
||||||
dataEvent,
|
dataEvent,
|
||||||
@@ -57,8 +60,8 @@ export default function Event_Edit({
|
|||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
},
|
},
|
||||||
required: {
|
required: {
|
||||||
color: MainColor.red
|
color: MainColor.red,
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
label="Judul"
|
label="Judul"
|
||||||
placeholder="judul"
|
placeholder="judul"
|
||||||
@@ -89,7 +92,7 @@ export default function Event_Edit({
|
|||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
},
|
},
|
||||||
required: {
|
required: {
|
||||||
color: MainColor.red
|
color: MainColor.red,
|
||||||
},
|
},
|
||||||
dropdown: {
|
dropdown: {
|
||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
@@ -122,8 +125,8 @@ export default function Event_Edit({
|
|||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
},
|
},
|
||||||
required: {
|
required: {
|
||||||
color: MainColor.red
|
color: MainColor.red,
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
label="Lokasi"
|
label="Lokasi"
|
||||||
placeholder="lokasi acara"
|
placeholder="lokasi acara"
|
||||||
@@ -164,8 +167,8 @@ export default function Event_Edit({
|
|||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
},
|
},
|
||||||
required: {
|
required: {
|
||||||
color: MainColor.red
|
color: MainColor.red,
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
excludeDate={(date) => {
|
excludeDate={(date) => {
|
||||||
return moment(date).diff(Date.now(), "days") < 0;
|
return moment(date).diff(Date.now(), "days") < 0;
|
||||||
@@ -208,8 +211,8 @@ export default function Event_Edit({
|
|||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
},
|
},
|
||||||
required: {
|
required: {
|
||||||
color: MainColor.red
|
color: MainColor.red,
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
excludeDate={(date) => {
|
excludeDate={(date) => {
|
||||||
return moment(date).diff(Date.now(), "days") < 0;
|
return moment(date).diff(Date.now(), "days") < 0;
|
||||||
@@ -247,6 +250,34 @@ export default function Event_Edit({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack spacing={5}>
|
<Stack spacing={5}>
|
||||||
|
<Text c={MainColor.white} fz={"sm"}>
|
||||||
|
Deskripsi
|
||||||
|
<Text inherit span c={"red"} px={5}>
|
||||||
|
*
|
||||||
|
</Text>
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Component_V3_TextEditor
|
||||||
|
data={value.deskripsi}
|
||||||
|
onSetData={(val) => {
|
||||||
|
setValue({
|
||||||
|
...value,
|
||||||
|
deskripsi: val.trim(),
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{funReplaceHtml({ html: value.deskripsi }).length === 0 && (
|
||||||
|
<ComponentGlobal_ErrorInput text="Masukan deskripsi" />
|
||||||
|
)}
|
||||||
|
|
||||||
|
<ComponentGlobal_InputCountDown
|
||||||
|
lengthInput={funReplaceHtml({ html: value.deskripsi }).length}
|
||||||
|
maxInput={maxInputLength}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
{/* <Stack spacing={5}>
|
||||||
<Textarea
|
<Textarea
|
||||||
styles={{
|
styles={{
|
||||||
label: {
|
label: {
|
||||||
@@ -256,8 +287,8 @@ export default function Event_Edit({
|
|||||||
backgroundColor: MainColor.white,
|
backgroundColor: MainColor.white,
|
||||||
},
|
},
|
||||||
required: {
|
required: {
|
||||||
color: MainColor.red
|
color: MainColor.red,
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
label="Deskripsi"
|
label="Deskripsi"
|
||||||
placeholder="Deskripsikan acara yang akan di selenggarakan"
|
placeholder="Deskripsikan acara yang akan di selenggarakan"
|
||||||
@@ -283,7 +314,7 @@ export default function Event_Edit({
|
|||||||
maxInput={300}
|
maxInput={300}
|
||||||
lengthInput={value.deskripsi.length}
|
lengthInput={value.deskripsi.length}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack> */}
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
style={{
|
style={{
|
||||||
@@ -292,10 +323,11 @@ export default function Event_Edit({
|
|||||||
disabled={
|
disabled={
|
||||||
value.title === "" ||
|
value.title === "" ||
|
||||||
value.lokasi === "" ||
|
value.lokasi === "" ||
|
||||||
value.deskripsi === "" ||
|
|
||||||
value.eventMaster_TipeAcaraId === 0 ||
|
value.eventMaster_TipeAcaraId === 0 ||
|
||||||
moment(value.tanggalSelesai?.toISOString().toString()) <
|
moment(value.tanggalSelesai?.toISOString().toString()) <
|
||||||
moment(value.tanggal.toISOString().toString())
|
moment(value.tanggal.toISOString().toString()) ||
|
||||||
|
funReplaceHtml({ html: value.deskripsi }).length > maxInputLength ||
|
||||||
|
funReplaceHtml({ html: value.deskripsi }).length === 0
|
||||||
}
|
}
|
||||||
loaderPosition="center"
|
loaderPosition="center"
|
||||||
loading={isLoading ? true : false}
|
loading={isLoading ? true : false}
|
||||||
@@ -325,13 +357,13 @@ async function onUpdate(
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
const res = await Event_funEditById(value);
|
const res = await Event_funEditById(value);
|
||||||
|
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
router.back();
|
router.back();
|
||||||
} else {
|
} else {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
clientLogger.error("Error update event", error);
|
clientLogger.error("Error update event", error);
|
||||||
|
|||||||
@@ -1,30 +1,28 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { gs_eventTriggerBeranda } from "@/lib/global_state";
|
|
||||||
import { RouterEvent } from "@/lib/router_hipmi/router_event";
|
|
||||||
import { AccentColor } from "@/app_modules/_global/color";
|
import { AccentColor } from "@/app_modules/_global/color";
|
||||||
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
|
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
|
||||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
|
import { API_RouteEvent } from "@/lib/api_user_router/route_api_event";
|
||||||
|
import { gs_eventTriggerBeranda } from "@/lib/global_state";
|
||||||
|
import { RouterEvent } from "@/lib/router_hipmi/router_event";
|
||||||
import {
|
import {
|
||||||
Affix,
|
Affix,
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Center,
|
Center,
|
||||||
Loader,
|
Loader,
|
||||||
rem,
|
rem
|
||||||
Skeleton,
|
|
||||||
Paper,
|
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { ScrollOnly } from "next-scroll-loader";
|
import { ScrollOnly } from "next-scroll-loader";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { ComponentEvent_CardBeranda } from "../component/card_view/card_beranda";
|
|
||||||
import { event_getListAllPublish } from "../fun/get/get_list_all_publish";
|
|
||||||
import { MODEL_EVENT } from "../_lib/interface";
|
import { MODEL_EVENT } from "../_lib/interface";
|
||||||
import { Event_ComponentSkeletonBeranda } from "../component";
|
import { Event_ComponentSkeletonBeranda } from "../component";
|
||||||
import { API_RouteEvent } from "@/lib/api_user_router/route_api_event";
|
import { ComponentEvent_CardBeranda } from "../component/card_view/card_beranda";
|
||||||
|
import { event_getListAllPublish } from "../fun/get/get_list_all_publish";
|
||||||
|
|
||||||
export default function Event_Beranda() {
|
export default function Event_Beranda() {
|
||||||
const [data, setData] = useState<MODEL_EVENT[] | null>(null);
|
const [data, setData] = useState<MODEL_EVENT[] | null>(null);
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import "react-quill/dist/quill.snow.css";
|
import "react-quill/dist/quill.snow.css";
|
||||||
import { forum_funCreate } from "../fun/create/fun_create";
|
import { forum_funCreate } from "../fun/create/fun_create";
|
||||||
import { Component_V3_TextEditor } from "@/app_modules/_global/component/new/comp_V3_text_editor";
|
|
||||||
|
|
||||||
export default function Forum_NewCreate() {
|
export default function Forum_NewCreate() {
|
||||||
const [data, setData] = useState<string>("");
|
const [data, setData] = useState<string>("");
|
||||||
@@ -19,7 +18,7 @@ export default function Forum_NewCreate() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<Component_V3_TextEditor
|
{/* <Component_V3_TextEditor
|
||||||
data={data}
|
data={data}
|
||||||
onSetData={(val) => {
|
onSetData={(val) => {
|
||||||
setData(val);
|
setData(val);
|
||||||
@@ -27,7 +26,7 @@ export default function Forum_NewCreate() {
|
|||||||
onSetLengthData={(val) => {
|
onSetLengthData={(val) => {
|
||||||
setLengthData(val);
|
setLengthData(val);
|
||||||
}}
|
}}
|
||||||
/>
|
/> */}
|
||||||
|
|
||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<ComponentGlobal_InputCountDown
|
<ComponentGlobal_InputCountDown
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
||||||
import { Component_V3_TextEditor } from "@/app_modules/_global/component/new/comp_V3_text_editor";
|
|
||||||
import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
|
import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
|
||||||
import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
|
import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
@@ -45,7 +44,7 @@ export default function Forum_EditPosting() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Component_V3_TextEditor
|
{/* <Component_V3_TextEditor
|
||||||
data={data.diskusi}
|
data={data.diskusi}
|
||||||
onSetData={(value) => {
|
onSetData={(value) => {
|
||||||
setData({
|
setData({
|
||||||
@@ -57,7 +56,7 @@ export default function Forum_EditPosting() {
|
|||||||
console.log(value);
|
console.log(value);
|
||||||
setLengthData(value);
|
setLengthData(value);
|
||||||
}}
|
}}
|
||||||
/>
|
/> */}
|
||||||
|
|
||||||
{/* <Paper withBorder shadow="lg" p={"xs"}>
|
{/* <Paper withBorder shadow="lg" p={"xs"}>
|
||||||
<ReactQuill
|
<ReactQuill
|
||||||
|
|||||||
Reference in New Issue
Block a user