From 1ddc3b81c7ae9df6fd17d558d46f5b43da85158d Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Wed, 6 Mar 2024 10:31:11 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20feat:=20add=20search=20dia?= =?UTF-8?q?log=20on=20mobile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/pages/org-slug/layout.tsx | 161 ++++++++++-------- 1 file changed, 87 insertions(+), 74 deletions(-) diff --git a/packages/frontend/src/pages/org-slug/layout.tsx b/packages/frontend/src/pages/org-slug/layout.tsx index 7ff72e7c..1ff1679f 100644 --- a/packages/frontend/src/pages/org-slug/layout.tsx +++ b/packages/frontend/src/pages/org-slug/layout.tsx @@ -13,6 +13,7 @@ import { Outlet, useParams } from 'react-router-dom'; import { AnimatePresence, motion } from 'framer-motion'; import { cn } from 'utils/classnames'; import { useMediaQuery } from 'usehooks-ts'; +import { ProjectSearchBarDialog } from 'components/projects/ProjectSearchBar'; export interface DashboardLayoutProps extends ComponentPropsWithoutRef<'section'> {} @@ -23,7 +24,9 @@ export const DashboardLayout = ({ }: DashboardLayoutProps) => { const { orgSlug } = useParams(); const isDesktop = useMediaQuery('(min-width: 1024px)'); + const [isSidebarOpen, setIsSidebarOpen] = useState(false); + const [isSearchOpen, setIsSearchOpen] = useState(false); useEffect(() => { if (isDesktop) { @@ -32,86 +35,96 @@ export const DashboardLayout = ({ }, [isDesktop]); return ( -
- {/* Header on mobile */} -
- -
- - {isSidebarOpen ? ( - - - - ) : ( - - <> - - - - - )} - -
-
-
- - -
- - - + + ) : ( + + <> + + + + + + )} +
-
-
-
+ +
+ + +
+ + + +
+
+
+ + setIsSearchOpen(false)} + /> + ); };