diff --git a/src/app/dev/(user)/layout.tsx b/src/app/dev/(user)/layout.tsx
deleted file mode 100644
index 0017c962..00000000
--- a/src/app/dev/(user)/layout.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { funGlobal_getUserById } from "@/app_modules/_global/fun/get/fun_get_user_by_id";
-import { redirect } from "next/navigation";
-
-export default async function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
- const userLoginId = await funGetUserIdByToken();
- const dataUser = await funGlobal_getUserById({
- userId: userLoginId as string,
- });
-
- if (dataUser?.masterUserRoleId != "1")
- return redirect(RouterAdminDashboard.splash_admin);
-
- return <>{children}>;
-}
diff --git a/src/app/dev/katalog/[id]/layout.tsx b/src/app/dev/katalog/[id]/layout.tsx
index fd0d7fd4..bd874c57 100644
--- a/src/app/dev/katalog/[id]/layout.tsx
+++ b/src/app/dev/katalog/[id]/layout.tsx
@@ -14,6 +14,7 @@ export default async function Layout({
const authorId = dataProfile?.userId;
const userLoginId = await funGetUserIdByToken();
+ const userRoleId = dataProfile?.User?.masterUserRoleId;
return (
<>
@@ -21,6 +22,7 @@ export default async function Layout({
profileId={profileId}
userLoginId={userLoginId as string}
authorId={authorId as any}
+ userRoleId={userRoleId as string}
>
{children}
diff --git a/src/app_modules/admin/_admin_global/_component/comp_button_user_on_navbar.tsx b/src/app_modules/admin/_admin_global/_component/comp_button_user_on_navbar.tsx
index 787b63ce..3e840a5e 100644
--- a/src/app_modules/admin/_admin_global/_component/comp_button_user_on_navbar.tsx
+++ b/src/app_modules/admin/_admin_global/_component/comp_button_user_on_navbar.tsx
@@ -14,6 +14,7 @@ import {
Menu,
Modal,
Popover,
+ SimpleGrid,
Stack,
Text,
Title,
@@ -82,11 +83,21 @@ export function Admin_ComponentButtonUserCircle({
-
-
+
diff --git a/src/app_modules/katalog/component/button_header_right.tsx b/src/app_modules/katalog/component/button_header_right.tsx
index 02e90181..9c53d7b3 100644
--- a/src/app_modules/katalog/component/button_header_right.tsx
+++ b/src/app_modules/katalog/component/button_header_right.tsx
@@ -11,10 +11,12 @@ export function ComponentKatalog_ButtonHeaderRight({
profileId,
userLoginId,
authorId,
+ userRoleId,
}: {
profileId: string;
userLoginId: string;
authorId: string;
+ userRoleId: string
}) {
const [opened, { open, close }] = useDisclosure();
@@ -33,6 +35,7 @@ export function ComponentKatalog_ButtonHeaderRight({
close={() => close()}
profileId={profileId}
userId={userLoginId}
+ userRoleId={userRoleId}
/>
>
);
diff --git a/src/app_modules/katalog/component/drawer_katalog.tsx b/src/app_modules/katalog/component/drawer_katalog.tsx
index 38be491d..b237ffa3 100644
--- a/src/app_modules/katalog/component/drawer_katalog.tsx
+++ b/src/app_modules/katalog/component/drawer_katalog.tsx
@@ -1,3 +1,4 @@
+import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
import {
RouterPortofolio,
RouterProfile,
@@ -14,6 +15,7 @@ import {
Text,
} from "@mantine/core";
import {
+ IconDashboard,
IconEdit,
IconPencilPlus,
IconPhotoEdit,
@@ -27,16 +29,19 @@ export function ComponentKatalog_DrawerKatalog({
opened,
close,
profileId,
- userId
+ userId,
+ userRoleId
}: {
opened: boolean;
close: () => void;
profileId: string;
userId: string
+ userRoleId: string
}) {
const router = useRouter();
const [pageId, setPageId] = useState("");
const [isLoading, setIsLoading] = useState(false);
+ const [isLoadingAdmin, setIsLoadingAdmin] = useState(false);
const listPage = [
{
@@ -125,6 +130,27 @@ export function ComponentKatalog_DrawerKatalog({
))}
+ {userRoleId != "1" && (
+
+ {
+ router.push(RouterAdminDashboard.main_admin, { scroll: false });
+ setIsLoadingAdmin(true);
+ }}
+ >
+ {isLoadingAdmin ? (
+
+ ) : (
+
+ )}
+
+
+ Dashboard Admin
+
+
+ )}
diff --git a/src/app_modules/katalog/main/layout.tsx b/src/app_modules/katalog/main/layout.tsx
index 5ef20553..e84d845c 100644
--- a/src/app_modules/katalog/main/layout.tsx
+++ b/src/app_modules/katalog/main/layout.tsx
@@ -9,11 +9,13 @@ export default function KatalogLayout({
profileId,
userLoginId,
authorId,
+ userRoleId,
}: {
children: any;
profileId: any;
userLoginId: string;
authorId: string;
+ userRoleId: string
}) {
return (
<>
@@ -26,6 +28,7 @@ export default function KatalogLayout({
profileId={profileId}
userLoginId={userLoginId}
authorId={authorId as any}
+ userRoleId={userRoleId}
/>
}
/>
diff --git a/src/app_modules/katalog/profile/_component/comp_load_background.tsx b/src/app_modules/katalog/profile/_component/comp_load_background.tsx
index bf09c029..ecace66c 100644
--- a/src/app_modules/katalog/profile/_component/comp_load_background.tsx
+++ b/src/app_modules/katalog/profile/_component/comp_load_background.tsx
@@ -10,13 +10,15 @@ import { useState } from "react";
export function Profile_ComponentLoadBackgroundImage({
fileId,
+ size
}: {
fileId: string;
+ size?: number
}) {
const router = useRouter();
const [isImage, setIsImage] = useState(null);
const [isLoading, setLoading] = useState(false);
- const url = APIs.GET({ fileId: fileId });
+ const url = APIs.GET({ fileId: fileId,size: size ? size.toString() : "200" });
useShallowEffect(() => {
onLoadImage();
diff --git a/src/app_modules/katalog/ui/ui_profile.tsx b/src/app_modules/katalog/ui/ui_profile.tsx
index bc0be610..d844d433 100644
--- a/src/app_modules/katalog/ui/ui_profile.tsx
+++ b/src/app_modules/katalog/ui/ui_profile.tsx
@@ -68,6 +68,7 @@ export function Profile_UiView({