Skip to content

Commit

Permalink
temp leaderboard down message
Browse files Browse the repository at this point in the history
  • Loading branch information
starknetdev committed Oct 13, 2023
1 parent 362f32a commit 1cf7186
Showing 1 changed file with 53 additions and 37 deletions.
90 changes: 53 additions & 37 deletions ui/src/app/containers/LeaderboardScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,46 +72,62 @@ export default function LeaderboardScreen() {
}
}, [adventurersByXPdata]);

console.log(adventurersByXPdata);

return (
<div className="flex flex-col items-center h-full xl:overflow-y-auto 2xl:overflow-hidden mt-5 sm:mt-0">
<Button
onClick={async () => {
const adventurersByXPdata = await refetch(
"adventurersByXPQuery",
undefined
);
const sortedAdventurersByXP = handleSortXp(adventurersByXPdata);
setData("adventurersByXPQuery", sortedAdventurersByXP);
}}
>
<RefreshIcon className="w-8" />
</Button>
<div className="flex flex-row w-full">
<div
className={`${showScores ? "hidden " : ""}sm:block w-full sm:w-1/2`}
>
<LiveTable
itemsPerPage={itemsPerPage}
handleFetchProfileData={handlefetchProfileData}
/>
</div>
<div
className={`${showScores ? "" : "hidden "}sm:block w-full sm:w-1/2`}
>
<ScoreTable
itemsPerPage={itemsPerPage}
handleFetchProfileData={handlefetchProfileData}
/>
{!adventurersByXPdata ? (
<div className="flex justify-center items-center h-full">
<p className="text-4xl">
Leaderboard is down right now, we are working on fixing ASAP!
</p>
</div>
</div>
<Button
onClick={() =>
showScores ? setShowScores(false) : setShowScores(true)
}
className="sm:hidden"
>
{showScores ? "Show Live Leaderboard" : "Show Scores"}
</Button>
) : (
<>
<Button
onClick={async () => {
const adventurersByXPdata = await refetch(
"adventurersByXPQuery",
undefined
);
const sortedAdventurersByXP = handleSortXp(adventurersByXPdata);
setData("adventurersByXPQuery", sortedAdventurersByXP);
}}
>
<RefreshIcon className="w-8" />
</Button>
<div className="flex flex-row w-full">
<div
className={`${
showScores ? "hidden " : ""
}sm:block w-full sm:w-1/2`}
>
<LiveTable
itemsPerPage={itemsPerPage}
handleFetchProfileData={handlefetchProfileData}
/>
</div>
<div
className={`${
showScores ? "" : "hidden "
}sm:block w-full sm:w-1/2`}
>
<ScoreTable
itemsPerPage={itemsPerPage}
handleFetchProfileData={handlefetchProfileData}
/>
</div>
</div>
<Button
onClick={() =>
showScores ? setShowScores(false) : setShowScores(true)
}
className="sm:hidden"
>
{showScores ? "Show Live Leaderboard" : "Show Scores"}
</Button>
</>
)}
</div>
);
}

1 comment on commit 1cf7186

@vercel
Copy link

@vercel vercel bot commented on 1cf7186 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.