diff --git a/package.json b/package.json index 772a7593..f02d79c5 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "dependencies": { "@emotion/react": "^11.11.1", "@emotion/server": "^11.11.0", + "@hookstate/core": "^4.0.1", "@mantine/carousel": "^7.1.5", "@mantine/core": "^6.0.17", "@mantine/dates": "^6.0.17", diff --git a/public/profile/background/847a4fa4-837d-4abd-aef2-435d8f259b4c.jpeg b/public/profile/background/847a4fa4-837d-4abd-aef2-435d8f259b4c.jpeg new file mode 100644 index 00000000..b43c0679 Binary files /dev/null and b/public/profile/background/847a4fa4-837d-4abd-aef2-435d8f259b4c.jpeg differ diff --git a/public/profile/foto/6452c349-66fc-4db7-99ff-37a659f351bb.jpeg b/public/profile/foto/6452c349-66fc-4db7-99ff-37a659f351bb.jpeg new file mode 100644 index 00000000..4660498f Binary files /dev/null and b/public/profile/foto/6452c349-66fc-4db7-99ff-37a659f351bb.jpeg differ diff --git a/src/app/dev/colab/detail/group/[id]/page.tsx b/src/app/dev/colab/detail/group/[id]/page.tsx index 2fecdb0c..420aa361 100644 --- a/src/app/dev/colab/detail/group/[id]/page.tsx +++ b/src/app/dev/colab/detail/group/[id]/page.tsx @@ -1,5 +1,8 @@ import adminColab_getOneRoomChatById from "@/app_modules/admin/colab/fun/get/get_one_room_chat_by_id"; -import { Colab_GroupChatView } from "@/app_modules/colab"; +import { + Colab_DetailGrupDiskusi, + Colab_GroupChatView, +} from "@/app_modules/colab"; import colab_getMessageByRoomId from "@/app_modules/colab/fun/get/room_chat/get_message_by_room_id"; import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token"; import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id"; @@ -16,14 +19,15 @@ export default async function Page({ params }: { params: { id: string } }) { ]); let listMsg = await colab_getMessageByRoomId({ roomId: roomId, page: 1 }); const dataUserLogin = await user_getOneByUserId(userLoginId); - // console.log(dataUserLogin); return ( <> - {/* */} - - - ); -} diff --git a/src/app/dev/investasi/main/loading.tsx b/src/app/dev/investasi/main/loading.tsx deleted file mode 100644 index d8a1c040..00000000 --- a/src/app/dev/investasi/main/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app_modules/colab/component/button/button_update_beranda.tsx b/src/app_modules/colab/component/button/button_update_beranda.tsx new file mode 100644 index 00000000..05e00f56 --- /dev/null +++ b/src/app_modules/colab/component/button/button_update_beranda.tsx @@ -0,0 +1,45 @@ +import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { Affix, rem, Center, Button } from "@mantine/core"; +import { useState } from "react"; +import colab_getListAllProyek from "../../fun/get/get_list_all_proyek"; + +export function ComponentColab_ButtonUpdateBeranda({ + onLoad, + setIsNewPost, +}: { + onLoad: (val: any) => void; + setIsNewPost: any; +}) { + const [isLoading, setIsLoading] = useState(false); + + async function onLoadData() { + const loadData = await colab_getListAllProyek({ page: 1 }); + onLoad(loadData); + setIsNewPost(false); + } + + return ( + <> + +
+ +
+
+ + ); +} diff --git a/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx b/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx index e9577049..ca448347 100644 --- a/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx +++ b/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx @@ -128,7 +128,7 @@ export default function ComponentColab_AuthorNameOnListPartisipan({ radius={"xl"} variant="transparent" > - + ) : ( "" diff --git a/src/app_modules/colab/component/detail/list_partisipasi_user.tsx b/src/app_modules/colab/component/detail/list_partisipasi_user.tsx index 6f9f4153..aab5568a 100644 --- a/src/app_modules/colab/component/detail/list_partisipasi_user.tsx +++ b/src/app_modules/colab/component/detail/list_partisipasi_user.tsx @@ -19,18 +19,17 @@ import { Stack, Text, Textarea, - Title + Title, } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import { IconX } from "@tabler/icons-react"; import { useState } from "react"; import colab_funCreatePartisipan from "../../fun/create/fun_create_partisipan_by_user_id"; import colab_getListPartisipanByColabId from "../../fun/get/get_list_partisipan_by_id"; -import { - MODEL_COLLABORATION_PARTISIPASI -} from "../../model/interface"; +import { MODEL_COLLABORATION_PARTISIPASI } from "../../model/interface"; import ComponentColab_AuthorNameOnListPartisipan from "./header_author_list_partisipan"; - +import notifikasiToUser_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_user"; +import mqtt_client from "@/util/mqtt_client"; export default function ComponentColab_DetailListPartisipasiUser({ listPartisipan, userLoginId, @@ -50,22 +49,43 @@ export default function ComponentColab_DetailListPartisipasiUser({ const [deskripsi, setDeskripsi] = useState(""); async function onJoin() { - await colab_funCreatePartisipan( + const res = await colab_funCreatePartisipan( colabId as any, userLoginId as any, deskripsi - ).then(async (res) => { - if (res.status === 201) { - await colab_getListPartisipanByColabId(colabId as any).then((val) => { - setApply(true); - close(); - setData(val as any); - ComponentGlobal_NotifikasiBerhasil(res.message); - }); - } else { - ComponentGlobal_NotifikasiGagal(res.message); + ); + if (res.status === 201) { + const dataNotif = { + appId: res?.data?.ProjectCollaboration?.id, + userId: res?.data?.ProjectCollaboration?.userId, + pesan: res?.data?.ProjectCollaboration?.title, + status: "Partisipan Project", + kategoriApp: "COLLABORATION", + title: "Partisipan baru telah bergabung !", + }; + + const createNotifikasi = await notifikasiToUser_funCreate({ + data: dataNotif as any, + }); + + if (createNotifikasi.status === 201) { + mqtt_client.publish( + "USER", + JSON.stringify({ + userId: dataNotif.userId, + count: 1, + }) + ); } - }); + + const resList = await colab_getListPartisipanByColabId(colabId as any); + setApply(true); + close(); + setData(resList as any); + ComponentGlobal_NotifikasiBerhasil(res.message); + } else { + ComponentGlobal_NotifikasiGagal(res.message); + } } return ( @@ -104,7 +124,7 @@ export default function ComponentColab_DetailListPartisipasiUser({