From 89533cf76f144ffc8f0d3114c1a6ce25ceb0025e Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 23 Sep 2020 15:49:07 +0700 Subject: [PATCH] Improved graph visibility on mobile. --- .../mempool-graph/mempool-graph.component.ts | 4 +++- .../components/statistics/statistics.component.scss | 10 ++++++++++ frontend/src/styles.scss | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts index 618747a8e..0753d505a 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -17,6 +17,8 @@ export class MempoolGraphComponent implements OnInit, OnChanges { mempoolVsizeFeesOptions: any; mempoolVsizeFeesData: any; + isMobile = window.innerWidth <= 767.98; + constructor( private vbytesPipe: VbytesPipe, private stateService: StateService, @@ -56,7 +58,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { labelInterpolationFnc: (value: number): any => { return this.vbytesPipe.transform(value, 2); }, - offset: 160 + offset: this.isMobile ? 60 : 160 }, plugins: [ Chartist.plugins.ctTargetLine({ diff --git a/frontend/src/app/components/statistics/statistics.component.scss b/frontend/src/app/components/statistics/statistics.component.scss index aef585cbe..ff9bdb585 100644 --- a/frontend/src/app/components/statistics/statistics.component.scss +++ b/frontend/src/app/components/statistics/statistics.component.scss @@ -14,3 +14,13 @@ height: 22px; margin-right: 10px; } + +@media (max-width: 767.98px) { + .container-xl { + padding: 0; + } + .card-body { + padding-left: 0; + padding-right: 0; + } +} diff --git a/frontend/src/styles.scss b/frontend/src/styles.scss index c3f830a1e..9eb5e36d2 100644 --- a/frontend/src/styles.scss +++ b/frontend/src/styles.scss @@ -71,6 +71,9 @@ body { .box { padding: 0.75rem; } + .ct-legend { + display: none; + } } .navbar-nav.liquid > .active {