- Deskripsi:
- Notifikasi collaboration
## Issue: Scroll dari chat akan di ubah dengan package yang mas malik buat
This commit is contained in:
2024-07-29 10:07:52 +08:00
parent 01114e8405
commit 810ce1c00d
42 changed files with 892 additions and 997 deletions

View File

@@ -1,20 +1,19 @@
"use client";
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { event_getListAllPublish } from "@/app_modules/event/fun/get/get_list_all_publish";
import {
Box,
Center,
Loader
} from "@mantine/core";
import mqtt_client from "@/util/mqtt_client";
import { Affix, Box, Button, Center, Loader, rem } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
import { ComponentColab_CardBeranda } from "../component/card_view/card_beranda";
import { MODEL_COLLABORATION } from "../model/interface";
import colab_getListAllProyek from "../fun/get/get_list_all_proyek";
import { MODEL_COLLABORATION } from "../model/interface";
import { ComponentColab_ButtonUpdateBeranda } from "../component/button/button_update_beranda";
export default function Colab_Beranda({
listData,
@@ -26,9 +25,30 @@ export default function Colab_Beranda({
const [data, setData] = useState(listData);
const [activePage, setActivePage] = useState(1);
const [isNewPost, setIsNewPost] = useState(false);
useShallowEffect(() => {
mqtt_client.subscribe("Colab_create");
mqtt_client.on("message", (topic, message) => {
if (topic === "Colab_create") {
setIsNewPost(JSON.parse(message.toString()).isNewPost);
}
});
}, []);
return (
<>
<Box>
{isNewPost && (
<ComponentColab_ButtonUpdateBeranda
onLoad={(val) => {
setData(val);
}}
setIsNewPost={setIsNewPost}
/>
)}
<ComponentGlobal_CreateButton path={RouterColab.create} />
{_.isEmpty(data) ? (

View File

@@ -1,33 +1,19 @@
"use client";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import {
Box,
Center,
Grid,
Group,
Loader,
Paper,
Stack,
Text,
Title,
Loader
} from "@mantine/core";
import ComponentColab_AuthorNameOnHeader from "../../component/header_author_name";
import { IconChevronCompactRight, IconChevronRight } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
import {
MODEL_COLLABORATION_ANGGOTA_ROOM_CHAT,
MODEL_COLLABORATION_ROOM_CHAT,
} from "../../model/interface";
import { useState } from "react";
import _ from "lodash";
import ComponentColab_IsEmptyData from "../../component/is_empty_data";
import { ComponentColab_CardGrup } from "../../component/card_view/crad_grup";
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { ScrollOnly } from "next-scroll-loader";
import colab_getListAllProyek from "../../fun/get/get_list_all_proyek";
import { useState } from "react";
import { ComponentColab_CardGrup } from "../../component/card_view/crad_grup";
import colab_getListRoomChatByAuthorId from "../../fun/get/room_chat/get_list_room_by_author_id";
import {
MODEL_COLLABORATION_ANGGOTA_ROOM_CHAT
} from "../../model/interface";
export default function Colab_GrupDiskus({
listRoom,