From 3731231df5cc879517154cbed666ad5566cc2b6d Mon Sep 17 00:00:00 2001 From: Nurfirliana Muzanella Date: Fri, 16 Aug 2024 09:54:07 +0700 Subject: [PATCH 01/27] add toggle menu with overlay --- hosting/src/assets/scss/layout-default.scss | 11 +++++++++-- hosting/src/components/Header.tsx | 5 +++-- hosting/src/components/Layouts/CmsLayout.tsx | 7 +++++-- hosting/src/components/Sidebar/Sidebar.tsx | 14 +++++++------- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/hosting/src/assets/scss/layout-default.scss b/hosting/src/assets/scss/layout-default.scss index e3444bef..d9ae55ce 100644 --- a/hosting/src/assets/scss/layout-default.scss +++ b/hosting/src/assets/scss/layout-default.scss @@ -1,3 +1,10 @@ .l-default { - // -} + & .overlay { + position: absolute; + width: 100%; + height: 100vh; + content: ''; + background: rgba(0, 0, 0, 0.5); + z-index: 10; + } +} \ No newline at end of file diff --git a/hosting/src/components/Header.tsx b/hosting/src/components/Header.tsx index 6be4e9c8..37d98098 100644 --- a/hosting/src/components/Header.tsx +++ b/hosting/src/components/Header.tsx @@ -1,4 +1,4 @@ -import {TogglePublishDocument} from "@/components/TogglePublishDocument"; +import { TogglePublishDocument } from "@/components/TogglePublishDocument"; import Image from "next/image"; import Link from "next/link"; @@ -21,9 +21,10 @@ interface HeaderProps { */ export default function Header({sidebarOpen, setSidebarOpen}: HeaderProps) { return ( -
+
+
+ +
setSidebarOpen(!sidebarOpen)}>
{/* */}
{/* */} diff --git a/hosting/src/components/Sidebar/Sidebar.tsx b/hosting/src/components/Sidebar/Sidebar.tsx index e0a3cc7a..ec2fe363 100644 --- a/hosting/src/components/Sidebar/Sidebar.tsx +++ b/hosting/src/components/Sidebar/Sidebar.tsx @@ -2,12 +2,12 @@ import Image from "next/image"; import Link from "next/link"; -import {usePathname} from "next/navigation"; -import {useEffect, useRef, useState} from "react"; -import {useTanamDocumentTypes} from "../../hooks/useTanamDocumentTypes"; -import {SidebarExpandableMenu, SidebarExpandableMenuSubItem} from "./SidebarExpandableMenu"; -import {SidebarMenuGroup} from "./SidebarMenuGroup"; -import {SidebarMenuItem} from "./SidebarMenuItem"; +import { usePathname } from "next/navigation"; +import { useEffect, useRef, useState } from "react"; +import { useTanamDocumentTypes } from "../../hooks/useTanamDocumentTypes"; +import { SidebarExpandableMenu, SidebarExpandableMenuSubItem } from "./SidebarExpandableMenu"; +import { SidebarMenuGroup } from "./SidebarMenuGroup"; +import { SidebarMenuItem } from "./SidebarMenuItem"; interface SidebarProps { sidebarOpen: boolean; @@ -59,7 +59,7 @@ const Sidebar = ({sidebarOpen, setSidebarOpen}: SidebarProps) => { return (