From 488f323e4441b75244785cb66b018f1179b262de Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 21 Feb 2023 10:31:23 +0700 Subject: fix --- src/core/components/elements/Popup/BottomPopup.jsx | 77 ++++++++------ src/core/components/elements/Sidebar/Sidebar.jsx | 116 ++++++++++----------- 2 files changed, 102 insertions(+), 91 deletions(-) (limited to 'src/core') diff --git a/src/core/components/elements/Popup/BottomPopup.jsx b/src/core/components/elements/Popup/BottomPopup.jsx index 933a8f11..c3c380c0 100644 --- a/src/core/components/elements/Popup/BottomPopup.jsx +++ b/src/core/components/elements/Popup/BottomPopup.jsx @@ -1,5 +1,6 @@ import { XMarkIcon } from "@heroicons/react/24/outline" import { AnimatePresence, motion } from "framer-motion" +import { useEffect } from "react" const transition = { ease: 'linear', duration: 0.2 } @@ -8,38 +9,48 @@ const BottomPopup = ({ active = false, title, close -}) => ( - <> - - { active && ( - <> - - -
-
{ title }
- -
- { children } -
- - ) } -
- -) +}) => { + useEffect(() => { + if (active) { + document.querySelector('html, body').classList.add('overflow-hidden') + } else { + document.querySelector('html, body').classList.remove('overflow-hidden') + } + }, [active]) + + return ( + <> + + { active && ( + <> + + +
+
{ title }
+ +
+ { children } +
+ + ) } +
+ + ) +} export default BottomPopup \ No newline at end of file diff --git a/src/core/components/elements/Sidebar/Sidebar.jsx b/src/core/components/elements/Sidebar/Sidebar.jsx index 122a10f3..e81d6130 100644 --- a/src/core/components/elements/Sidebar/Sidebar.jsx +++ b/src/core/components/elements/Sidebar/Sidebar.jsx @@ -22,65 +22,65 @@ const Sidebar = ({ return ( <> - - { active && ( - <> - - -
-
- { !auth && ( - <> - Daftar - Masuk - - ) } - { auth && ( - <> -
- { greeting() }, - - { auth?.name } - -
- - - - - ) } + + { active && ( + <> + + +
+
+ { !auth && ( + <> + Daftar + Masuk + + ) } + { auth && ( + <> +
+ { greeting() }, + + { auth?.name } + +
+ + + + + ) } +
+ + Semua Brand + + + Tentang Indoteknik + + + Pusat Bantuan + +
- - Semua Brand - - - Tentang Indoteknik - - - Pusat Bantuan - - -
- - - ) } - + + + ) } + ) } -- cgit v1.2.3