Dashboard header styling improvements
This commit is contained in:
parent
c7d430805a
commit
ca35673298
|
|
@ -10,11 +10,23 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
justify-content: flex-end;
|
||||||
|
|
||||||
|
&.vertical {
|
||||||
|
button.icon {
|
||||||
|
margin-left: 0.25rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.dashboard-switch {
|
.dashboard-switch {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin-left: 0.25rem;
|
||||||
|
font-size: 125%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
.spacer {
|
||||||
|
|
@ -38,8 +50,8 @@
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 2;
|
z-index: 3;
|
||||||
width: 20rem;
|
width: 15rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { CancelIcon, FiltersIcon, PlusIcon, RefreshIcon } from '@/icons'
|
import { CancelIcon, FiltersIcon, PlusIcon, RefreshIcon } from '@/icons'
|
||||||
|
import { cn } from '@/utils/cn'
|
||||||
import { intervalToRange } from '@/utils/intervalToRange'
|
import { intervalToRange } from '@/utils/intervalToRange'
|
||||||
import { useState } from 'preact/hooks'
|
import { useState } from 'preact/hooks'
|
||||||
import { GRID_H_SNAP, GRID_WIDTH } from '../../constants'
|
import { GRID_H_SNAP, GRID_WIDTH } from '../../constants'
|
||||||
|
|
@ -42,7 +43,7 @@ export const DashboardHeader = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="dashboard-head">
|
<div className={cn('dashboard-head', verticalMode && 'vertical')}>
|
||||||
{verticalMode && (
|
{verticalMode && (
|
||||||
<>
|
<>
|
||||||
<button className="icon" onClick={handleNewBox}>
|
<button className="icon" onClick={handleNewBox}>
|
||||||
|
|
@ -56,21 +57,27 @@ export const DashboardHeader = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{filtersShown && (
|
{filtersShown && (
|
||||||
<div className="filters-panel">
|
<>
|
||||||
<div className="shadow" />
|
<div className="filters-panel">
|
||||||
<div className="inner">
|
<div className="shadow" />
|
||||||
<div
|
<div className="inner">
|
||||||
className="filter-close"
|
<div
|
||||||
onClick={() => setFiltersShown(false)}
|
className="filter-close"
|
||||||
>
|
onClick={() => setFiltersShown(false)}
|
||||||
<CancelIcon />
|
>
|
||||||
|
<CancelIcon />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<DashboardSwitch />
|
||||||
|
|
||||||
|
<DashboardFilters />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<DashboardSwitch />
|
|
||||||
|
|
||||||
<DashboardFilters />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div
|
||||||
|
className="menu-overlay"
|
||||||
|
onClick={() => setFiltersShown(false)}
|
||||||
|
></div>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,19 @@ export const DashboardSwitch = () => {
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<button onClick={() => setEdited(dashboard)}>
|
<button
|
||||||
|
className="icon"
|
||||||
|
title="Edit current dashboard"
|
||||||
|
onClick={() => setEdited(dashboard)}
|
||||||
|
>
|
||||||
<EditIcon />
|
<EditIcon />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button onClick={() => setShowNew(true)}>
|
<button
|
||||||
|
className="icon"
|
||||||
|
title="Add new dashboard"
|
||||||
|
onClick={() => setShowNew(true)}
|
||||||
|
>
|
||||||
<PlusIcon />
|
<PlusIcon />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue