diff --git a/vinvoor/src/leaderboard/LeaderboardTableBody.tsx b/vinvoor/src/leaderboard/LeaderboardTableBody.tsx index 2057208..02b20eb 100644 --- a/vinvoor/src/leaderboard/LeaderboardTableBody.tsx +++ b/vinvoor/src/leaderboard/LeaderboardTableBody.tsx @@ -1,4 +1,5 @@ import { + Chip, Icon, TableBody, TableCell, @@ -77,6 +78,13 @@ const getPosition = (position: number) => { } }; +const getScanned = (scanned: boolean) => { + if (scanned) + return ; + + return <>; +}; + const getCell = ( row: LeaderboardItem, headCell: TableHeadCell, @@ -86,6 +94,8 @@ const getCell = ( return getPositionChange(row[headCell.id]); case "position": return getPosition(row[headCell.id]); + case "scanned": + return getScanned(row[headCell.id]); default: return ( { const theme = useTheme(); const { data: user } = useUser(); + console.log(rows); + return ( {rows.map((row, index) => { diff --git a/vinvoor/src/types/leaderboard.ts b/vinvoor/src/types/leaderboard.ts index 376916b..0786ae1 100644 --- a/vinvoor/src/types/leaderboard.ts +++ b/vinvoor/src/types/leaderboard.ts @@ -8,6 +8,7 @@ export interface LeaderboardItemJSON { name: string; total_days: number; position_change: number; + checked_in: boolean; } // Internal @@ -18,6 +19,7 @@ export interface LeaderboardItem { name: string; totalDays: number; positionChange: number; + checkedIn: boolean; } // Converters @@ -29,6 +31,7 @@ export const convertLeaderboardItemJSON = ( ...leaderboardItem, totalDays: leaderboardItem.total_days, positionChange: leaderboardItem.position_change, + checkedIn: leaderboardItem.checked_in, })); // Table @@ -53,9 +56,15 @@ export const leaderboardHeadCells: readonly TableHeadCell[] = [ padding: "normal", }, { - id: "totalDays", - label: "Total Days", + id: "checkedIn", + label: "Checked In", align: "right", padding: "normal", }, + { + id: "totalDays", + label: "Total Days", + align: "left", + padding: "checkbox", + }, ];