diff --git a/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx b/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx index 1861e18b..e2209c2d 100644 --- a/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx +++ b/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx @@ -105,6 +105,7 @@ interface ListItemProps { createdBy: string; isPublish: boolean | null; bgColor: string; + colorList: string[] | null; } interface APIResponse { @@ -360,17 +361,24 @@ const CalendarView = ({ categories }: CalendarViewProps) => { const { createdByName, isPublish } = eventInfo.event.extendedProps; return ( - <> -
- {" "} - {isPublish === true ? : } -

{title}

+
+
+
+ {isPublish === true ? : } +

{title}

+
+ +

+ Created By : {createdByName} +

-

- Created By : {createdByName} -

- +
+
+
+
+
+
); }; @@ -420,14 +428,39 @@ const CalendarView = ({ categories }: CalendarViewProps) => { ]; const getEventColor = (type: Event["type"]): string => { + const typeSplit = type.split(","); + const firstType = typeSplit && typeSplit[0]; const colors: Record = { - 1: "bg-yellow-500", - 2: "bg-blue-400", - 3: "bg-slate-400", - 4: "bg-orange-500", - 5: "bg-green-400", + "0": "bg-black", + "1": "bg-yellow-500", + "2": "bg-blue-400", + "3": "bg-slate-400", + "4": "bg-orange-500", + "5": "bg-green-400", }; - return colors[type]; + console.log("Type : ", colors[firstType]); + return colors[firstType]; + }; + + const getEventColorList = (type: Event["type"]): string[] | null => { + const typeSplit = type.split(","); + const typeList = typeSplit?.slice(1); + + if (typeList.length === 0) return null; + + const colors: Record = { + "0": "bg-black", + "1": "bg-yellow-500", + "2": "bg-blue-400", + "3": "bg-slate-400", + "4": "bg-orange-500", + "5": "bg-green-400", + }; + + const typeListColor = typeList.map((item) => colors[item] || "bg-gray-200"); + + console.log("Type List Color : ", typeListColor); + return typeListColor; }; const handleClickListItem = (item: any) => { @@ -463,16 +496,24 @@ const CalendarView = ({ categories }: CalendarViewProps) => { createdBy, isPublish, bgColor, + colorList, }) => ( -
handleClickListItem(item)} > -
- {isPublish ? : } -

{text}

-
-

Created By: {createdBy}

+
+
+ {isPublish ? : } +

{text}

+
+

Created By: {createdBy}

+
+ +
+ {colorList?.map((color: string) => ( +
+ ))} +
); @@ -502,6 +543,7 @@ const CalendarView = ({ categories }: CalendarViewProps) => { createdBy={event.createdByName} isPublish={event.isPublish} bgColor={getEventColor(event.agendaType)} + colorList={getEventColorList(event.agendaType)} /> ))} @@ -532,6 +574,7 @@ const CalendarView = ({ categories }: CalendarViewProps) => { createdBy={event.createdByName} isPublish={event.isPublish} bgColor={getEventColor(event.agendaType)} + colorList={getEventColorList(event.agendaType)} /> ))}
diff --git a/components/landing-page/area-coverage-and-work-units.tsx b/components/landing-page/area-coverage-and-work-units.tsx index 35d02d95..788d9e41 100644 --- a/components/landing-page/area-coverage-and-work-units.tsx +++ b/components/landing-page/area-coverage-and-work-units.tsx @@ -35,7 +35,7 @@ const AreaCoverageWorkUnits = () => {

Polda Jajaran

- +

Polda Jajaran

@@ -63,7 +63,7 @@ const AreaCoverageWorkUnits = () => {

Satuan Kerja Polri

- +

Satuan Kerja Polri

diff --git a/components/landing-page/footer.tsx b/components/landing-page/footer.tsx index 17d6c1f0..ebfaa49b 100644 --- a/components/landing-page/footer.tsx +++ b/components/landing-page/footer.tsx @@ -68,6 +68,7 @@ const Footer = () => {
Privacy diff --git a/components/landing-page/survey-box.tsx b/components/landing-page/survey-box.tsx index bde4e8f8..c6693c9d 100644 --- a/components/landing-page/survey-box.tsx +++ b/components/landing-page/survey-box.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useEffect, useState } from "react"; import { Dialog, DialogClose, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "../ui/dialog"; import FormSurvey from "./survey"; import { Controller, useForm } from "react-hook-form"; @@ -83,6 +83,7 @@ const UserSurveyBox = () => { const response = await createSurveyData(data); console.log("API Response:", response); setShowSurvey(false); + setOpenPolda(false); } catch (error) { console.error("Error submitting survey:", error); } finally { @@ -114,7 +115,7 @@ const UserSurveyBox = () => { SURVEY SEKARANG - + SURVEI KEPUASAN PENGGUNA MEDIAHUB POLRI Kami menghargai pendapat Anda! Survei ini bertujuan untuk meningkatkan kualitas layanan MediaHub Polri. @@ -148,7 +149,7 @@ const UserSurveyBox = () => {
-