From 6da68246654337b239729d48b7c2f0aadc87c911 Mon Sep 17 00:00:00 2001 From: picodes Date: Thu, 16 Jan 2025 10:11:45 +0100 Subject: [PATCH] chore: trying leaderboard in 2 files --- .../leaderboard/LeaderboardLibrary.tsx | 2 +- .../leaderboard/LeaderboardTableRow.tsx | 6 +- .../element/opportunity/Pagination.tsx | 2 +- ...leaderboard.($chain).($address).header.tsx | 56 +++++++++++++++++++ ...board.($chain).($address).leaderboard.tsx} | 56 +++++++------------ vite.config.ts | 7 +++ 6 files changed, 87 insertions(+), 42 deletions(-) create mode 100644 src/modules/leaderboard/routes/leaderboard.($chain).($address).header.tsx rename src/modules/leaderboard/routes/{leaderboard.($chain).($address).tsx => leaderboard.($chain).($address).leaderboard.tsx} (58%) diff --git a/src/components/element/leaderboard/LeaderboardLibrary.tsx b/src/components/element/leaderboard/LeaderboardLibrary.tsx index 9297190..cca2909 100644 --- a/src/components/element/leaderboard/LeaderboardLibrary.tsx +++ b/src/components/element/leaderboard/LeaderboardLibrary.tsx @@ -33,7 +33,7 @@ export default function LeaderboardLibrary(props: LeaderboardLibraryProps) { key={uuidv4()} total={BigInt(total ?? 0n)} row={row} - reason={reason} + showreason={reason} rank={index + 1 + Math.max(Number(page) - 1, 0) * Number(items)} token={token} chain={chain} diff --git a/src/components/element/leaderboard/LeaderboardTableRow.tsx b/src/components/element/leaderboard/LeaderboardTableRow.tsx index c9b498a..ec670bd 100644 --- a/src/components/element/leaderboard/LeaderboardTableRow.tsx +++ b/src/components/element/leaderboard/LeaderboardTableRow.tsx @@ -13,11 +13,11 @@ export type LeaderboardTableRowProps = Component<{ rank: number; token: TokenType; chain: number; - reason: boolean; + showreason: boolean; }>; export default function LeaderboardTableRow({ row, rank, total, className, ...props }: LeaderboardTableRowProps) { - const { token, chain: chainId, reason } = props; + const { token, chain: chainId, showreason } = props; const { chains } = useWalletContext(); const share = useMemo(() => { @@ -31,7 +31,7 @@ export default function LeaderboardTableRow({ row, rank, total, className, ...pr return chains?.find(c => c.id === chainId); }, [chains, chainId]); - return reason ? ( + return showreason ? ( +