diff --git a/public/portofolio/logo/01b978fb-40f4-47c1-9431-70981fb17b8b.png b/public/portofolio/logo/01b978fb-40f4-47c1-9431-70981fb17b8b.png deleted file mode 100644 index 7db4a537..00000000 Binary files a/public/portofolio/logo/01b978fb-40f4-47c1-9431-70981fb17b8b.png and /dev/null differ diff --git a/public/portofolio/logo/142118e7-a915-46e6-89f8-92f1d3779e7c.png b/public/portofolio/logo/142118e7-a915-46e6-89f8-92f1d3779e7c.png deleted file mode 100644 index 5d1f3b87..00000000 Binary files a/public/portofolio/logo/142118e7-a915-46e6-89f8-92f1d3779e7c.png and /dev/null differ diff --git a/public/portofolio/logo/19ccfa45-31c6-4214-a925-4e2747ff278c.png b/public/portofolio/logo/19ccfa45-31c6-4214-a925-4e2747ff278c.png deleted file mode 100644 index 176da5a2..00000000 Binary files a/public/portofolio/logo/19ccfa45-31c6-4214-a925-4e2747ff278c.png and /dev/null differ diff --git a/public/portofolio/logo/9a40ec12-176f-4e20-a2e9-685d19a3c350.jpg b/public/portofolio/logo/9a40ec12-176f-4e20-a2e9-685d19a3c350.jpg deleted file mode 100644 index d906e018..00000000 Binary files a/public/portofolio/logo/9a40ec12-176f-4e20-a2e9-685d19a3c350.jpg and /dev/null differ diff --git a/public/portofolio/logo/ed10f0e8-fd5c-4ed8-a59c-6f690ca360cc.jpg b/public/portofolio/logo/a8b687db-75f3-4087-bf8a-b8e4c9f0a748.jpg similarity index 100% rename from public/portofolio/logo/ed10f0e8-fd5c-4ed8-a59c-6f690ca360cc.jpg rename to public/portofolio/logo/a8b687db-75f3-4087-bf8a-b8e4c9f0a748.jpg diff --git a/public/portofolio/logo/bd2c3ce3-e94d-4309-ac48-6fbaa2f72c66.png b/public/portofolio/logo/bd2c3ce3-e94d-4309-ac48-6fbaa2f72c66.png new file mode 100644 index 00000000..256b64ba Binary files /dev/null and b/public/portofolio/logo/bd2c3ce3-e94d-4309-ac48-6fbaa2f72c66.png differ diff --git a/public/profile/background/34f19452-0a72-4b26-8915-43f7b87c37d8.jpeg b/public/profile/background/34f19452-0a72-4b26-8915-43f7b87c37d8.jpeg new file mode 100644 index 00000000..8cd38350 Binary files /dev/null and b/public/profile/background/34f19452-0a72-4b26-8915-43f7b87c37d8.jpeg differ diff --git a/public/profile/background/45841dcd-d518-4c97-b04a-d6547359bb8b.jpeg b/public/profile/background/45841dcd-d518-4c97-b04a-d6547359bb8b.jpeg new file mode 100644 index 00000000..8a84a01d Binary files /dev/null and b/public/profile/background/45841dcd-d518-4c97-b04a-d6547359bb8b.jpeg differ diff --git a/public/profile/background/99c41f6b-6710-49df-a658-1b4243b57b1d.jpeg b/public/profile/background/99c41f6b-6710-49df-a658-1b4243b57b1d.jpeg new file mode 100644 index 00000000..8cd38350 Binary files /dev/null and b/public/profile/background/99c41f6b-6710-49df-a658-1b4243b57b1d.jpeg differ diff --git a/public/profile/foto/2c10a620-4222-43bc-886e-2f317de4711c.jpeg b/public/profile/foto/2c10a620-4222-43bc-886e-2f317de4711c.jpeg new file mode 100644 index 00000000..4660498f Binary files /dev/null and b/public/profile/foto/2c10a620-4222-43bc-886e-2f317de4711c.jpeg differ diff --git a/public/profile/foto/51b1addd-2e15-409e-8f72-388dc1cc1c2e.jpeg b/public/profile/foto/51b1addd-2e15-409e-8f72-388dc1cc1c2e.jpeg new file mode 100644 index 00000000..4660498f Binary files /dev/null and b/public/profile/foto/51b1addd-2e15-409e-8f72-388dc1cc1c2e.jpeg differ diff --git a/public/profile/foto/994ecb8e-59f6-43b7-a4ea-e14d8e441200.jpeg b/public/profile/foto/994ecb8e-59f6-43b7-a4ea-e14d8e441200.jpeg new file mode 100644 index 00000000..4660498f Binary files /dev/null and b/public/profile/foto/994ecb8e-59f6-43b7-a4ea-e14d8e441200.jpeg differ diff --git a/src/app/api/test-scroll/route.ts b/src/app/api/test-scroll/route.ts index 8af369fc..c722ba33 100644 --- a/src/app/api/test-scroll/route.ts +++ b/src/app/api/test-scroll/route.ts @@ -8,5 +8,5 @@ export async function GET(req: Request) { skip: +page * 5 - 5, }); - return Response.json(res); + // return Response.json(res); } diff --git a/src/app/dev/colab/detail/group/[id]/page.tsx b/src/app/dev/colab/detail/group/[id]/page.tsx index 93b70b60..ef18896d 100644 --- a/src/app/dev/colab/detail/group/[id]/page.tsx +++ b/src/app/dev/colab/detail/group/[id]/page.tsx @@ -17,23 +17,19 @@ export default async function Page({ params }: { params: { id: string } }) { ]); let listMsg = await colab_getMessageByRoomId({ roomId: roomId, page: 1 }); - // const listMessage = await colab_V2getListMessageByRoomId({ - // roomId: roomId, - // page: 1, - // }); - return ( <> - {/* */} - + + {/* + /> */} ); } diff --git a/src/app/dev/event/detail/draft/[id]/layout.tsx b/src/app/dev/event/detail/draft/[id]/layout.tsx index 529e8e2e..e2e18be4 100644 --- a/src/app/dev/event/detail/draft/[id]/layout.tsx +++ b/src/app/dev/event/detail/draft/[id]/layout.tsx @@ -8,9 +8,13 @@ export default async function Page({ children: React.ReactNode; params: { id: string }; }) { - let eventId = params.id + let eventId = params.id; - return <> - {children}; - + return ( + <> + + {children} + + + ); } diff --git a/src/app/dev/event/detail/draft/[id]/page.tsx b/src/app/dev/event/detail/draft/[id]/page.tsx index ff593528..e4ecbc73 100644 --- a/src/app/dev/event/detail/draft/[id]/page.tsx +++ b/src/app/dev/event/detail/draft/[id]/page.tsx @@ -1,8 +1,8 @@ -import { Event_DetailDraft } from "@/app_modules/event"; -import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"; +import { Event_DetailDraft } from "@/app_modules/event" +import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id" -export default async function Page({params}: {params: {id: string}}) { +export default async function Page({ params }: { params: { id: string } }) { let eventId = params.id const dataEvent = await Event_getOneById(eventId) - return ; + return } diff --git a/src/app/dev/forum/forumku/[id]/page.tsx b/src/app/dev/forum/forumku/[id]/page.tsx index 0bfe0fcb..ca9e99b3 100644 --- a/src/app/dev/forum/forumku/[id]/page.tsx +++ b/src/app/dev/forum/forumku/[id]/page.tsx @@ -8,7 +8,7 @@ import { forum_countPostingByAuthorId } from "@/app_modules/forum/fun/count/coun export default async function Page({ params }: { params: { id: string } }) { const authorId = params.id; - const userLoginId = await user_getOneUserId() + const userLoginId = await user_getOneUserId(); const dataAuthor = await user_getOneByUserId(authorId); const auhtorSelectedData = _.omit(dataAuthor, [ "Profile.email", @@ -25,14 +25,11 @@ export default async function Page({ params }: { params: { id: string } }) { // setTimeout(a, 1000); // }); - - const dataPosting = await forum_getListPostingByAuhtorId(authorId); const totalPosting = await forum_countPostingByAuthorId(authorId); return ( <> - - {children} + {children} + ); } diff --git a/src/app_modules/auth/register/view.tsx b/src/app_modules/auth/register/view.tsx index 206a9002..9b0012a5 100644 --- a/src/app_modules/auth/register/view.tsx +++ b/src/app_modules/auth/register/view.tsx @@ -27,11 +27,13 @@ import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_glob import { IconPencilCheck } from "@tabler/icons-react"; import { RouterHome } from "@/app/lib/router_hipmi/router_home"; import { auth_funEditAktivasiKodeOtpById } from "../fun/fun_edit_aktivasi_kode_otp_by_id"; +import ComponentGlobal_ErrorInput from "@/app_modules/component_global/error_input"; export default function Register({ dataOtp }: { dataOtp: any }) { const router = useRouter(); const [nomor, setNomor] = useState(dataOtp.nomor); const [value, setValue] = useState(""); + const [isValue, setIsValue] = useState(false); const focusTrapRef = useFocusTrap(); const [loading, setLoading] = useState(false); @@ -42,17 +44,12 @@ export default function Register({ dataOtp }: { dataOtp: any }) { }; // console.log(body); - if (body.username === "") - return ComponentGlobal_NotifikasiPeringatan("Lengkapi Username"); - - if (body.username.length < 5) - return ComponentGlobal_NotifikasiPeringatan("Username tidak sesuai"); - - if (_.values(body.username).includes(" ")) - return ComponentGlobal_NotifikasiPeringatan( - "Username tidak sesuai", - 3000 - ); + if (body.username === "") { + setIsValue(true); + return null; + } + if (body.username.length < 5) return null; + if (_.values(body.username).includes(" ")) return null; await Auth_funRegister(body).then(async (res) => { if (res.status === 200) { @@ -92,23 +89,27 @@ export default function Register({ dataOtp }: { dataOtp: any }) { REGISTRASI Masukan username anda ! - + 0 && value.length < 5 ? ( - Minimal 5 karakter + ) : _.values(value).includes(" ") ? ( - - - Tidak boleh ada space - - Sambungkan huruf meggunakan karakter _ + + + + ) : isValue ? ( + ) : ( "" ) } onChange={(val) => { + val.currentTarget.value.length > 0 ? setIsValue(false) : ""; setValue(val.currentTarget.value); }} /> diff --git a/src/app_modules/colab/detail/chat/index.tsx b/src/app_modules/colab/detail/chat/index.tsx index b65f2097..e1bd2f98 100644 --- a/src/app_modules/colab/detail/chat/index.tsx +++ b/src/app_modules/colab/detail/chat/index.tsx @@ -46,6 +46,7 @@ import useInfiniteScroll, { import toast from "react-simple-toasts"; import colab_getOneMessageById from "../../fun/get/room_chat/get_one_message_by_id"; import { List } from "react-virtualized"; +import { evnPesan } from "@/util/evn"; const list = Array(100).fill(0); export default function ColabViewChat({ @@ -74,23 +75,53 @@ export default function ColabViewChat({ down: false, }); + const [topik, setTopic] = useState("") + + useShallowEffect(() => { + evnPesan.on(topik, (msgg) => { + let dd: any[] = _.clone(data); + const a = [...dd, JSON.parse(msgg)]; + // console.log(dd.length); + setData(a); + }); + }, [data]); + + + // Kirim pesan async function onSend() { - await colab_funCreateMessageByUserId(msg, dataRoom.id).then(async (res) => { - if (res.status === 200) { - const newData = await colab_getMessageByRoomId({ - roomId: dataRoom?.id, - page: 1, - }); - setData(newData as any); - setHasMore({ up: true }); - + // console.log(JSON.stringify(data[0], null, 2)); + const kiriman = { + id: "clw8glvt4000j12efrecoubug", + createdAt: "2024-05-15T23:35:05.032Z", + isActive: true, + message: msg, + isFile: false, + User: { + id: "clvag8xt10007134j8sapm46n", + Profile: { + id: "clvajdger000g134jhhhg21c4", + name: "malikkurosaki", + }, + }, + }; + mqtt_client.publish("pesan", JSON.stringify(kiriman)); + // await colab_funCreateMessageByUserId(msg, dataRoom.id).then(async (res) => { + // if (res.status === 200) { + // const newData = await colab_getMessageByRoomId({ + // roomId: dataRoom?.id, + // page: 1, + // }); + + // setData(newData as any); + // setHasMore({ up: true }); + setMsg(""); - } else { - ComponentGlobal_NotifikasiGagal(res.message); - } - }); + // } else { + // ComponentGlobal_NotifikasiGagal(res.message); + // } + // }); } const next = async (direction: ScrollDirection) => { @@ -220,19 +251,19 @@ export default function ColabViewChat({ dangerouslySetInnerHTML={{ __html: e?.message }} /> - {/* + - {new Intl.DateTimeFormat("id-ID", { + {/* {new Intl.DateTimeFormat("id-ID", { timeStyle: "medium", - }).format(e.createdAt)} + }).format(e.createdAt)} */} - {new Intl.DateTimeFormat("id-ID", { + {/* {new Intl.DateTimeFormat("id-ID", { dateStyle: "medium", - }).format(e.createdAt)} + }).format(e.createdAt)} */} - */} + @@ -246,19 +277,19 @@ export default function ColabViewChat({
- {/* + - {new Intl.DateTimeFormat("id-ID", { + {/* {new Intl.DateTimeFormat("id-ID", { timeStyle: "medium", - }).format(e.createdAt)} + }).format(e.createdAt)} */} - {new Intl.DateTimeFormat("id-ID", { + {/* {new Intl.DateTimeFormat("id-ID", { dateStyle: "medium", - }).format(e.createdAt)} + }).format(e.createdAt)} */} - */} + diff --git a/src/app_modules/colab/detail/group/index.tsx b/src/app_modules/colab/detail/group/index.tsx index f402e85a..0592e46c 100644 --- a/src/app_modules/colab/detail/group/index.tsx +++ b/src/app_modules/colab/detail/group/index.tsx @@ -103,9 +103,6 @@ export default function Colab_GroupChatView({ mqtt_client.publish(selectRoom.id, msg); setMsg(""); - // const d = JSON.parse(JSON.stringify(res.data)); - // setData([...data, ...[d]]); - await colab_getOneMessageById({ messageId: res.data?.id as any, }).then((res) => { @@ -114,9 +111,9 @@ export default function Colab_GroupChatView({ // const d = JSON.parse(JSON.stringify(res)); // setData([...data, ...[d]]); - mqtt_client.on("message", (a,b) => { - setData([...data, ...[res]]) - }) + mqtt_client.on("message", (a, b) => { + setData([...data, ...[res]]); + }); }); } else { ComponentGlobal_NotifikasiGagal(res.message); diff --git a/src/app_modules/colab/fun/get/room_chat/get_message_by_room_id.ts b/src/app_modules/colab/fun/get/room_chat/get_message_by_room_id.ts index 4a915ba5..4e27d8cd 100644 --- a/src/app_modules/colab/fun/get/room_chat/get_message_by_room_id.ts +++ b/src/app_modules/colab/fun/get/room_chat/get_message_by_room_id.ts @@ -12,8 +12,8 @@ export default async function colab_getMessageByRoomId({ roomId: string; page: number; }) { - const lewat = page * 10 - 10; - const ambil = 10; + const lewat = page * 6 - 6; + const ambil = 6; const getList = await prisma.projectCollaboration_Message.findMany({ orderBy: { diff --git a/src/app_modules/component_global/error_input.tsx b/src/app_modules/component_global/error_input.tsx new file mode 100644 index 00000000..93da4dc9 --- /dev/null +++ b/src/app_modules/component_global/error_input.tsx @@ -0,0 +1,25 @@ +"use client"; + +import { Group, Text } from "@mantine/core"; +import { IconAlertTriangle } from "@tabler/icons-react"; + +export default function ComponentGlobal_ErrorInput({ + max, + text, + color, +}: { + max?: number; + text?: string; + color?: string; +}) { + return ( + <> + + + + {text ? text : ` Maksimal ${max ? max : "-"} karakter !`} + + + + ); +} diff --git a/src/app_modules/component_global/input_countdown.tsx b/src/app_modules/component_global/input_countdown.tsx new file mode 100644 index 00000000..7aaa444b --- /dev/null +++ b/src/app_modules/component_global/input_countdown.tsx @@ -0,0 +1,23 @@ +"use client"; + +import { Text } from "@mantine/core"; +import { useState } from "react"; + +export default function ComponentGlobal_InputCountDown({ + maxInput, + lengthInput, +}: { + maxInput: number; + lengthInput: number; +}) { + return ( + <> + + {maxInput - lengthInput < 0 ? 0 : maxInput - lengthInput} /{" "} + + {maxInput} + + + + ); +} diff --git a/src/app_modules/event/component/detail/detail_data.tsx b/src/app_modules/event/component/detail/detail_data.tsx index be67a372..c5de678a 100644 --- a/src/app_modules/event/component/detail/detail_data.tsx +++ b/src/app_modules/event/component/detail/detail_data.tsx @@ -15,14 +15,14 @@ export default function ComponentEvent_DetailData({ const jam = tgl.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", - hour12: false, }); return ( <> + {/*
{JSON.stringify(jam)}
*/} - {data ? data?.title : null} + {data ? data?.title : null} @@ -52,7 +52,7 @@ export default function ComponentEvent_DetailData({ : - {hari} + {hari ? hari : ""} @@ -61,7 +61,7 @@ export default function ComponentEvent_DetailData({ : - {jam} + {jam ? jam : ""} diff --git a/src/app_modules/event/component/error_maksimal_input.tsx b/src/app_modules/event/component/error_maksimal_input.tsx index 2118cc1d..a7941811 100644 --- a/src/app_modules/event/component/error_maksimal_input.tsx +++ b/src/app_modules/event/component/error_maksimal_input.tsx @@ -1,17 +1,23 @@ -"use client" +"use client"; import { Group, Text } from "@mantine/core"; import { IconAlertTriangle } from "@tabler/icons-react"; -export default function ComponentEvent_ErrorMaximalInput({max}:{max: number}){ - return ( - <> - - - - Maksimal {max} karakter ! - - - - ); -} \ No newline at end of file +export default function ComponentEvent_ErrorMaximalInput({ + max, + text, +}: { + max?: number; + text?: string; +}) { + return ( + <> + + + + {text ? text : ` Maksimal ${max} karakter !`} + + + + ); +} diff --git a/src/app_modules/event/component/header_tamplate.tsx b/src/app_modules/event/component/header_tamplate.tsx index 51d8ac70..f1f0c1e0 100644 --- a/src/app_modules/event/component/header_tamplate.tsx +++ b/src/app_modules/event/component/header_tamplate.tsx @@ -15,7 +15,7 @@ export default function ComponentEvent_HeaderTamplate({ bg, }: { hideBack?: boolean; - changeIconBack?: any + changeIconBack?: any; route?: any; route2?: any; title: string; @@ -23,6 +23,8 @@ export default function ComponentEvent_HeaderTamplate({ bg?: any; }) { const router = useRouter(); + const [isLoadingBack, setLoadingBack] = useState(false); + const [isLoadingOtherIcon, setLoadingOtherIcon] = useState(false); return ( <>
) : ( { + setLoadingBack(true); if (route === null || route === undefined) { return router.back(); } else { @@ -44,7 +48,7 @@ export default function ComponentEvent_HeaderTamplate({ } }} > - {changeIconBack ? changeIconBack: } + {changeIconBack ? changeIconBack : } )} {title} @@ -54,8 +58,12 @@ export default function ComponentEvent_HeaderTamplate({ } else { return ( router.push(route2)} + onClick={() => { + setLoadingOtherIcon(true); + router.push(route2); + }} > {icon} diff --git a/src/app_modules/event/component/is_empty_data.tsx b/src/app_modules/event/component/is_empty_data.tsx new file mode 100644 index 00000000..cdac2416 --- /dev/null +++ b/src/app_modules/event/component/is_empty_data.tsx @@ -0,0 +1,13 @@ +"use client"; + +import { Center } from "@mantine/core"; + +export default function ComponentEvent_IsEmptyData({ text }: { text: string }) { + return ( + <> +
+ {text} +
+ + ); +} diff --git a/src/app_modules/event/create/create.tsx b/src/app_modules/event/create/create.tsx index 0edcb1ec..13d82d53 100644 --- a/src/app_modules/event/create/create.tsx +++ b/src/app_modules/event/create/create.tsx @@ -48,23 +48,21 @@ export default function Event_Create({ const [tabsStatus, setTabsStatus] = useAtom(gs_event_status); const [listTipe, setListTipe] = useState(listTipeAcara); const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu); - - // Masimal karakter state - const [maxTitle, setMaxTitle] = useState(""); - const [maxLokasi, setMaxLokasi] = useState(""); - const [maxDeskripsi, setMaxDeskripsi] = useState(""); + const [isTime, setIsTime] = useState(false); + const [isLoading, setLoading] = useState(false); const [value, setValue] = useState({ title: "", lokasi: "", deskripsi: "", - tanggal: Date, + tanggal: Date.toString(), eventMaster_TipeAcaraId: 0, authorId: authorId, }); return ( <> + {/*
{JSON.stringify(value, null, 2)}
*/} = 100 ? ( + value.title.length >= 100 ? ( ) : ( "" ) } onChange={(val) => { - setMaxTitle(val.target.value); setValue({ ...value, title: val.target.value, }); }} /> -