From ff3b66e395dc9a9641e0c042819ac24693a7c0eb Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Wed, 28 Feb 2024 12:17:27 +0700 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20org=20slug=20d?= =?UTF-8?q?ashboard=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/App.tsx | 4 +-- packages/frontend/src/pages/OrgSlug.tsx | 26 ---------------- .../frontend/src/pages/org-slug/layout.tsx | 31 +++++++++++++++++++ 3 files changed, 33 insertions(+), 28 deletions(-) delete mode 100644 packages/frontend/src/pages/OrgSlug.tsx create mode 100644 packages/frontend/src/pages/org-slug/layout.tsx diff --git a/packages/frontend/src/App.tsx b/packages/frontend/src/App.tsx index a32fcd0c..0e171b94 100644 --- a/packages/frontend/src/App.tsx +++ b/packages/frontend/src/App.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { createBrowserRouter, RouterProvider } from 'react-router-dom'; -import OrgSlug from './pages/OrgSlug'; import Projects from './pages/org-slug'; import Settings from './pages/org-slug/Settings'; import { @@ -11,11 +10,12 @@ import { import ProjectSearchLayout from './layouts/ProjectSearch'; import Index from './pages'; import Login from './pages/Login'; +import { DashboardLayout } from 'pages/org-slug/layout'; const router = createBrowserRouter([ { path: ':orgSlug', - element: , + element: , children: [ { element: , diff --git a/packages/frontend/src/pages/OrgSlug.tsx b/packages/frontend/src/pages/OrgSlug.tsx deleted file mode 100644 index 834bb15d..00000000 --- a/packages/frontend/src/pages/OrgSlug.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import { Outlet } from 'react-router-dom'; - -import { OctokitProvider } from 'context/OctokitContext'; -import { Sidebar } from 'components/shared/Sidebar'; - -const OrgSlug = () => { - return ( -
- <> -
- -
-
-
- - - -
-
- -
- ); -}; - -export default OrgSlug; diff --git a/packages/frontend/src/pages/org-slug/layout.tsx b/packages/frontend/src/pages/org-slug/layout.tsx new file mode 100644 index 00000000..72050c7b --- /dev/null +++ b/packages/frontend/src/pages/org-slug/layout.tsx @@ -0,0 +1,31 @@ +import { Sidebar } from 'components/shared/Sidebar'; +import { OctokitProvider } from 'context/OctokitContext'; +import React, { ComponentPropsWithoutRef } from 'react'; +import { Outlet } from 'react-router-dom'; +import { cn } from 'utils/classnames'; + +export interface DashboardLayoutProps + extends ComponentPropsWithoutRef<'section'> {} + +export const DashboardLayout = ({ + className, + children, + ...props +}: DashboardLayoutProps) => { + return ( +
+ +
+
+ + + +
+
+ {children} +
+ ); +};