From f35c7564c8e5269931ae9eae4e56309277b7e3e5 Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Mon, 21 Dec 2020 13:57:08 +0200 Subject: [PATCH] if not loaded display null sr leaderboards --- pages/sr/leaderboards/index.tsx | 231 ++++++++++++++++---------------- 1 file changed, 119 insertions(+), 112 deletions(-) diff --git a/pages/sr/leaderboards/index.tsx b/pages/sr/leaderboards/index.tsx index fc8ef695c..545bdb7eb 100644 --- a/pages/sr/leaderboards/index.tsx +++ b/pages/sr/leaderboards/index.tsx @@ -102,119 +102,126 @@ const SalmonRunLeaderboardsPage = ({}) => { - - {data.length === 0 && !isLoading ? ( - No results yet. Submit the first one! - ) : ( - - - - - - - - - Weapons - - - Players - - - Rotation Dates - - - Links - - - - - {data.map((record, i) => { - if ( - i !== 0 && - data[i - 1].goldenEggCount !== record.goldenEggCount - ) { - placement = i + 1; - } - return ( - - {getRankingString(placement)} - - {record.goldenEggCount} - - - - {record.rotation.weapons.map((wpn) => ( - - - - ))} - - - - - {record.roster.map((user) => ( - - - {user.username}#{user.discriminator} - - ))} - - - - - - {new Date( - record.rotation.startTime - ).toLocaleDateString()} - - - - - {new Date( - record.rotation.endTime - ).toLocaleDateString()} - - - - - - {record.links.map((link) => ( - - } - isRound - variant="ghost" - /> - - ))} - + {isLoading ? null : ( + <> + + {data.length === 0 ? ( + No results yet. Submit the first one! + ) : ( +
+ + + + + + + + Weapons + + + Players + + + Rotation Dates + + + Links + - ); - })} - -
- )} -
+ + + {data.map((record, i) => { + if ( + i !== 0 && + data[i - 1].goldenEggCount !== record.goldenEggCount + ) { + placement = i + 1; + } + return ( + + {getRankingString(placement)} + + {record.goldenEggCount} + + + + {record.rotation.weapons.map((wpn) => ( + + + + ))} + + + + + {record.roster.map((user) => ( + + + {user.username}#{user.discriminator} + + ))} + + + + + + {new Date( + record.rotation.startTime + ).toLocaleDateString()} + + - + + {new Date( + record.rotation.endTime + ).toLocaleDateString()} + + + + + + {record.links.map((link) => ( + + } + isRound + variant="ghost" + /> + + ))} + + + ); + })} + + + )} + + + )} ); };