From e365aa800794bc73c0adb5581ad7a7aa386f9d30 Mon Sep 17 00:00:00 2001 From: hanif salafi Date: Thu, 3 Jul 2025 02:13:31 +0700 Subject: [PATCH] feat: update schedule on landing --- app/[locale]/(public)/schedule/page.tsx | 104 +++++++++++++++++------- 1 file changed, 73 insertions(+), 31 deletions(-) diff --git a/app/[locale]/(public)/schedule/page.tsx b/app/[locale]/(public)/schedule/page.tsx index 09f4280d..a95a054d 100644 --- a/app/[locale]/(public)/schedule/page.tsx +++ b/app/[locale]/(public)/schedule/page.tsx @@ -16,7 +16,7 @@ import { import { CalendarIcon } from "lucide-react"; import React, { useEffect, useState } from "react"; import { format } from "date-fns"; -import { cn } from "@/lib/utils"; +import { cn, getCookiesDecrypt } from "@/lib/utils"; import { Checkbox } from "@/components/ui/checkbox"; import { Icon } from "@iconify/react/dist/iconify.js"; import { @@ -29,16 +29,13 @@ import { } from "@/service/schedule/schedule"; import { usePathname, useRouter } from "@/i18n/routing"; import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, -} from "@/components/ui/alert-dialog"; + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; import { Accordion, AccordionContent, @@ -217,6 +214,7 @@ const Schedule = (props: any) => { const [regionFilter, setRegionFilter] = useState([]); const [regionName, setRegionName] = useState([]); const isPolda = asPath.includes("/polda"); + const userId = getCookiesDecrypt("uie"); async function doneTyping() { if (search?.length > 2) { @@ -453,6 +451,10 @@ const Schedule = (props: any) => { getListDataCity(); }; + const goLogin = () => { + router.push("/auth/login"); + }; + const deleteFilterhandler = (filterId: any) => { console.log("hapus", filterId); const deletedReg = regionName.filter((list: any) => list.id !== filterId); @@ -486,7 +488,12 @@ const Schedule = (props: any) => {

{itemFound[0]?.title}

- {itemFound[0].isYoutube == true ?

LIVE

: ""} + {itemFound[0].isYoutube == true ? ( +
+
+ LIVE +
+ ) : ""} {/*

{itemFound[0].address}

*/} ); @@ -516,7 +523,12 @@ const Schedule = (props: any) => {

{list.title}

- {list.isYoutube == true ?

LIVE

: ""} + {list.isYoutube == true ? ( +
+
+ LIVE +
+ ) : ""} {/*

{list.address}

*/} ))} @@ -1068,41 +1080,71 @@ const Schedule = (props: any) => { - - - - + + + +

JADWAL /{" "} {detail?.isYoutube == true ? "LIVE STREAMING" : "DETAIL"}

{detail?.title}

-
- + +

- {detail?.date} {detail?.startTime} - {detail?.endTime}{" "} + {detail?.startDate} {detail?.startTime} - {detail?.endTime}{" "} {detail?.timezone ? detail.timezone : "WIB"}

-
- + +

{detail?.address}

-
- + +

{detail?.speakerTitle || ""} {detail?.speakerName || ""}{" "}

-
-
- - Close - -
-
+ + + {detail?.isYoutube == true ? ( + userId == null ? ( +
+

+ Untuk menonton Live Streaming silahkan + goLogin()}> + {" "} + Login{" "} + + terlebih dahulu +

+
+ ) : ( +
+