From 0e7c491031683178c858f875ee1c346800dd4e6c Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Tue, 29 Apr 2025 17:25:16 +0800 Subject: [PATCH] fix tampilan html view --- src/app/api/event/status/[name]/route.ts | 4 +- .../comp_card_box_and_background.tsx | 5 +- .../new/comp_V3_set_html_with_stiker.css | 4 ++ .../new/comp_V3_set_html_with_stiker.tsx | 13 +++-- .../component/new/comp_set_inner_html.tsx | 17 ++++-- .../event/component/box_list_status.tsx | 58 ++++++++++++++++--- .../component/card_view/card_beranda.tsx | 14 ++--- .../component/card_view/card_riwayat.tsx | 5 +- .../forumku_component/forumku_view.tsx | 3 + .../component/main_component/card_view.tsx | 3 + 10 files changed, 96 insertions(+), 30 deletions(-) create mode 100644 src/app_modules/_global/component/new/comp_V3_set_html_with_stiker.css diff --git a/src/app/api/event/status/[name]/route.ts b/src/app/api/event/status/[name]/route.ts index d2635598..2b3ba3ce 100644 --- a/src/app/api/event/status/[name]/route.ts +++ b/src/app/api/event/status/[name]/route.ts @@ -13,7 +13,7 @@ export async function GET( const { name } = params; const { searchParams } = new URL(request.url); const page = searchParams.get("page"); - const takeData = 6; + const takeData = 10; const skipData = Number(page) * takeData - takeData; const userLoginId = await funGetUserIdByToken(); @@ -51,7 +51,7 @@ export async function GET( take: takeData, skip: skipData, orderBy: { - tanggal: "asc", + updatedAt: "desc", }, where: { active: true, diff --git a/src/app_modules/_global/component/comp_card_box_and_background.tsx b/src/app_modules/_global/component/comp_card_box_and_background.tsx index 7d724c24..b7f26570 100644 --- a/src/app_modules/_global/component/comp_card_box_and_background.tsx +++ b/src/app_modules/_global/component/comp_card_box_and_background.tsx @@ -4,7 +4,7 @@ import React from "react"; /** * ComponentGlobal_CardStyles - * + * * A React component that renders a customizable card element. * * Props: @@ -24,6 +24,7 @@ export function ComponentGlobal_CardStyles({ height, color, onClickHandler, + style, }: { children: React.ReactNode; backgroundColor?: string; @@ -32,11 +33,13 @@ export function ComponentGlobal_CardStyles({ height?: string | number; color?: string; onClickHandler?: React.MouseEventHandler; + style?: React.CSSProperties; }) { return ( <> -
+
); } diff --git a/src/app_modules/_global/component/new/comp_set_inner_html.tsx b/src/app_modules/_global/component/new/comp_set_inner_html.tsx index d9a0ea5b..0c93f796 100644 --- a/src/app_modules/_global/component/new/comp_set_inner_html.tsx +++ b/src/app_modules/_global/component/new/comp_set_inner_html.tsx @@ -1,23 +1,30 @@ import { MainColor } from "../../color"; -export const Comp_DangerouslySetInnerHTML= ({ +export const Comp_DangerouslySetInnerHTML = ({ props, color, + style, }: { props: string | undefined; color?: string; -}) => { + style?: React.CSSProperties; +}) => { + const baseStyle: React.CSSProperties = { + color: color ?? MainColor.white, + }; + return ( <>
); -} +}; diff --git a/src/app_modules/event/component/box_list_status.tsx b/src/app_modules/event/component/box_list_status.tsx index dd47149b..8a0f1eb0 100644 --- a/src/app_modules/event/component/box_list_status.tsx +++ b/src/app_modules/event/component/box_list_status.tsx @@ -5,7 +5,7 @@ import { ComponentGlobal_CardLoadingOverlay, ComponentGlobal_CardStyles, } from "@/app_modules/_global/component"; -import { Group, Stack, Text, Title } from "@mantine/core"; +import { Box, Group, Stack, Text, Title } from "@mantine/core"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { MODEL_EVENT } from "../_lib/interface"; @@ -31,6 +31,11 @@ export default function ComponentEvent_BoxListStatus({ setVisible(true); router.push(path + data.id); }} + // style={{ + // maxHeight: 200, + // overflow: "hidden", + // position: "relative", + // }} > @@ -43,17 +48,52 @@ export default function ComponentEvent_BoxListStatus({ }).format(new Date(data.tanggal))} - - - + + - {visible && eventId !== "" ? ( - - ) : ( - "" - )} + {visible && eventId !== "" && } + + {/* +
+ + + + */} ); } diff --git a/src/app_modules/event/component/card_view/card_beranda.tsx b/src/app_modules/event/component/card_view/card_beranda.tsx index ca35fccb..3ba23320 100644 --- a/src/app_modules/event/component/card_view/card_beranda.tsx +++ b/src/app_modules/event/component/card_view/card_beranda.tsx @@ -17,7 +17,9 @@ export function ComponentEvent_CardBeranda({ data }: { data: any }) { return ( <> - + {data.title} - {/* - {new Intl.DateTimeFormat("id-ID", { - dateStyle: "medium", - }).format(data?.tanggal)} - */} - + diff --git a/src/app_modules/event/component/card_view/card_riwayat.tsx b/src/app_modules/event/component/card_view/card_riwayat.tsx index 52fc93a5..e2695597 100644 --- a/src/app_modules/event/component/card_view/card_riwayat.tsx +++ b/src/app_modules/event/component/card_view/card_riwayat.tsx @@ -44,7 +44,10 @@ export function ComponentEvent_CardRiwayat({ data }: { data: MODEL_EVENT }) { - + diff --git a/src/app_modules/forum/component/forumku_component/forumku_view.tsx b/src/app_modules/forum/component/forumku_component/forumku_view.tsx index 95e6a255..84e9d8f5 100644 --- a/src/app_modules/forum/component/forumku_component/forumku_view.tsx +++ b/src/app_modules/forum/component/forumku_component/forumku_view.tsx @@ -68,6 +68,9 @@ export default function ComponentForum_ForumkuMainCardView({ diff --git a/src/app_modules/forum/component/main_component/card_view.tsx b/src/app_modules/forum/component/main_component/card_view.tsx index df391804..66aeffcc 100644 --- a/src/app_modules/forum/component/main_component/card_view.tsx +++ b/src/app_modules/forum/component/main_component/card_view.tsx @@ -67,6 +67,9 @@ export default function ComponentForum_BerandaCardView({