From 810c8054521415bca1cb573858eb934a6e740222 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Fri, 17 Feb 2023 20:33:45 +0800 Subject: [PATCH] Polished design for dashboard and made elements size responsive to viewport --- .../DashboardContainer/DashboardContainer.tsx | 37 ++++---- src/routes/Dashboard/Dashboard.tsx | 86 ++++++++++++++----- src/styles.tsx | 31 ++++--- 3 files changed, 102 insertions(+), 52 deletions(-) diff --git a/src/components/DashboardContainer/DashboardContainer.tsx b/src/components/DashboardContainer/DashboardContainer.tsx index 0dfe259..ef390ba 100644 --- a/src/components/DashboardContainer/DashboardContainer.tsx +++ b/src/components/DashboardContainer/DashboardContainer.tsx @@ -2,28 +2,29 @@ import React from "react"; export interface props { children: React.ReactNode; - width: string; - height: string; } export default function DashboardContainer(props: props) { return ( -
- {props.children} +
+
+ {props.children} +
); } diff --git a/src/routes/Dashboard/Dashboard.tsx b/src/routes/Dashboard/Dashboard.tsx index dd78185..c40d145 100644 --- a/src/routes/Dashboard/Dashboard.tsx +++ b/src/routes/Dashboard/Dashboard.tsx @@ -14,31 +14,71 @@ export default function Dashboard() {

Dashboard

- -
- -

Total Products

+
+
+
+
+
+ +
+ +

Total Products

+
+

2546 Unique Items

+

In inventory

+
+
+
+ +
+ +

Widget 2

+
+

Placeholder

+
+
+
+
+
+ +
+ +

Current Session

+
+
+ +

Added

+
+

254

+
+ +

Removed

+
+

64

+
+
+
+ +
+ +

Widget 4

+
+

Placeholder

+
+
+
+
-

2546 Unique Items

-

In inventory

- -
- -
- -

Current Session

+
+ +
+ +

Widget 5

+
+

Placeholder

+
-
- -

Added

-
-

254

-
- -

Removed

-
-

64

- +
); } diff --git a/src/styles.tsx b/src/styles.tsx index 43874ea..8ff115f 100644 --- a/src/styles.tsx +++ b/src/styles.tsx @@ -17,26 +17,22 @@ const styles: { [key: string]: React.CSSProperties } = { paddingLeft: 16, }, text: { - fontSize: 16, + fontSize: "1.3vw", color: "white", fontWeight: "bold", }, text_medium: { - fontSize: 26, + fontSize: "1.2vw", color: "white", fontWeight: "bold", }, text_large: { - fontSize: 36, + fontSize: "2.2vw", color: "white", fontWeight: "bold", }, - text_dashboard_1: { - fontSize: 46, - color: "white", - }, - text_dashboard_2: { - fontSize: 56, + text_extra_large: { + fontSize: "3.2vw", color: "white", }, logo_title: { @@ -91,8 +87,8 @@ const styles: { [key: string]: React.CSSProperties } = { }, sidebar_button: { backgroundColor: "#0b2322", - width: 192, - height: 64, + width: "30vh", + height: "6vh", border: "none", padding: 8, borderTopLeftRadius: 32, @@ -121,6 +117,19 @@ const styles: { [key: string]: React.CSSProperties } = { alignItems: "center", alignSelf: "flex-start", }, + DashboardWidget_WrapperColumn: { + justifyContent: "center", + display: "flex", + flexDirection: "column", + width: "100%", + height: "100vh", + }, + DashboardWidget_WrapperRow: { + justifyContent: "center", + display: "flex", + flexDirection: "row", + width: "95%", + }, }; export default styles;