From dec8ae2930afc877f4a7a10f47b6447a46c2e65f Mon Sep 17 00:00:00 2001 From: Miguel Medeiros Date: Sun, 6 Jun 2021 17:07:04 -0300 Subject: [PATCH] Dashboard layout reviewed. (#550) * Fix mempool-info-data item margin-bottom. * Remove unecessary bootstrap classes. * Fix lint errors. * Fix and remove css classes. * Add css class to Terms of Service. --- .../app/dashboard/dashboard.component.html | 56 +++++++++---------- .../app/dashboard/dashboard.component.scss | 37 ++++++++++-- .../src/app/dashboard/dashboard.component.ts | 4 +- 3 files changed, 63 insertions(+), 34 deletions(-) diff --git a/frontend/src/app/dashboard/dashboard.component.html b/frontend/src/app/dashboard/dashboard.component.html index f230767c1..ba2a4028b 100644 --- a/frontend/src/app/dashboard/dashboard.component.html +++ b/frontend/src/app/dashboard/dashboard.component.html @@ -1,64 +1,64 @@ -
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+

-
+
-
-
+
+


-
+
-
-
+
+
Latest blocks
@@ -94,12 +94,12 @@
- +
-
-
+
+
Latest transactions
@@ -118,7 +118,7 @@
-
 
+
 
@@ -135,7 +135,7 @@ -
+ @@ -150,7 +150,7 @@ -
+
@@ -189,8 +189,8 @@  Backend is synchronizing ({{ mempoolLoadingStatus$ | async }}%) -
-
 
+
+
 
{{ mempoolInfoData.value.vBytesPerSecond | ceil | number }} vB/s
@@ -198,7 +198,7 @@ -
+
Difficulty adjustment
diff --git a/frontend/src/app/dashboard/dashboard.component.scss b/frontend/src/app/dashboard/dashboard.component.scss index c1b9012ca..394040cf5 100644 --- a/frontend/src/app/dashboard/dashboard.component.scss +++ b/frontend/src/app/dashboard/dashboard.component.scss @@ -1,8 +1,13 @@ .dashboard-container { padding-bottom: 60px; + text-align: center; + margin-top: 0.5rem; @media (min-width: 992px) { padding-bottom: 0px; } + .col { + margin-bottom: 1.5rem; + } } .card { @@ -57,11 +62,14 @@ margin-bottom: 10px; } .item { - width: 124px; - margin: 0px auto 0px; + width: 50%; + margin: 0px auto 20px; display: inline-block; - @media (min-width: 400px) { - width: 50%; + @media (min-width: 485px) { + margin: 0px auto 10px; + } + @media (min-width: 785px) { + margin: 0px auto 0px; } &:last-child { margin: 0px auto 0px; @@ -92,6 +100,12 @@ font-size: 12px; } } + .progress { + width: 90%; + @media (min-width: 768px) { + width: 100%; + } + } } .bar { width: 93%; @@ -184,4 +198,19 @@ display: table-cell; } } +} + +.mempool-graph { + height: 250px; +} + +.inc-tx-progress-bar { + max-width: 250px; + .progress-bar { + padding: 4px; + } +} + +.terms-of-service { + margin-top: 1rem; } \ No newline at end of file diff --git a/frontend/src/app/dashboard/dashboard.component.ts b/frontend/src/app/dashboard/dashboard.component.ts index 07a71bd1c..8000ba912 100644 --- a/frontend/src/app/dashboard/dashboard.component.ts +++ b/frontend/src/app/dashboard/dashboard.component.ts @@ -90,7 +90,7 @@ export class DashboardComponent implements OnInit { progressClass = 'bg-warning'; } - const mempoolSizePercentage = (mempoolInfo.usage / mempoolInfo.maxmempool * 100) + const mempoolSizePercentage = (mempoolInfo.usage / mempoolInfo.maxmempool * 100); let mempoolSizeProgress = 'bg-danger'; if (mempoolSizePercentage <= 50) { mempoolSizeProgress = 'bg-success'; @@ -118,7 +118,7 @@ export class DashboardComponent implements OnInit { const diff = now - DATime; const blocksInEpoch = block.height % 2016; const estimatedBlocks = Math.round(diff / 60 / 10); - const difficultyChange = (600 / (diff / blocksInEpoch ) -1) * 100; + const difficultyChange = (600 / (diff / blocksInEpoch ) - 1) * 100; let base = 0; let green = 0;