From ca35673298b66a4d385310fc65980b16f8767ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Z=C3=ADpek?= Date: Sat, 3 Sep 2022 22:05:27 +0200 Subject: [PATCH] Dashboard header styling improvements --- client/src/assets/pages/_dashboard-page.scss | 16 +++++++-- .../DashboardHeader/DashboardHeader.tsx | 35 +++++++++++-------- .../components/DashboardSwitch.tsx | 12 +++++-- 3 files changed, 45 insertions(+), 18 deletions(-) diff --git a/client/src/assets/pages/_dashboard-page.scss b/client/src/assets/pages/_dashboard-page.scss index d00b546..209ae81 100644 --- a/client/src/assets/pages/_dashboard-page.scss +++ b/client/src/assets/pages/_dashboard-page.scss @@ -10,11 +10,23 @@ align-items: center; margin-left: auto; flex: 1; + justify-content: flex-end; + + &.vertical { + button.icon { + margin-left: 0.25rem; + } + } .dashboard-switch { flex: 1; display: flex; align-items: center; + + button { + margin-left: 0.25rem; + font-size: 125%; + } } .spacer { @@ -38,8 +50,8 @@ right: 0; top: 0; bottom: 0; - z-index: 2; - width: 20rem; + z-index: 3; + width: 15rem; display: flex; max-width: 100%; overflow: auto; diff --git a/client/src/pages/dashboard/components/DashboardHeader/DashboardHeader.tsx b/client/src/pages/dashboard/components/DashboardHeader/DashboardHeader.tsx index 05802b5..9de3456 100644 --- a/client/src/pages/dashboard/components/DashboardHeader/DashboardHeader.tsx +++ b/client/src/pages/dashboard/components/DashboardHeader/DashboardHeader.tsx @@ -1,4 +1,5 @@ import { CancelIcon, FiltersIcon, PlusIcon, RefreshIcon } from '@/icons' +import { cn } from '@/utils/cn' import { intervalToRange } from '@/utils/intervalToRange' import { useState } from 'preact/hooks' import { GRID_H_SNAP, GRID_WIDTH } from '../../constants' @@ -42,7 +43,7 @@ export const DashboardHeader = () => { } return ( -
+
{verticalMode && ( <>
{filtersShown && ( -
-
-
-
setFiltersShown(false)} - > - + <> +
+
+
+
setFiltersShown(false)} + > + +
+ + + +
- - - -
-
+
setFiltersShown(false)} + >
+ )} )} diff --git a/client/src/pages/dashboard/components/DashboardHeader/components/DashboardSwitch.tsx b/client/src/pages/dashboard/components/DashboardHeader/components/DashboardSwitch.tsx index db4b2ae..d8cf83c 100644 --- a/client/src/pages/dashboard/components/DashboardHeader/components/DashboardSwitch.tsx +++ b/client/src/pages/dashboard/components/DashboardHeader/components/DashboardSwitch.tsx @@ -25,11 +25,19 @@ export const DashboardSwitch = () => { ))} - -