Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: link leaderboard to members' profiles 🔗 #694

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix linting errors in _profile.home.tsx and _profile.points.tsx
  • Loading branch information
BeteabTefera committed Jan 7, 2025
commit 95f5e5603a20815abba7dc0e25526440188598ab
4 changes: 2 additions & 2 deletions apps/member-profile/app/routes/_profile.home.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { json, type LoaderFunctionArgs } from '@remix-run/node';
import { Link, Outlet, useLoaderData, generatePath } from '@remix-run/react';
import { generatePath, Link, Outlet, useLoaderData } from '@remix-run/react';
import dayjs from 'dayjs';
import { type PropsWithChildren } from 'react';
import {
Expand Down Expand Up @@ -464,7 +464,7 @@ function LeaderboardCard({ className }: CardProps) {
return (
<Link
className="gap-4 rounded-2xl p-2 hover:bg-gray-100 sm:grid-cols-[4rem,1fr]"
to={generatePath(Route['/directory/:id'], { id: position.id })}
to={generatePath(Route['/directory/:id'], { id: position.id })}
>
<Leaderboard.Item
key={position.id}
Expand Down
28 changes: 14 additions & 14 deletions apps/member-profile/app/routes/_profile.points.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,20 +361,20 @@ function PointsLeaderboard({ className }: CardProps) {
<Leaderboard.List scroll>
{pointsLeaderboard.map((position) => {
return (
<RemixLink
className="gap-4 rounded-2xl p-2 hover:bg-gray-100 sm:grid-cols-[4rem,1fr]"
to={generatePath(Route['/directory/:id'], { id: position.id })}
>
<Leaderboard.Item
key={position.id}
firstName={position.firstName}
isMe={position.me}
label={<LeaderboardItemLabel points={position.points} />}
lastName={position.lastName}
position={position.rank}
profilePicture={position.profilePicture || undefined}
/>
</RemixLink>
<RemixLink
className="gap-4 rounded-2xl p-2 hover:bg-gray-100 sm:grid-cols-[4rem,1fr]"
to={generatePath(Route['/directory/:id'], { id: position.id })}
>
<Leaderboard.Item
key={position.id}
firstName={position.firstName}
isMe={position.me}
label={<LeaderboardItemLabel points={position.points} />}
lastName={position.lastName}
position={position.rank}
profilePicture={position.profilePicture || undefined}
/>
</RemixLink>
);
})}
</Leaderboard.List>
Expand Down
Loading