From dde5d85f6da570b9bc8b49071dc713a904761121 Mon Sep 17 00:00:00 2001 From: Llewellyn D'souza Date: Thu, 6 Jan 2022 18:00:34 +0530 Subject: [PATCH] Updated: Organised dashboard modules --- .../Sidebar/index.js} | 2 +- src/components/Sidebar/sidebar.module.css | 15 +++++++++++ .../breadcrumbs/breadcrumbs.module.css | 4 +++ src/components/breadcrumbs/index.js | 10 +++++++ src/components/topbar/index.js | 8 ++++++ src/components/topbar/topbar.module.css | 5 ++++ src/layouts/dashboard/dashboard.module.css | 27 ------------------- src/layouts/dashboard/index.js | 10 +++---- 8 files changed, 48 insertions(+), 33 deletions(-) rename src/{layouts/dashboard/Sidebar.js => components/Sidebar/index.js} (78%) create mode 100644 src/components/Sidebar/sidebar.module.css create mode 100644 src/components/breadcrumbs/breadcrumbs.module.css create mode 100644 src/components/breadcrumbs/index.js create mode 100644 src/components/topbar/index.js create mode 100644 src/components/topbar/topbar.module.css diff --git a/src/layouts/dashboard/Sidebar.js b/src/components/Sidebar/index.js similarity index 78% rename from src/layouts/dashboard/Sidebar.js rename to src/components/Sidebar/index.js index d746be1..436cb8f 100644 --- a/src/layouts/dashboard/Sidebar.js +++ b/src/components/Sidebar/index.js @@ -1,4 +1,4 @@ -import styles from './dashboard.module.css'; +import styles from './sidebar.module.css'; export default function Sidebar() { return ( diff --git a/src/components/Sidebar/sidebar.module.css b/src/components/Sidebar/sidebar.module.css new file mode 100644 index 0000000..92a4f36 --- /dev/null +++ b/src/components/Sidebar/sidebar.module.css @@ -0,0 +1,15 @@ +.navSidebar { + grid-column: 1; + background: #2d373c; + min-height: 100vh; + padding: 40px; +} + +.sidebarBranding { + font-style: normal; + font-weight: bold; + font-size: 36px; + line-height: 44px; + + color: #ffffff; +} \ No newline at end of file diff --git a/src/components/breadcrumbs/breadcrumbs.module.css b/src/components/breadcrumbs/breadcrumbs.module.css new file mode 100644 index 0000000..9d388c3 --- /dev/null +++ b/src/components/breadcrumbs/breadcrumbs.module.css @@ -0,0 +1,4 @@ +.breadcrumbs { + grid-row: 2; + padding: 25px 48px; +} diff --git a/src/components/breadcrumbs/index.js b/src/components/breadcrumbs/index.js new file mode 100644 index 0000000..4267a3f --- /dev/null +++ b/src/components/breadcrumbs/index.js @@ -0,0 +1,10 @@ +import styles from './breadcrumbs.module.css'; +import React from 'react'; + +export default function Breadcrumbs() { + return ( +
+ breadcrumbs {'>'} are {'>'} here +
+ ); +} diff --git a/src/components/topbar/index.js b/src/components/topbar/index.js new file mode 100644 index 0000000..81478ac --- /dev/null +++ b/src/components/topbar/index.js @@ -0,0 +1,8 @@ +import React from 'react' +import styles from './topbar.module.css' + +export default function TopBar() { + return ( +
search comes here
+ ) +} diff --git a/src/components/topbar/topbar.module.css b/src/components/topbar/topbar.module.css new file mode 100644 index 0000000..0592525 --- /dev/null +++ b/src/components/topbar/topbar.module.css @@ -0,0 +1,5 @@ +.topBar { + grid-row: 1; + padding: 24px 48px; + box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.08); +} \ No newline at end of file diff --git a/src/layouts/dashboard/dashboard.module.css b/src/layouts/dashboard/dashboard.module.css index dd53f6f..21897ac 100644 --- a/src/layouts/dashboard/dashboard.module.css +++ b/src/layouts/dashboard/dashboard.module.css @@ -4,39 +4,12 @@ grid-template-columns: 300px auto; } -.navSidebar { - grid-column: 1; - background: #2d373c; - min-height: 100vh; - padding: 40px; -} - -.sidebarBranding { - font-style: normal; - font-weight: bold; - font-size: 36px; - line-height: 44px; - - color: #ffffff; -} - .mainContent { grid-column: 2; display: grid; grid-template-rows: 108px 72px auto; } -.topBar { - grid-row: 1; - padding: 24px 48px; - box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.08); -} - -.breadcrumbs { - grid-row: 2; - padding: 25px 48px; -} - .content { grid-row: 3; padding: 24px 48px; diff --git a/src/layouts/dashboard/index.js b/src/layouts/dashboard/index.js index c37d8fa..e3f196b 100644 --- a/src/layouts/dashboard/index.js +++ b/src/layouts/dashboard/index.js @@ -1,16 +1,16 @@ import { Outlet } from 'react-router-dom'; +import Breadcrumbs from '../../components/breadcrumbs'; +import Sidebar from '../../components/Sidebar'; +import TopBar from '../../components/topbar'; import styles from './dashboard.module.css'; -import Sidebar from './Sidebar'; export default function Dashboard() { return (
-
search comes here
-
- breadcrumbs {'>'} are {'>'} here -
+ +