# Forum
## feat - Tampilan forum - Tampilan forumku - Tampilan komentar - Tampilam posting - Tampilan Detail posting - Tampilan Edit postinf - Tampilan edit komentat - Tampilan report posting - Tampilan report komentar ### No issuee
This commit is contained in:
84
src/app_modules/forum/edit/komentar/index.tsx
Normal file
84
src/app_modules/forum/edit/komentar/index.tsx
Normal file
@@ -0,0 +1,84 @@
|
||||
"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/component_global/loading_page_v2";
|
||||
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
import React, { useState } from "react";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_forum_loading_edit_posting } from "../../global_state";
|
||||
const ReactQuill = dynamic(
|
||||
() => {
|
||||
return import("react-quill");
|
||||
},
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
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 (
|
||||
<>
|
||||
<Stack>
|
||||
<Paper withBorder shadow="lg">
|
||||
<ReactQuill
|
||||
theme="bubble"
|
||||
placeholder="Apa yang sedang hangat dibicarakan ?"
|
||||
style={{ height: 150 }}
|
||||
onChange={(val) => {
|
||||
setValue(val);
|
||||
}}
|
||||
/>
|
||||
</Paper>
|
||||
<Group position="right">
|
||||
{/* <ActionIcon>
|
||||
<IconPhotoUp />
|
||||
</ActionIcon> */}
|
||||
<ButtonAction />
|
||||
</Group>
|
||||
</Stack>
|
||||
<div dangerouslySetInnerHTML={{ __html: value }} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction() {
|
||||
const router = useRouter();
|
||||
const [loadingEdit, setLoadingEdit] = useAtom(gs_forum_loading_edit_posting);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button radius={"xl"} onClick={() => {
|
||||
router.back()
|
||||
|
||||
}}>
|
||||
Update
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
21
src/app_modules/forum/edit/komentar/layout.tsx
Normal file
21
src/app_modules/forum/edit/komentar/layout.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentForum_HeaderTamplate from "../../component/header/header_tamplate";
|
||||
|
||||
export default function LayoutForum_EditKomentar({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
header={<ComponentForum_HeaderTamplate title="Edit Komentar" />}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
84
src/app_modules/forum/edit/posting/index.tsx
Normal file
84
src/app_modules/forum/edit/posting/index.tsx
Normal file
@@ -0,0 +1,84 @@
|
||||
"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/component_global/loading_page_v2";
|
||||
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
import React, { useState } from "react";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_forum_loading_edit_posting } from "../../global_state";
|
||||
const ReactQuill = dynamic(
|
||||
() => {
|
||||
return import("react-quill");
|
||||
},
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
export default function Forum_EditPosting() {
|
||||
const [value, setValue] = useState("");
|
||||
const [reload, setReload] = useState(false);
|
||||
useShallowEffect(() => {
|
||||
if (window && window.document) setReload(true);
|
||||
}, []);
|
||||
|
||||
if (!reload)
|
||||
return (
|
||||
<>
|
||||
<ComponentGlobal_V2_LoadingPage />
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<Paper withBorder shadow="lg">
|
||||
<ReactQuill
|
||||
theme="bubble"
|
||||
placeholder="Apa yang sedang hangat dibicarakan ?"
|
||||
style={{ height: 150 }}
|
||||
onChange={(val) => {
|
||||
setValue(val);
|
||||
}}
|
||||
/>
|
||||
</Paper>
|
||||
<Group position="right">
|
||||
{/* <ActionIcon>
|
||||
<IconPhotoUp />
|
||||
</ActionIcon> */}
|
||||
<ButtonAction />
|
||||
</Group>
|
||||
</Stack>
|
||||
<div dangerouslySetInnerHTML={{ __html: value }} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonAction() {
|
||||
const router = useRouter();
|
||||
const [loadingEdit, setLoadingEdit] = useAtom(gs_forum_loading_edit_posting);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button radius={"xl"} onClick={() => {
|
||||
router.back()
|
||||
|
||||
}}>
|
||||
Update
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
21
src/app_modules/forum/edit/posting/layout.tsx
Normal file
21
src/app_modules/forum/edit/posting/layout.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentForum_HeaderTamplate from "../../component/header/header_tamplate";
|
||||
|
||||
export default function LayoutForum_EditPosting({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
header={<ComponentForum_HeaderTamplate title="Edit Postingan" />}
|
||||
>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user