From 55999bbdd6ca37339c0ba5ff90074f1847924107 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Fri, 22 Apr 2022 18:12:24 +0200 Subject: [PATCH] layout tweaks --- src/components/MonthlyFactoids.js | 30 +++---- src/components/MonthlyGraphs.js | 16 ++-- src/components/MonthlyOrchestrators.js | 118 ++++++++++++------------- src/components/OrchAddressViewer.js | 2 +- src/components/WinnerStat.js | 16 ++-- src/components/eventButtonAddress.js | 2 +- src/pages/MonthlyStats.js | 38 ++++---- src/pages/stats.js | 2 +- 8 files changed, 113 insertions(+), 111 deletions(-) diff --git a/src/components/MonthlyFactoids.js b/src/components/MonthlyFactoids.js index 081b16a..5fda7cf 100644 --- a/src/components/MonthlyFactoids.js +++ b/src/components/MonthlyFactoids.js @@ -28,11 +28,11 @@ const MonthlyFactoids = (obj) => { return (
-
- -
+
+ +
{obj.data.reactivationCount ? -
+
{ } {obj.data.activationCount ? -
+
{
: null } {(obj.data.latestCommission && obj.data.latestCommission.length) ? -
+
{
: null} {obj.data.bondCount ? -
+
{
: null } {obj.data.unbondCount ? -
+
{
: null } {obj.data.rewardCount ? -
+
{
: null } {obj.data.claimCount ? -
+
{
: null } {obj.data.withdrawStakeCount ? -
+
{
: null } {obj.data.withdrawFeesCount ? -
+
{
: null } {obj.data.moveStakeCount ? -
+
{
: null } {obj.data.winningTicketsReceivedCount ? -
+
{
: null } {obj.data.winningTicketsRedeemedCount ? -
+
{ totalGraphs++; - stakeObj =
+ stakeObj =

Stake Distribution

{ totalGraphs++; - earningsObj =
+ earningsObj =

Earnings Distribution

{ totalGraphs++; - broadcasterObj =
+ broadcasterObj =

Broadcaster Payments

{ } return ( -
- {renderStake ? stakeObj : null} - {renderEarnings ? earningsObj : null} - {renderBread ? broadcasterObj : null} +
{totalGraphs > 1 ? : null}
+
+ {renderStake ? stakeObj : null} + {renderEarnings ? earningsObj : null} + {renderBread ? broadcasterObj : null} +
) } diff --git a/src/components/MonthlyOrchestrators.js b/src/components/MonthlyOrchestrators.js index a80cb4b..17f1552 100644 --- a/src/components/MonthlyOrchestrators.js +++ b/src/components/MonthlyOrchestrators.js @@ -113,66 +113,66 @@ const MonthlyOrchestrators = (obj) => { const totalPages = (sortedList.length + (itemsPerPage - (sortedList.length % itemsPerPage))) / itemsPerPage; return ( -
-
- -
- { - sortedList.map(function (orch, i) { - const tmp = i - ((activePage - 1) * itemsPerPage); - if (tmp >= 0 && tmp < itemsPerPage) { - let thisCommission = null; - let thisStake = null; - let thisEarnings = null; - - for (const obj of ticketList) { - if (obj.address == orch.address) { - thisEarnings = obj; - } - } - for (const obj of commissionList) { - if (obj.address == orch.address) { - thisCommission = obj; - } - } - for (const obj of stakeList) { - if (obj.address == orch.address) { - thisStake = obj; - } - } - let thisScore = null; - if (thisScores && thisScores.scores) { - thisScore = thisScores.scores[orch.address]; - } - return ( -
- -
-
- ) - } - return null; - }) - } -
- -
-
- {totalPages > 1 ? - - : null} -
+
+
+ {totalPages > 1 ? + + : null}
+
+ +
+ { + sortedList.map(function (orch, i) { + const tmp = i - ((activePage - 1) * itemsPerPage); + if (tmp >= 0 && tmp < itemsPerPage) { + let thisCommission = null; + let thisStake = null; + let thisEarnings = null; + + for (const obj of ticketList) { + if (obj.address == orch.address) { + thisEarnings = obj; + } + } + for (const obj of commissionList) { + if (obj.address == orch.address) { + thisCommission = obj; + } + } + for (const obj of stakeList) { + if (obj.address == orch.address) { + thisStake = obj; + } + } + let thisScore = null; + if (thisScores && thisScores.scores) { + thisScore = thisScores.scores[orch.address]; + } + return ( +
+ +
+
+ ) + } + return null; + }) + } +
+ +
+
) } diff --git a/src/components/OrchAddressViewer.js b/src/components/OrchAddressViewer.js index c53b3d4..8960f90 100644 --- a/src/components/OrchAddressViewer.js +++ b/src/components/OrchAddressViewer.js @@ -111,7 +111,7 @@ const Address = (obj) => { {thisIcon} - {thisName} + {thisName}
) } diff --git a/src/components/WinnerStat.js b/src/components/WinnerStat.js index 50d61bc..354432d 100644 --- a/src/components/WinnerStat.js +++ b/src/components/WinnerStat.js @@ -55,7 +55,7 @@ const Winner = (obj) => { opened={opened} onClose={() => setOpened(false)} target={ -
setOpened((o) => !o)} > +
setOpened((o) => !o)} > { } return ( -
+

{obj.thisIndex}

@@ -100,7 +100,7 @@ const Winner = (obj) => { {scoreObj}
- {obj.thisEarnings ?
+ {obj.thisEarnings ?

Fees

@@ -110,10 +110,10 @@ const Winner = (obj) => {
({((obj.thisEarnings.sum / obj.totalEarnings) * 100).toFixed(2)} %)
-
:
+
:
} {obj.thisStake ? -
+

Stake

@@ -123,10 +123,10 @@ const Winner = (obj) => {
({((obj.thisStake.totalStake / obj.totalStake) * 100).toFixed(2)} %)
-
:
+
:
} {obj.thisCommission ? -
+

Commission

@@ -136,7 +136,7 @@ const Winner = (obj) => {
{obj.thisCommission.feeCommission.toFixed(2)}% Fee
-
:
+
:
}
diff --git a/src/components/eventButtonAddress.js b/src/components/eventButtonAddress.js index 82dd792..7dce464 100644 --- a/src/components/eventButtonAddress.js +++ b/src/components/eventButtonAddress.js @@ -175,7 +175,7 @@ const EventButtonAddress = (obj) => { } dispatch(getOrchestratorInfo(obj.address)); }} > - {thisName} + {thisName}
) diff --git a/src/pages/MonthlyStats.js b/src/pages/MonthlyStats.js index 314ea21..ff91dd8 100644 --- a/src/pages/MonthlyStats.js +++ b/src/pages/MonthlyStats.js @@ -5,19 +5,34 @@ import MonthlyOrchestrators from '../components/MonthlyOrchestrators'; import { RadioGroup, Radio } from "@mantine/core"; const MonthlyStats = (obj) => { - const [activePage, setPage] = useState(1); + const [activePage, setPage] = useState(0); let thisColour; - if (activePage == 1){ + if (activePage == 1) { thisColour = "teal"; - } else if (activePage == 2){ + } else if (activePage == 2) { thisColour = "indigo"; - } else if (activePage == 3){ + } else if (activePage == 3) { thisColour = "red"; } return (
+
+
+ + + + + +
{ @@ -50,21 +65,6 @@ const MonthlyStats = (obj) => { /> : null }
-
- - - - - -
-
) } diff --git a/src/pages/stats.js b/src/pages/stats.js index ea3947e..e75e2fe 100644 --- a/src/pages/stats.js +++ b/src/pages/stats.js @@ -31,7 +31,7 @@ const Stats = (obj) => {
-
+