Skip to content

Commit

Permalink
increase leaderboard row height on mobile??
Browse files Browse the repository at this point in the history
  • Loading branch information
SheepTester committed Oct 22, 2024
1 parent 1e76423 commit ba754b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/onboarding/Leaderboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Leaderboard = ({ user }: LeaderboardProps) => {
}, [userPoints]);

return (
<div className={styles.wrapper} style={{ height: `${users.length * 4}rem` }}>
<div className={styles.wrapper} style={{ height: `calc(${users.length} * var(--leaderboard-height))` }}>
{users.map(({ name, points, image }) => {
const position = sorted.indexOf(name);
return (
Expand Down
6 changes: 6 additions & 0 deletions src/components/onboarding/Leaderboard/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
border-radius: 0.5rem;
overflow: hidden;
position: relative;
--leaderboard-height: 4rem;

@media (max-width: vars.$breakpoint-sm) {
--leaderboard-height: 6rem;
}

.row {
left: 0;
position: absolute;
right: 0;
top: 0;
transition: transform 0.2s;
height: var(--leaderboard-height);
}
}

0 comments on commit ba754b0

Please sign in to comment.