From 2b79d6c935a2bb87514e80e7cf73b46aac9a586d Mon Sep 17 00:00:00 2001 From: nymkappa Date: Thu, 31 Mar 2022 18:14:07 +0900 Subject: [PATCH] Fix some mobile UI issues on mining dashboard --- .../blocks-list/blocks-list.component.html | 6 ++-- .../blocks-list/blocks-list.component.scss | 7 ++-- ...ifficulty-adjustments-table.component.html | 2 +- ...ifficulty-adjustments-table.component.scss | 32 ++----------------- .../hashrate-chart.component.html | 6 ++-- .../hashrate-chart.component.scss | 20 +++--------- .../hashrate-chart.component.ts | 15 ++++----- .../hashrate-chart-pools.component.html | 2 +- .../hashrate-chart-pools.component.scss | 19 ++++------- .../hashrate-chart-pools.component.ts | 3 +- .../mining-dashboard.component.html | 10 +++--- .../pool-ranking/pool-ranking.component.html | 10 ++++-- .../pool-ranking/pool-ranking.component.scss | 13 ++------ .../pool-ranking/pool-ranking.component.ts | 28 +--------------- 14 files changed, 50 insertions(+), 123 deletions(-) diff --git a/frontend/src/app/components/blocks-list/blocks-list.component.html b/frontend/src/app/components/blocks-list/blocks-list.component.html index 9c2f964e2..f052b7fd6 100644 --- a/frontend/src/app/components/blocks-list/blocks-list.component.html +++ b/frontend/src/app/components/blocks-list/blocks-list.component.html @@ -26,7 +26,7 @@
- {{ block.extras.pool.name }} @@ -64,7 +64,7 @@ - + @@ -96,4 +96,4 @@
- \ No newline at end of file + diff --git a/frontend/src/app/components/blocks-list/blocks-list.component.scss b/frontend/src/app/components/blocks-list/blocks-list.component.scss index 354c403af..abf337821 100644 --- a/frontend/src/app/components/blocks-list/blocks-list.component.scss +++ b/frontend/src/app/components/blocks-list/blocks-list.component.scss @@ -14,6 +14,10 @@ td { padding-top: 0.7rem !important; padding-bottom: 0.7rem !important; + @media (max-width: 376px) { + padding-top: 0.73rem !important; + padding-bottom: 0.73rem !important; + } } .clear-link { @@ -35,8 +39,7 @@ td { .pool.widget { width: 40%; padding-left: 30px; - @media (max-width: 576px) { - padding-left: 40px; + @media (max-width: 376px) { width: 60%; } } diff --git a/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.html b/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.html index 51872c932..787058d91 100644 --- a/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.html +++ b/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.html @@ -1,5 +1,5 @@
- +
diff --git a/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.scss b/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.scss index c4a81f804..a0d8e115e 100644 --- a/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.scss +++ b/frontend/src/app/components/difficulty-adjustments-table/difficulty-adjustments-table.component.scss @@ -1,4 +1,4 @@ -.latest-transactions { +.latest-adjustments { width: 100%; text-align: left; table-layout:fixed; @@ -7,34 +7,8 @@ } td { width: 25%; - } - .table-cell-satoshis { - display: none; - text-align: right; - @media (min-width: 576px) { - display: table-cell; + @media (max-width: 376px) { + padding: 0.85rem; } - @media (min-width: 768px) { - display: none; - } - @media (min-width: 1100px) { - display: table-cell; - } - } - .table-cell-fiat { - display: none; - text-align: right; - @media (min-width: 485px) { - display: table-cell; - } - @media (min-width: 768px) { - display: none; - } - @media (min-width: 992px) { - display: table-cell; - } - } - .table-cell-fees { - text-align: right; } } diff --git a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html index e3d2f6213..4e9c66495 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html @@ -44,12 +44,12 @@ -
+
+
- + diff --git a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.scss b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.scss index 62903d4f4..54dbe5fad 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.scss +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.scss @@ -20,12 +20,11 @@ .full-container { padding: 0px 15px; width: 100%; - height: calc(100% - 170px); + min-height: 500px; + height: calc(100% - 150px); @media (max-width: 992px) { - height: calc(100% - 220px); - }; - @media (max-width: 575px) { - height: calc(100% - 260px); + height: 100%; + padding-bottom: 100px; }; } @@ -93,17 +92,8 @@ } .item { width: 50%; - margin: 0px auto 10px; display: inline-block; - @media (min-width: 485px) { - margin: 0px auto 10px; - } - @media (min-width: 785px) { - margin: 0px auto 0px; - } - &:last-child { - margin: 0px auto 0px; - } + margin: 0px auto 20px; &:nth-child(2) { order: 2; @media (min-width: 485px) { diff --git a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts index c210017fa..fd2a52b5e 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts @@ -155,10 +155,10 @@ export class HashrateChartComponent implements OnInit { '#D81B60', ], grid: { - top: 30, + top: 20, + bottom: this.widget ? 30 : 70, right: this.right, left: this.left, - bottom: this.widget ? 30 : this.isMobile() ? 90 : 60, }, tooltip: { show: !this.isMobile() || !this.widget, @@ -174,7 +174,7 @@ export class HashrateChartComponent implements OnInit { align: 'left', }, borderColor: '#000', - formatter: function (ticks) { + formatter: (ticks) => { let hashrateString = ''; let difficultyString = ''; let hashratePowerOfTen: any = selectPowerOfTen(1); @@ -205,7 +205,7 @@ export class HashrateChartComponent implements OnInit { ${hashrateString}
${difficultyString} `; - }.bind(this) + } }, xAxis: data.hashrates.length === 0 ? undefined : { type: 'time', @@ -239,7 +239,7 @@ export class HashrateChartComponent implements OnInit { }, yAxis: data.hashrates.length === 0 ? undefined : [ { - min: function (value) { + min: (value) => { return value.min * 0.9; }, type: 'value', @@ -256,7 +256,7 @@ export class HashrateChartComponent implements OnInit { } }, { - min: function (value) { + min: (value) => { return value.min * 0.9; }, type: 'value', @@ -266,7 +266,7 @@ export class HashrateChartComponent implements OnInit { formatter: (val) => { const selectedPowerOfTen: any = selectPowerOfTen(val); const newVal = Math.round(val / selectedPowerOfTen.divider); - return `${newVal} ${selectedPowerOfTen.unit}` + return `${newVal} ${selectedPowerOfTen.unit}`; } }, splitLine: { @@ -310,7 +310,6 @@ export class HashrateChartComponent implements OnInit { type: 'slider', brushSelect: false, realtime: true, - bottom: this.isMobile() ? 30 : 0, left: 20, right: 15, selectedDataBackground: { diff --git a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.html b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.html index 32f6a7b25..1ee088c7e 100644 --- a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.html +++ b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.html @@ -1,6 +1,6 @@
-
+
Mining pools dominance
diff --git a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.scss b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.scss index 095d33583..e89c8f173 100644 --- a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.scss +++ b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.scss @@ -20,19 +20,18 @@ .full-container { padding: 0px 15px; width: 100%; - height: calc(100% - 140px); - @media (max-width: 991px) { - height: calc(100% - 190px); - }; - @media (max-width: 575px) { - height: calc(100% - 235px); + min-height: 500px; + height: calc(100% - 150px); + @media (max-width: 992px) { + height: 100%; + padding-bottom: 100px; }; } .chart { width: 100%; height: 100%; - padding-bottom: 25px; + padding-bottom: 20px; padding-right: 10px; @media (max-width: 992px) { padding-bottom: 25px; @@ -43,12 +42,6 @@ @media (max-width: 767px) { padding-bottom: 50px; } - @media (max-width: 629px) { - padding-bottom: 85px; - } - @media (max-width: 567px) { - padding-bottom: 85px; - } } .chart-widget { width: 100%; diff --git a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts index 264ceb7ea..abfa8f61d 100644 --- a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts +++ b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts @@ -155,7 +155,7 @@ export class HashrateChartPoolsComponent implements OnInit { grid: { right: this.right, left: this.left, - bottom: this.widget ? 30 : 60, + bottom: this.widget ? 30 : 70, top: this.widget || this.isMobile() ? 10 : 50, }, tooltip: { @@ -218,7 +218,6 @@ export class HashrateChartPoolsComponent implements OnInit { type: 'slider', brushSelect: false, realtime: true, - bottom: 0, left: 20, right: 15, selectedDataBackground: { diff --git a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html index 674d0bc44..3b32408c8 100644 --- a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html +++ b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html @@ -27,7 +27,7 @@
-
+
View more @@ -38,7 +38,7 @@
-
+
View more @@ -49,7 +49,7 @@
-
+
Latest blocks @@ -63,13 +63,13 @@
- - + \ No newline at end of file diff --git a/frontend/src/app/components/pool-ranking/pool-ranking.component.scss b/frontend/src/app/components/pool-ranking/pool-ranking.component.scss index 5dddabe80..2d253eef6 100644 --- a/frontend/src/app/components/pool-ranking/pool-ranking.component.scss +++ b/frontend/src/app/components/pool-ranking/pool-ranking.component.scss @@ -28,7 +28,7 @@ width: 100%; height: 100%; max-height: 270px; - @media (max-width: 767.98px) { + @media (max-width: 485px) { max-height: 200px; } } @@ -93,17 +93,8 @@ } .item { width: 50%; - margin: 0px auto 10px; display: inline-block; - @media (min-width: 485px) { - margin: 0px auto 10px; - } - @media (min-width: 785px) { - margin: 0px auto 0px; - } - &:last-child { - margin: 0px auto 0px; - } + margin: 0px auto 20px; &:nth-child(2) { order: 2; @media (min-width: 485px) { diff --git a/frontend/src/app/components/pool-ranking/pool-ranking.component.ts b/frontend/src/app/components/pool-ranking/pool-ranking.component.ts index 4be0f340d..236ac3b2d 100644 --- a/frontend/src/app/components/pool-ranking/pool-ranking.component.ts +++ b/frontend/src/app/components/pool-ranking/pool-ranking.component.ts @@ -201,30 +201,6 @@ export class PoolRankingComponent implements OnInit { } prepareChartOptions(miningStats) { - let network = this.stateService.network; - if (network === '') { - network = 'bitcoin'; - } - network = network.charAt(0).toUpperCase() + network.slice(1); - - let radius: any[] = ['20%', '80%']; - let top: number = 0; let height = undefined; - if (this.isMobile() && this.widget) { - top = -30; - height = 270; - radius = ['10%', '50%']; - } else if (this.isMobile() && !this.widget) { - top = -40; - height = 300; - radius = ['10%', '50%']; - } else if (this.widget) { - radius = ['15%', '60%']; - top = -20; - height = 330; - } else { - top = 0; - } - this.chartOptions = { animation: false, color: chartColors, @@ -237,11 +213,9 @@ export class PoolRankingComponent implements OnInit { series: [ { minShowLabelAngle: 3.6, - top: top, - height: height, name: 'Mining pool', type: 'pie', - radius: radius, + radius: ['20%', '80%'], data: this.generatePoolsChartSerieData(miningStats), labelLine: { lineStyle: {
Height