Skip to content

Commit

Permalink
add community points column
Browse files Browse the repository at this point in the history
  • Loading branch information
johanleroch committed Jun 26, 2024
1 parent c6eea9f commit e27e6dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/points/_components/leaderboard/use-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ export function useTable({ data }: Params) {
)
},
}),
columnHelper.accessor("community", {
header: () => <div className="text-right">Community points</div>,
cell: (row) => {
const communityPoints = row.getValue()
return (
<div className="w-full h-full flex justify-end font-roboto">
{formatNumber(communityPoints)}
</div>
)
},
}),
columnHelper.accessor("total", {
header: () => <div className="text-right">Total points</div>,
cell: (row) => {
Expand Down
1 change: 1 addition & 0 deletions app/points/schemas/leaderboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const leaderboardEntrySchema = z.object({
taker: z.number(),
maker: z.number(),
ref: z.number(),
community: z.number().nullable(),
total: z.number().nullable(),
share: z.number().nullable(),
})
Expand Down

0 comments on commit e27e6dd

Please sign in to comment.