Fix : Avatar
Deskripsi: - Ubah avatar yang image nya di ambil dari storage wibu server - Avatar forum - Avatra job - Avatar Investasi - Avatar donasi ## No Issuee
This commit is contained in:
@@ -93,6 +93,11 @@ export default function ComponentForum_DetailCreateKomentar({
|
||||
onChange={(val) => {
|
||||
setValue(val);
|
||||
}}
|
||||
style={{
|
||||
overflowY: "auto",
|
||||
maxHeight: 100,
|
||||
minHeight: 50,
|
||||
}}
|
||||
/>
|
||||
</Paper>
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ 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";
|
||||
|
||||
export default function ComponentForum_DetailHeader({
|
||||
data,
|
||||
@@ -59,6 +61,7 @@ export default function ComponentForum_DetailHeader({
|
||||
onLoadData: (val: any) => void;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -68,30 +71,38 @@ export default function ComponentForum_DetailHeader({
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
if (data?.Author?.id) {
|
||||
setIsLoading(true);
|
||||
router.push(RouterForum.forumku + data?.Author?.id);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
size={40}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
data?.Author.Profile.imagesId
|
||||
? RouterProfile.api_foto_profile +
|
||||
data?.Author.Profile.imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
{isLoading ? (
|
||||
<Avatar
|
||||
size={40}
|
||||
radius={"100%"}
|
||||
style={{
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: "1px",
|
||||
}}
|
||||
>
|
||||
<ComponentGlobal_Loader variant="dots" />
|
||||
</Avatar>
|
||||
) : (
|
||||
<ComponentGlobal_LoaderAvatar
|
||||
fileId={data?.Author.Profile?.imageId as any}
|
||||
/>
|
||||
)}
|
||||
</Grid.Col>
|
||||
|
||||
<Grid.Col span={"auto"}>
|
||||
<Stack spacing={3}>
|
||||
<Text lineClamp={1} fz={"sm"} fw={"bold"} color="white">
|
||||
{data?.Author.username ? data?.Author.username : "Nama author "}
|
||||
{data?.Author.Profile.name
|
||||
? data?.Author.Profile.name
|
||||
: "Nama author "}
|
||||
</Text>
|
||||
<Badge
|
||||
w={70}
|
||||
@@ -102,11 +113,7 @@ export default function ComponentForum_DetailHeader({
|
||||
: "red"
|
||||
}
|
||||
>
|
||||
<Text fz={10}>
|
||||
{(data?.ForumMaster_StatusPosting.id as any) === 1
|
||||
? "Open"
|
||||
: "Close"}
|
||||
</Text>
|
||||
<Text fz={10}>{data?.ForumMaster_StatusPosting.status}</Text>
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Stack,
|
||||
Center,
|
||||
Box,
|
||||
Card,
|
||||
Spoiler,
|
||||
Divider,
|
||||
Text,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Text
|
||||
} from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
import { MODEL_FORUM_KOMENTAR } from "../../model/interface";
|
||||
import ComponentForum_KomentarAuthorNameOnHeader from "../komentar_component/komentar_author_header_name";
|
||||
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
export default function ComponentForum_KomentarView({
|
||||
data,
|
||||
@@ -30,8 +26,6 @@ export default function ComponentForum_KomentarView({
|
||||
<Card mb={"xs"} bg={"transparent"}>
|
||||
<Card.Section>
|
||||
<ComponentForum_KomentarAuthorNameOnHeader
|
||||
authorName={data?.Author?.username}
|
||||
imagesId={data?.Author?.Profile?.imagesId}
|
||||
tglPublish={data?.createdAt}
|
||||
userId={data?.Author?.id}
|
||||
komentarId={data?.id}
|
||||
@@ -39,6 +33,7 @@ export default function ComponentForum_KomentarView({
|
||||
setKomentar={setKomentar}
|
||||
postingId={postingId}
|
||||
userLoginId={userLoginId}
|
||||
profile={data.Author.Profile}
|
||||
/>
|
||||
</Card.Section>
|
||||
<Card.Section sx={{ zIndex: 0 }} p={"sm"}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { Card, Stack, Group, Text } from "@mantine/core";
|
||||
import { Card, Stack, Group, Text, Box } from "@mantine/core";
|
||||
import { IconMessageCircle, IconMessageCircleX } from "@tabler/icons-react";
|
||||
import { MODEL_FORUM_POSTING } from "../../model/interface";
|
||||
import ComponentForum_DetailHeader from "./detail_header";
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||
|
||||
export default function ComponentForum_DetailForumView({
|
||||
data,
|
||||
@@ -22,19 +23,9 @@ export default function ComponentForum_DetailForumView({
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
mb={"md"}
|
||||
p={"xl"}
|
||||
bg={MainColor.darkblue}
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
}}
|
||||
radius={"md"}
|
||||
>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
|
||||
{/* HEADER */}
|
||||
<Card.Section>
|
||||
<ComponentGlobal_CardStyles>
|
||||
<Stack>
|
||||
{/* HEADER */}
|
||||
<ComponentForum_DetailHeader
|
||||
data={data}
|
||||
userLoginId={userLoginId}
|
||||
@@ -42,11 +33,9 @@ export default function ComponentForum_DetailForumView({
|
||||
onLoadData(val);
|
||||
}}
|
||||
/>
|
||||
</Card.Section>
|
||||
|
||||
{/* CONTENT */}
|
||||
<Card.Section sx={{ zIndex: 0 }} p={"lg"}>
|
||||
<Stack spacing={"xs"}>
|
||||
{/* CONTENT */}
|
||||
<Box p={"lg"} >
|
||||
<Text fz={"sm"} color="white">
|
||||
{data?.diskusi ? (
|
||||
<div dangerouslySetInnerHTML={{ __html: data?.diskusi }} />
|
||||
@@ -54,11 +43,9 @@ export default function ComponentForum_DetailForumView({
|
||||
""
|
||||
)}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Box>
|
||||
|
||||
{/* FOOTER */}
|
||||
<Card.Section>
|
||||
{/* FOOTER */}
|
||||
<Stack>
|
||||
<Group position="apart">
|
||||
<Group spacing={"xs"} px={"sm"}>
|
||||
@@ -94,8 +81,8 @@ export default function ComponentForum_DetailForumView({
|
||||
</Group>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
</Stack>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@ import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_FORUM_POSTING } from "../../model/interface";
|
||||
import ComponentForum_ForumkuMoreButton from "./forumku_more_button";
|
||||
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
|
||||
|
||||
export default function ComponentForum_ForumkuHeaderCard({
|
||||
data,
|
||||
@@ -25,7 +26,6 @@ export default function ComponentForum_ForumkuHeaderCard({
|
||||
allData: any[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -35,29 +35,15 @@ export default function ComponentForum_ForumkuHeaderCard({
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
if (data.Author.id) {
|
||||
setIsLoading(true);
|
||||
router.push(RouterForum.forumku + data.Author.id);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
||||
}
|
||||
}}
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader color="gray" variant="dots" />
|
||||
) : (
|
||||
<Avatar
|
||||
size={40}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
data.Author.Profile.imagesId
|
||||
? RouterProfile.api_foto_profile +
|
||||
data.Author.Profile.imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<ComponentGlobal_LoaderAvatar
|
||||
fileId={data.Author.Profile.imageId as any}
|
||||
/>
|
||||
</Grid.Col>
|
||||
|
||||
<Grid.Col span={"auto"}>
|
||||
@@ -82,7 +68,9 @@ export default function ComponentForum_ForumkuHeaderCard({
|
||||
: "red"
|
||||
}
|
||||
>
|
||||
<Text c={"white"} fz={10}>{data?.ForumMaster_StatusPosting.status}</Text>
|
||||
<Text c={"white"} fz={10}>
|
||||
{data?.ForumMaster_StatusPosting.status}
|
||||
</Text>
|
||||
</Badge>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
@@ -90,7 +78,7 @@ export default function ComponentForum_ForumkuHeaderCard({
|
||||
<Grid.Col span={"content"}>
|
||||
<Group position="center" spacing={"xs"}>
|
||||
<Group spacing={3}>
|
||||
<Text c={"white"} fz={"sm"} >
|
||||
<Text c={"white"} fz={"sm"}>
|
||||
{data.createdAt !== undefined && data?.createdAt
|
||||
? new Date(data?.createdAt).toLocaleDateString(["id-ID"], {
|
||||
day: "numeric",
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import { ActionIcon, Card, Divider, Group, Stack, Text } from "@mantine/core";
|
||||
import {
|
||||
ComponentGlobal_CardLoadingOverlay,
|
||||
ComponentGlobal_CardStyles,
|
||||
} from "@/app_modules/_global/component";
|
||||
import { Box, Group, Stack, Text } from "@mantine/core";
|
||||
import { IconMessageCircle, IconMessageCircleX } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_FORUM_POSTING } from "../../model/interface";
|
||||
import ComponentForum_ForumkuHeaderCard from "./forumku_header";
|
||||
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
|
||||
|
||||
export default function ComponentForum_ForumkuMainCardView({
|
||||
data,
|
||||
@@ -22,23 +24,12 @@ export default function ComponentForum_ForumkuMainCardView({
|
||||
allData: any[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loadingKomen, setLoadingKomen] = useState(false);
|
||||
const [loadingDetail, setLoadingDetail] = useState(false);
|
||||
|
||||
const [postingId, setPostingId] = useState("");
|
||||
const [visable, setVisible] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
mb={"md"}
|
||||
p={"xl"}
|
||||
bg={MainColor.darkblue}
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
}}
|
||||
radius={"md"}
|
||||
>
|
||||
<Card.Section>
|
||||
<ComponentGlobal_CardStyles>
|
||||
<Stack>
|
||||
<ComponentForum_ForumkuHeaderCard
|
||||
data={data}
|
||||
isMoreButton={true}
|
||||
@@ -46,42 +37,40 @@ export default function ComponentForum_ForumkuMainCardView({
|
||||
onLoadData={onLoadData}
|
||||
allData={allData}
|
||||
/>
|
||||
</Card.Section>
|
||||
|
||||
<Card.Section
|
||||
sx={{ zIndex: 0 }}
|
||||
p={"lg"}
|
||||
onClick={() => {
|
||||
router.push(RouterForum.main_detail + data?.id);
|
||||
}}
|
||||
>
|
||||
<Text c={"white"} fz={"sm"} lineClamp={4}>
|
||||
<div dangerouslySetInnerHTML={{ __html: data?.diskusi }} />
|
||||
</Text>
|
||||
</Card.Section>
|
||||
<Box
|
||||
sx={{ zIndex: 0 }}
|
||||
p={"lg"}
|
||||
onClick={() => {
|
||||
setVisible(true);
|
||||
router.push(RouterForum.main_detail + data?.id);
|
||||
}}
|
||||
>
|
||||
<Text c={"white"} fz={"sm"} lineClamp={4}>
|
||||
<div dangerouslySetInnerHTML={{ __html: data?.diskusi }} />
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Group spacing={"xs"} px={"sm"}>
|
||||
<ActionIcon
|
||||
loading={loadingKomen && data?.id === postingId ? true : false}
|
||||
variant="transparent"
|
||||
sx={{ zIndex: 1 }}
|
||||
>
|
||||
{(data?.ForumMaster_StatusPosting?.id as any) === 1 ? (
|
||||
<IconMessageCircle color="white" size={25} />
|
||||
) : (
|
||||
<IconMessageCircleX color="gray" size={25} />
|
||||
)}
|
||||
</ActionIcon>
|
||||
<Group spacing={"xs"} px={"sm"}>
|
||||
{(data?.ForumMaster_StatusPosting?.id as any) === 1 ? (
|
||||
<IconMessageCircle color="white" size={25} />
|
||||
) : (
|
||||
<IconMessageCircleX color="gray" size={25} />
|
||||
)}
|
||||
|
||||
{/* <TotalKomentar postingId={e?.id} /> */}
|
||||
|
||||
<Text c={(data?.ForumMaster_StatusPosting?.id as any) === 1 ? "white" : "gray"}>{data?.Forum_Komentar.length}</Text>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
<Text
|
||||
c={
|
||||
(data?.ForumMaster_StatusPosting?.id as any) === 1
|
||||
? "white"
|
||||
: "gray"
|
||||
}
|
||||
>
|
||||
{data?.Forum_Komentar.length}
|
||||
</Text>
|
||||
</Group>
|
||||
{visable && <ComponentGlobal_CardLoadingOverlay />}
|
||||
</Stack>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,50 +1,41 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { Stack, Grid, Avatar, Divider, Text, Group } 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 "@/app/lib/router_hipmi/router_forum";
|
||||
import {
|
||||
IconCircleFilled,
|
||||
IconDots,
|
||||
IconEdit,
|
||||
IconFlag3,
|
||||
IconMessageCircle,
|
||||
IconTrash,
|
||||
} from "@tabler/icons-react";
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { Avatar, Divider, Grid, Group, Stack, Text } from "@mantine/core";
|
||||
import { IconCircle } from "@tabler/icons-react";
|
||||
import { IoIosMore } from "react-icons/io";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { useState } from "react";
|
||||
import ComponentForum_PostingButtonMore from "../more_button/posting_button_more";
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentForum_KomentarButtonMore from "./komentar_button_more";
|
||||
import { useState } from "react";
|
||||
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
import { data } from "autoprefixer";
|
||||
import { MODEL_PROFILE } from "@/app_modules/katalog/profile/model/interface";
|
||||
|
||||
export default function ComponentForum_KomentarAuthorNameOnHeader({
|
||||
userId,
|
||||
komentarId,
|
||||
imagesId,
|
||||
authorName,
|
||||
tglPublish,
|
||||
isPembatas,
|
||||
isMoreButton,
|
||||
setKomentar,
|
||||
postingId,
|
||||
userLoginId,
|
||||
profile,
|
||||
}: {
|
||||
userId?: string;
|
||||
komentarId?: string;
|
||||
imagesId?: string;
|
||||
authorName?: string;
|
||||
tglPublish?: Date;
|
||||
isPembatas?: boolean;
|
||||
isMoreButton?: boolean;
|
||||
setKomentar?: any;
|
||||
postingId?: string;
|
||||
userLoginId: string;
|
||||
profile: MODEL_PROFILE;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -54,30 +45,35 @@ export default function ComponentForum_KomentarAuthorNameOnHeader({
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
if (userId) {
|
||||
setIsLoading(true);
|
||||
router.push(RouterForum.forumku + userId);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
size={30}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
imagesId
|
||||
? RouterProfile.api_foto_profile + imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
{isLoading ? (
|
||||
<Avatar
|
||||
size={40}
|
||||
radius={"100%"}
|
||||
style={{
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: "1px",
|
||||
}}
|
||||
>
|
||||
<ComponentGlobal_Loader variant="dots" />
|
||||
</Avatar>
|
||||
) : (
|
||||
<ComponentGlobal_LoaderAvatar fileId={profile.imageId as any} />
|
||||
)}
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Stack justify="center" h={"100%"}>
|
||||
<Grid>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text color="white" lineClamp={1} fz={"sm"} fw={"bold"}>
|
||||
{authorName ? authorName : "Nama author "}
|
||||
{profile.name ? profile.name : "Nama author "}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
@@ -3,20 +3,14 @@
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Grid,
|
||||
Group,
|
||||
Loader,
|
||||
Stack,
|
||||
Text
|
||||
} from "@mantine/core";
|
||||
import { Avatar, Badge, Grid, Group, Loader, Stack, Text } from "@mantine/core";
|
||||
import { IconCircle } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_FORUM_POSTING } from "../../model/interface";
|
||||
import ComponentForum_BerandaMoreButton from "./card_more_button";
|
||||
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
|
||||
export default function ComponentForum_BerandaHeaderCard({
|
||||
data,
|
||||
@@ -50,23 +44,20 @@ export default function ComponentForum_BerandaHeaderCard({
|
||||
}}
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader color="gray" variant="dots" />
|
||||
) : (
|
||||
<Avatar
|
||||
size={40}
|
||||
sx={{
|
||||
radius={"100%"}
|
||||
style={{
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: "1px",
|
||||
borderColor: "white",
|
||||
}}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
data.Author.Profile.imagesId
|
||||
? RouterProfile.api_foto_profile +
|
||||
data.Author.Profile.imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
>
|
||||
<ComponentGlobal_Loader variant="dots" />
|
||||
</Avatar>
|
||||
) : (
|
||||
<ComponentGlobal_LoaderAvatar
|
||||
fileId={data.Author.Profile.imageId as any}
|
||||
/>
|
||||
)}
|
||||
</Grid.Col>
|
||||
@@ -76,8 +67,8 @@ export default function ComponentForum_BerandaHeaderCard({
|
||||
<Grid>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text lineClamp={1} fz={"sm"} fw={"bold"} color={"white"}>
|
||||
{data.Author.username
|
||||
? data.Author.username
|
||||
{data.Author.Profile.name
|
||||
? data.Author.Profile.name
|
||||
: "Nama author "}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ActionIcon, Card, Group, Stack, Text } from "@mantine/core";
|
||||
ComponentGlobal_CardLoadingOverlay,
|
||||
ComponentGlobal_CardStyles,
|
||||
} from "@/app_modules/_global/component";
|
||||
import { Box, Group, Stack, Text } from "@mantine/core";
|
||||
import { IconMessageCircle, IconMessageCircleX } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
@@ -24,23 +24,12 @@ export default function ComponentForum_BerandaCardView({
|
||||
allData: any[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loadingKomen, setLoadingKomen] = useState(false);
|
||||
const [loadingDetail, setLoadingDetail] = useState(false);
|
||||
|
||||
const [postingId, setPostingId] = useState("");
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
mb={"md"}
|
||||
p={"xl"}
|
||||
bg={MainColor.darkblue}
|
||||
style={{
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
}}
|
||||
radius={"md"}
|
||||
>
|
||||
<Card.Section>
|
||||
<ComponentGlobal_CardStyles>
|
||||
<Stack>
|
||||
<ComponentForum_BerandaHeaderCard
|
||||
data={data}
|
||||
isMoreButton={true}
|
||||
@@ -48,42 +37,39 @@ export default function ComponentForum_BerandaCardView({
|
||||
onLoadData={onLoadData}
|
||||
allData={allData}
|
||||
/>
|
||||
</Card.Section>
|
||||
|
||||
<Card.Section
|
||||
sx={{ zIndex: 0 }}
|
||||
p={"lg"}
|
||||
onClick={() => {
|
||||
router.push(RouterForum.main_detail + data?.id);
|
||||
}}
|
||||
>
|
||||
<Text c="white" fz={"sm"} lineClamp={4}>
|
||||
<div dangerouslySetInnerHTML={{ __html: data?.diskusi }} />
|
||||
</Text>
|
||||
</Card.Section>
|
||||
<Box
|
||||
sx={{ zIndex: 0 }}
|
||||
p={"lg"}
|
||||
onClick={() => {
|
||||
setVisible(true), router.push(RouterForum.main_detail + data?.id);
|
||||
}}
|
||||
>
|
||||
<Text c="white" fz={"sm"} lineClamp={4}>
|
||||
<div dangerouslySetInnerHTML={{ __html: data?.diskusi }} />
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Group spacing={"xs"} px={"sm"}>
|
||||
<ActionIcon
|
||||
loading={loadingKomen && data?.id === postingId ? true : false}
|
||||
variant="transparent"
|
||||
sx={{ zIndex: 1 }}
|
||||
>
|
||||
{(data?.ForumMaster_StatusPosting?.id as any) === 1 ? (
|
||||
<IconMessageCircle color="white" size={25} />
|
||||
) : (
|
||||
<IconMessageCircleX color="gray" size={25} />
|
||||
)}
|
||||
</ActionIcon>
|
||||
<Group spacing={"xs"}>
|
||||
{(data?.ForumMaster_StatusPosting?.id as any) === 1 ? (
|
||||
<IconMessageCircle color="white" size={25} />
|
||||
) : (
|
||||
<IconMessageCircleX color="gray" size={25} />
|
||||
)}
|
||||
|
||||
{/* <TotalKomentar postingId={e?.id} /> */}
|
||||
|
||||
<Text color={(data?.ForumMaster_StatusPosting?.id as any) === 1 ? "white" :"gray"}>{data?.Forum_Komentar.length}</Text>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
<Text
|
||||
color={
|
||||
(data?.ForumMaster_StatusPosting?.id as any) === 1
|
||||
? "white"
|
||||
: "gray"
|
||||
}
|
||||
>
|
||||
{data?.Forum_Komentar.length}
|
||||
</Text>
|
||||
</Group>
|
||||
{visible && <ComponentGlobal_CardLoadingOverlay />}
|
||||
</Stack>
|
||||
</ComponentGlobal_CardStyles>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { Box, Center, Loader, Stack } from "@mantine/core";
|
||||
import { Box, Center, Loader, Stack, TextInput } from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
import { MODEL_FORUM_KOMENTAR, MODEL_FORUM_POSTING } from "../model/interface";
|
||||
|
||||
import mqtt_client from "@/util/mqtt_client";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useState } from "react";
|
||||
@@ -27,7 +26,6 @@ export default function Forum_MainDetail({
|
||||
}) {
|
||||
const [data, setData] = useState(dataPosting);
|
||||
const [lsKomentar, setLsKomentar] = useState(listKomentar);
|
||||
|
||||
const [activePage, setActivePage] = useState(1);
|
||||
|
||||
// useShallowEffect(() => {
|
||||
@@ -90,9 +88,8 @@ export default function Forum_MainDetail({
|
||||
""
|
||||
)}
|
||||
|
||||
<Box >
|
||||
<Box>
|
||||
<ScrollOnly
|
||||
|
||||
height={"60vh"}
|
||||
renderLoading={() => (
|
||||
<Center mt={"lg"}>
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import { pathAssetImage } from "@/app/lib";
|
||||
import { RouterImagePreview } from "@/app/lib/router_hipmi/router_image_preview";
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
|
||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||
import { Avatar, Button, Center, Grid, Stack, Text } from "@mantine/core";
|
||||
import {
|
||||
Avatar,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Grid,
|
||||
Image,
|
||||
Stack,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { IconCircleFilled } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
@@ -21,25 +33,54 @@ export default function ComponentForum_ViewForumProfile({
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [isLoadingImage, setIsLoadingImage] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Center>
|
||||
<Avatar
|
||||
bg={"gray"}
|
||||
radius={"100%"}
|
||||
sx={{
|
||||
borderStyle: "solid",
|
||||
borderWidth: "0.5px",
|
||||
borderColor: AccentColor.yellow,
|
||||
<Box
|
||||
h={100}
|
||||
style={{ borderRadius: "50%" }}
|
||||
onClick={() => {
|
||||
router.push(
|
||||
RouterImagePreview.main({
|
||||
id: auhtorSelectedData.Profile.imageId as any,
|
||||
}),
|
||||
{ scroll: false }
|
||||
);
|
||||
setIsLoadingImage(true);
|
||||
}}
|
||||
size={100}
|
||||
alt="foto"
|
||||
src={
|
||||
RouterProfile.api_foto_profile +
|
||||
auhtorSelectedData?.Profile?.imagesId
|
||||
}
|
||||
/>
|
||||
>
|
||||
{isLoadingImage ? (
|
||||
<Avatar
|
||||
size={100}
|
||||
radius={"100%"}
|
||||
style={{
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: "1px",
|
||||
}}
|
||||
opacity={0.7}
|
||||
>
|
||||
<ComponentGlobal_LoaderAvatar
|
||||
sizeAvatar={100}
|
||||
fileId={auhtorSelectedData.Profile.imageId as any}
|
||||
/>
|
||||
<Image
|
||||
pos={"absolute"}
|
||||
height={50}
|
||||
width={50}
|
||||
alt="Photo"
|
||||
src={pathAssetImage.new_loader}
|
||||
/>
|
||||
</Avatar>
|
||||
) : (
|
||||
<ComponentGlobal_LoaderAvatar
|
||||
sizeAvatar={100}
|
||||
fileId={auhtorSelectedData.Profile.imageId as any}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
</Center>
|
||||
<Grid>
|
||||
<Grid.Col span={"auto"}>
|
||||
@@ -69,7 +110,7 @@ export default function ComponentForum_ViewForumProfile({
|
||||
border: `1px solid ${AccentColor.yellow}`,
|
||||
backgroundColor: MainColor.yellow,
|
||||
}}
|
||||
c="white"
|
||||
c="black"
|
||||
loaderPosition="center"
|
||||
loading={loading ? true : false}
|
||||
radius={"xl"}
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
AccentColor
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||
import {
|
||||
@@ -25,6 +24,7 @@ import ComponentForum_ForumkuMainCardView from "../component/forumku_component/f
|
||||
import { forum_getAllPostingByAuhtorId } from "../fun/get/get_list_posting_by_author_id";
|
||||
import { MODEL_FORUM_POSTING } from "../model/interface";
|
||||
import ComponentForum_ViewForumProfile from "./forum_profile";
|
||||
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
|
||||
|
||||
export default function Forum_Forumku({
|
||||
auhtorSelectedData,
|
||||
@@ -46,32 +46,8 @@ export default function Forum_Forumku({
|
||||
|
||||
return (
|
||||
<>
|
||||
{userLoginId === auhtorSelectedData.id ? (
|
||||
<Affix position={{ bottom: rem(100), right: rem(30) }}>
|
||||
<ActionIcon
|
||||
opacity={scroll.y > 0 ? 0.5 : ""}
|
||||
style={{
|
||||
transition: "0.5s",
|
||||
border: `1px solid ${AccentColor.skyblue}`,
|
||||
}}
|
||||
size={"xl"}
|
||||
radius={"xl"}
|
||||
variant="transparent"
|
||||
bg={AccentColor.blue}
|
||||
onClick={() => {
|
||||
setLoadingCreate(true);
|
||||
router.push(RouterForum.create);
|
||||
}}
|
||||
>
|
||||
{loadingCreate ? (
|
||||
<Loader size={25} />
|
||||
) : (
|
||||
<IconPencilPlus color="white" />
|
||||
)}
|
||||
</ActionIcon>
|
||||
</Affix>
|
||||
) : (
|
||||
""
|
||||
{userLoginId === auhtorSelectedData.id && (
|
||||
<ComponentGlobal_CreateButton path={RouterForum.create} />
|
||||
)}
|
||||
|
||||
<Stack spacing={"xl"}>
|
||||
@@ -92,7 +68,7 @@ export default function Forum_Forumku({
|
||||
) : (
|
||||
// --- Main component --- //
|
||||
<ScrollOnly
|
||||
height={data.length < 5 ? "60vh" : "100vh"}
|
||||
height={data.length < 5 ? "75vh" : "100vh"}
|
||||
renderLoading={() => (
|
||||
<Center mt={"lg"}>
|
||||
<Loader color={"yellow"} />
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
import ComponentForum_HeaderTamplate from "../component/header/header_tamplate";
|
||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||
import { IconX } from "@tabler/icons-react";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { IconX } from "@tabler/icons-react";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutForum_Forumku({
|
||||
children,
|
||||
@@ -20,25 +16,11 @@ export default function LayoutForum_Forumku({
|
||||
<>
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={
|
||||
<UIGlobal_LayoutHeaderTamplate
|
||||
title={`${username}`}
|
||||
iconLeft={<IconX />}
|
||||
/>
|
||||
<UIGlobal_LayoutHeaderTamplate title={"Forum"} iconLeft={<IconX />} />
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</UIGlobal_LayoutTamplate>
|
||||
|
||||
{/* <AppComponentGlobal_LayoutTamplate
|
||||
header={
|
||||
<ComponentForum_HeaderTamplate
|
||||
title={`${username}`}
|
||||
changeIconBack={<IconX />}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</AppComponentGlobal_LayoutTamplate> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export async function forum_funGetAllKomentarById({
|
||||
Profile: {
|
||||
select: {
|
||||
name: true,
|
||||
imagesId: true,
|
||||
imageId: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -35,7 +35,8 @@ export async function forum_getAllPostingByAuhtorId({
|
||||
Profile: {
|
||||
select: {
|
||||
id: true,
|
||||
imagesId: true,
|
||||
name: true,
|
||||
imageId: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -39,7 +39,8 @@ export async function forum_new_getAllPosting({
|
||||
Profile: {
|
||||
select: {
|
||||
id: true,
|
||||
imagesId: true,
|
||||
name: true,
|
||||
imageId: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||
import {
|
||||
ActionIcon,
|
||||
Avatar,
|
||||
Loader
|
||||
} from "@mantine/core";
|
||||
import { ActionIcon, Avatar } from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React, { useState } from "react";
|
||||
|
||||
@@ -21,9 +18,7 @@ export default function LayoutForum_Main({
|
||||
dataAuthor: MODEL_USER;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useState(1);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -36,26 +31,26 @@ export default function LayoutForum_Main({
|
||||
radius={"xl"}
|
||||
variant="transparent"
|
||||
onClick={() => {
|
||||
setLoading(true);
|
||||
setIsLoading(true);
|
||||
router.push(RouterForum.forumku + dataAuthor?.id);
|
||||
}}
|
||||
>
|
||||
{loading ? (
|
||||
<Loader size={20} />
|
||||
) : (
|
||||
{isLoading ? (
|
||||
<Avatar
|
||||
radius={"xl"}
|
||||
size={30}
|
||||
sx={{
|
||||
radius={"100%"}
|
||||
style={{
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: "0.5px",
|
||||
borderColor: "black",
|
||||
borderWidth: "1px",
|
||||
}}
|
||||
alt="foto"
|
||||
src={
|
||||
RouterProfile.api_foto_profile +
|
||||
dataAuthor?.Profile?.imagesId
|
||||
}
|
||||
>
|
||||
<ComponentGlobal_Loader variant="dots" />
|
||||
</Avatar>
|
||||
) : (
|
||||
<ComponentGlobal_LoaderAvatar
|
||||
fileId={dataAuthor.Profile.imageId as any}
|
||||
sizeAvatar={30}
|
||||
/>
|
||||
)}
|
||||
</ActionIcon>
|
||||
@@ -65,84 +60,6 @@ export default function LayoutForum_Main({
|
||||
>
|
||||
{children}
|
||||
</UIGlobal_LayoutTamplate>
|
||||
|
||||
{/* <AppComponentGlobal_LayoutTamplate
|
||||
header={
|
||||
<Header height={50} sx={{ borderStyle: "none" }}>
|
||||
<Group h={50} position="apart" px={"md"}>
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
onClick={() => {
|
||||
setLoading(true);
|
||||
return router.push(RouterHome.main_home);
|
||||
}}
|
||||
>
|
||||
<IconChevronLeft />
|
||||
</ActionIcon>
|
||||
|
||||
<Title order={5}>Forum</Title>
|
||||
|
||||
<ActionIcon
|
||||
loading={loading ? true : false}
|
||||
variant="transparent"
|
||||
onClick={() => {
|
||||
setLoading(true);
|
||||
router.push(RouterForum.forumku + dataAuthor?.id);
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
radius={"xl"}
|
||||
size={30}
|
||||
sx={{
|
||||
borderStyle: "solid",
|
||||
borderWidth: "0.5px",
|
||||
borderColor: "black",
|
||||
}}
|
||||
alt="foto"
|
||||
src={
|
||||
RouterProfile.api_foto_profile +
|
||||
dataAuthor?.Profile?.imagesId
|
||||
}
|
||||
/>
|
||||
</ActionIcon>
|
||||
</Group>
|
||||
</Header>
|
||||
}
|
||||
|
||||
// footer={
|
||||
// <Footer height={60} bg={"dark"}>
|
||||
// <Grid>
|
||||
// {listFooter.map((e) => (
|
||||
// <Grid.Col
|
||||
// key={e.id}
|
||||
// span={"auto"}
|
||||
// pt={"md"}
|
||||
// onClick={() => {
|
||||
// router.replace(e.path);
|
||||
// setHotMenu(e.id);
|
||||
// }}
|
||||
// >
|
||||
// <Center>
|
||||
// <Stack align="center" spacing={0}>
|
||||
// <ActionIcon
|
||||
// variant="transparent"
|
||||
// c={hotMenu === e.id ? "blue" : "white"}
|
||||
// >
|
||||
// {e.icon}
|
||||
// </ActionIcon>
|
||||
// <Text fz={10} c={hotMenu === e.id ? "blue" : "white"}>
|
||||
// {e.name}
|
||||
// </Text>
|
||||
// </Stack>
|
||||
// </Center>
|
||||
// </Grid.Col>
|
||||
// ))}
|
||||
// </Grid>
|
||||
// </Footer>
|
||||
// }
|
||||
>
|
||||
{children}
|
||||
</AppComponentGlobal_LayoutTamplate> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user