Skip to content

Commit

Permalink
fix styles on leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
starknetdev committed Sep 11, 2024
1 parent 9d10018 commit 51963cd
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions ui/src/app/containers/CollectionsLeaderboardScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,7 @@ const ScoreGraph: React.FC<ScoreGraphProps> = ({
(score.gamesPlayed / maxGamesPlayable) * 100
}%`,
}}
>
{score.gamesPlayed > 0 && (
<span
className={`text-xl absolute left-1/2 transform -translate-x-1/2 ${
(score.gamesPlayed / maxGamesPlayable) * 100 <= 50
? "bottom-full"
: "top-0"
}`}
>{`${Math.round(
(score.gamesPlayed / maxGamesPlayable) * 100
)}%`}</span>
)}
</div>
/>
{score.xp > 0 && (
<span className="text-xl absolute top-0 left-0 right-0">
{formatXP(score.xp)} XP
Expand Down Expand Up @@ -160,26 +148,12 @@ const ScoreGraph: React.FC<ScoreGraphProps> = ({
style={{
width: `${(score.gamesPlayed / maxGamesPlayable) * 100}%`,
}}
>
{score.gamesPlayed > 0 && (
<span
className={`text-xl absolute top-1/2 transform -translate-y-1/2 ${
(score.xp / maxTotalXP) * 100 <= 10 && "hidden"
} ${
(score.gamesPlayed / maxGamesPlayable) * 100 <= 50
? "left-full"
: "right-0"
}`}
>{`${Math.round(
(score.gamesPlayed / maxGamesPlayable) * 100
)}%`}</span>
)}
</div>
/>
{score.xp > 0 && (
<span
className={`text-xl absolute right-1 top-1/2 transform -translate-y-1/2 ${
(score.xp / maxTotalXP) * 100 <= 90
? "right-[-20px] text-terminal-green"
(score.xp / maxTotalXP) * 100 <= 30
? "right-[-40px] text-terminal-green"
: ""
}`}
>
Expand Down

0 comments on commit 51963cd

Please sign in to comment.