From fc5bd47f53cea2153dc553b93e5cbeb34d5c4b64 Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Wed, 10 Oct 2018 16:43:36 +0200 Subject: [PATCH] move table components to row 1 if showing less than 1 day of data --- assets/src/js/components/Chart.js | 2 ++ assets/src/js/pages/dashboard.js | 3 ++- assets/src/sass/styles.scss | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/src/js/components/Chart.js b/assets/src/js/components/Chart.js index 589d8497..93313b34 100644 --- a/assets/src/js/components/Chart.js +++ b/assets/src/js/components/Chart.js @@ -136,6 +136,8 @@ class Chart extends Component { @bind redrawChart() { let data = this.state.data; + + // hide chart & bail if we're trying to show less than 1 day worth of data this.base.parentNode.style.display = data.length <= 1 ? 'none' : ''; if(data.length <= 1) { return; diff --git a/assets/src/js/pages/dashboard.js b/assets/src/js/pages/dashboard.js index 008316f2..4a15f5f5 100644 --- a/assets/src/js/pages/dashboard.js +++ b/assets/src/js/pages/dashboard.js @@ -12,6 +12,7 @@ import Table from '../components/Table.js'; import Chart from '../components/Chart.js'; import { bind } from 'decko'; import Client from '../lib/client.js'; +import classNames from 'classnames'; const defaultSite = { id: window.localStorage.getItem('site_id') || 1, @@ -146,7 +147,7 @@ class Dashboard extends Component { return (
-
+