fix loading hapus forum

This commit is contained in:
2025-05-21 15:45:01 +08:00
parent 693554ac55
commit e8c897242e
9 changed files with 53 additions and 136 deletions

View File

@@ -1,9 +0,0 @@
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
export default async function Page() {
return (
<>
<ComponentGlobal_V2_LoadingPage />
</>
);
}

View File

@@ -1,9 +0,0 @@
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
export default async function Page() {
return (
<>
<ComponentGlobal_V2_LoadingPage/>
</>
);
}

View File

@@ -27,11 +27,10 @@ import {
Stack,
Switch,
Table,
Text,
TextInput,
Text
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { IconFilter, IconPencil, IconPlus } from "@tabler/icons-react";
import { IconPencil, IconPlus } from "@tabler/icons-react";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { useRouter } from "next/navigation";
import { useState } from "react";
@@ -39,7 +38,6 @@ import {
apiAdminGetSticker,
apiAdminUpdateStatusStickerById,
} from "../../lib/api_fetch_stiker";
import loading from "@/app/dev/(user)/investasi/dialog_page/create/loading";
export default function AdminAppInformation_ViewSticker() {
const router = useRouter();

View File

@@ -21,11 +21,11 @@ export default function InvalidUser() {
method: "GET",
});
router.push("/login", {scroll: false});
} catch (error) {
console.error("Gagal menghapus cookie:", error);
} finally {
setIsLoading(false);
}
} catch (error) {
setIsLoading(false);
console.error("Gagal menghapus cookie:", error);
}
};
return (
@@ -33,8 +33,7 @@ export default function InvalidUser() {
<UIGlobal_LayoutDefault>
<Stack align="center" justify="center" spacing="md" h={"100vh"}>
<Title order={2} c={MainColor.white}>
{" "}
Invalid User
Maaf, Anda tidak memiliki izin untuk mengakses halaman ini. Silakan logout terlebih dahulu.
</Title>
<Button
loading={isLoading}
@@ -44,7 +43,7 @@ export default function InvalidUser() {
deleteCookie();
}}
>
Logout
Keluar
</Button>
</Stack>
</UIGlobal_LayoutDefault>

View File

@@ -1,57 +1,46 @@
"use client";
import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
import {
Stack,
Grid,
Avatar,
Divider,
Text,
Group,
ThemeIcon,
ActionIcon,
Badge,
Button,
Drawer,
Loader,
Modal,
Title,
} from "@mantine/core";
import { useRouter } from "next/navigation";
import moment from "moment";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { RouterForum } from "@/lib/router_hipmi/router_forum";
import {
IconCircleFilled,
IconDots,
IconEdit,
IconFlag3,
IconMessageCircle,
IconSquareCheck,
IconSquareRoundedX,
IconTrash,
} from "@tabler/icons-react";
import { IconCircle } from "@tabler/icons-react";
import ComponentForum_PostingButtonMore from "../more_button/posting_button_more";
import ComponentForum_DetailMoreButton from "../more_button/detail_more_button";
import { MODEL_FORUM_POSTING } from "../../model/interface";
import { useDisclosure } from "@mantine/hooks";
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { useState } from "react";
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
import { forum_getOnePostingById } from "../../fun/get/get_one_posting_by_id";
import mqtt_client from "@/util/mqtt_client";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { RouterForum } from "@/lib/router_hipmi/router_forum";
import { clientLogger } from "@/util/clientLogger";
import mqtt_client from "@/util/mqtt_client";
import {
ActionIcon,
Avatar,
Badge,
Button,
Drawer,
Grid,
Group,
Loader,
Modal,
Stack,
Text,
Title,
} from "@mantine/core";
import { useDisclosure } from "@mantine/hooks";
import {
IconDots,
IconEdit,
IconFlag3,
IconSquareCheck,
IconSquareRoundedX,
IconTrash,
} from "@tabler/icons-react";
import _ from "lodash";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
import { MODEL_FORUM_POSTING } from "../../model/interface";
export default function ComponentForum_DetailHeader({
data,
@@ -342,8 +331,6 @@ function ButtonDelete({
const router = useRouter();
const [loading, setLoading] = useState(false);
if (loading) return <ComponentGlobal_V2_LoadingPage />;
async function onDelete() {
try {
setLoading(true);

View File

@@ -1,7 +1,7 @@
"use client";
import { RouterForum } from "@/lib/router_hipmi/router_forum";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { RouterForum } from "@/lib/router_hipmi/router_forum";
import {
ActionIcon,
Button,
@@ -23,13 +23,11 @@ import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { forum_funDeleteKomentarById } from "../../fun/delete/fun_delete_komentar_by_id";
import { forum_funGetAllKomentarById } from "../../fun/get/get_all_komentar_by_id";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
import { MODEL_FORUM_KOMENTAR } from "../../model/interface";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import _ from "lodash";
import { forum_funDeleteKomentarById } from "../../fun/delete/fun_delete_komentar_by_id";
import { MODEL_FORUM_KOMENTAR } from "../../model/interface";
export default function ComponentForum_KomentarButtonMore({
userId,

View File

@@ -1,7 +1,7 @@
"use client";
import { RouterForum } from "@/lib/router_hipmi/router_forum";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { RouterForum } from "@/lib/router_hipmi/router_forum";
import {
ActionIcon,
Button,
@@ -24,8 +24,6 @@ import {
} from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { IconSquareCheck } from "@tabler/icons-react";
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
@@ -51,8 +49,6 @@ export default function ComponentForum_DetailMoreButton({
const [loadingEdit, setLoadingEdit] = useState(false);
const [loadingReport, setLoadingReport] = useState(false);
// if (loadingEdit) return <ComponentGlobal_V2_LoadingPage />;
return (
<>
<Drawer
@@ -194,8 +190,6 @@ function ButtonDelete({
const router = useRouter();
const [loading, setLoading] = useState(false);
if (loading) return <ComponentGlobal_V2_LoadingPage />;
async function onDelete() {
setOpenDel(false);
await forum_funDeletePostingById(postingId as any).then((res) => {

View File

@@ -1,13 +1,11 @@
"use client";
import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
import UI_NewLayoutTamplate, {
UI_NewChildren,
UI_NewHeader,
} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { useRouter } from "next/navigation";
import React, { useState } from "react";
import React from "react";
export const dynamic = "force-dynamic";
export default function LayoutForum_Detail({
@@ -15,21 +13,8 @@ export default function LayoutForum_Detail({
}: {
children: React.ReactNode;
}) {
const router = useRouter();
const [loading, setLoading] = useState(false);
if (loading) return <ComponentGlobal_V2_LoadingPage />;
return (
<>
{/* <UIGlobal_LayoutTamplate
header={
<UIGlobal_LayoutHeaderTamplate title="Postingan" posotion={"left"} />
}
>
{children}
</UIGlobal_LayoutTamplate> */}
<UI_NewLayoutTamplate>
<UI_NewHeader>
<Component_Header title="Postingan" posotion={"left"} />

View File

@@ -1,24 +1,12 @@
"use client";
import {
ActionIcon,
Button,
Center,
Group,
Loader,
Paper,
Stack,
} from "@mantine/core";
import "react-quill/dist/quill.snow.css";
import "react-quill/dist/quill.bubble.css";
import { IconPhotoUp } from "@tabler/icons-react";
import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
import dynamic from "next/dynamic";
import React, { useState } from "react";
import { Button, Group, Paper, Stack } from "@mantine/core";
import { useAtom } from "jotai";
import dynamic from "next/dynamic";
import { useRouter } from "next/navigation";
import { useState } from "react";
import "react-quill/dist/quill.bubble.css";
import "react-quill/dist/quill.snow.css";
import { gs_forum_loading_edit_posting } from "../../global_state";
const ReactQuill = dynamic(
() => {
@@ -29,17 +17,6 @@ const ReactQuill = dynamic(
export default function Forum_EditKomentar() {
const [value, setValue] = useState("");
const [reload, setReload] = useState(false);
useShallowEffect(() => {
if (window && window.document) setReload(true);
}, []);
if (!reload)
return (
<>
<ComponentGlobal_V2_LoadingPage />
</>
);
return (
<>
@@ -55,9 +32,6 @@ export default function Forum_EditKomentar() {
/>
</Paper>
<Group position="right">
{/* <ActionIcon>
<IconPhotoUp />
</ActionIcon> */}
<ButtonAction />
</Group>
</Stack>