Skip to content

Commit

Permalink
better tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbtay committed Jul 18, 2024
1 parent 54e16f3 commit e7c946f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/Leaderboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@ function WeeklyProblemBox({ solved, allProblemsLength, problemId }) {
}`}
style={{ width: `${100 / allProblemsLength}%` }}
data-tooltip-id={
"" + solved === 2 ? "solved" : solved === 1 ? "previously-solved" : ""
problemId + solved === 2
? "-solved"
: solved === 1
? "-previously-solved"
: ""
}
>
{solved === 2 ? "✓" : solved === 1 ? "✓" : ""}
<Tooltip id="solved">
<Tooltip id={problemId + "-solved"}>
{problemId} was solved during the Summer Challenge
</Tooltip>
<Tooltip id="previously-solved">
<Tooltip id={problemId + "-previously-solved"}>
{problemId} was solved before the Summer Challenge
</Tooltip>
</div>
Expand Down

0 comments on commit e7c946f

Please sign in to comment.