diff --git a/src/components/leaderboard/GeneralLeaderboardPage.tsx b/src/components/leaderboard/GeneralLeaderboardPage.tsx index 5d4d1d9a3..983aebbfa 100644 --- a/src/components/leaderboard/GeneralLeaderboardPage.tsx +++ b/src/components/leaderboard/GeneralLeaderboardPage.tsx @@ -63,7 +63,7 @@ export default function GeneralLeaderboardPage({}: GeneralLeaderboardPageProps) { - if (key === 'user') router.push(`/leaderboard/${myAddress}?tab=${key}`) + if (key === 'user') router.push(`/leaderboard/${myAddress}?role=${key}`) else if (key === 'stats') router.push('/stats') }} > diff --git a/src/components/leaderboard/UserLeaderboardPage.tsx b/src/components/leaderboard/UserLeaderboardPage.tsx index 94da2ceae..6c10a6cfc 100644 --- a/src/components/leaderboard/UserLeaderboardPage.tsx +++ b/src/components/leaderboard/UserLeaderboardPage.tsx @@ -109,7 +109,7 @@ export default function UserLeaderboardPage({ address }: UserLeaderboardPageProp const myAddress = useMyAddress() const { query } = useRouter() - let tabState = query.tab as 'staker' | 'creator' + let tabState = query.role as 'staker' | 'creator' if (tabState !== 'staker' && tabState !== 'creator') { tabState = 'staker' } @@ -127,6 +127,7 @@ export default function UserLeaderboardPage({ address }: UserLeaderboardPageProp onChange={key => { if (key === 'general') router.push('/leaderboard') else if (key === 'stats') router.push('/stats') + else router.push(`/leaderboard/${myAddress}?role=${tabState}`) }} > {myAddress && } @@ -147,7 +148,7 @@ export default function UserLeaderboardPage({ address }: UserLeaderboardPageProp ]} onChange={e => { const value = e.target.value - router.push(`/leaderboard/${address}?tab=${value}`, undefined, { shallow: true }) + router.push(`/leaderboard/${address}?role=${value}`, undefined, { shallow: true }) }} value={tabState} optionType='button' diff --git a/src/components/leaderboard/common/LeaderboardTable.tsx b/src/components/leaderboard/common/LeaderboardTable.tsx index 8a7100ae6..0bc709306 100644 --- a/src/components/leaderboard/common/LeaderboardTable.tsx +++ b/src/components/leaderboard/common/LeaderboardTable.tsx @@ -99,7 +99,7 @@ function UserRow({ ) return ( - + { if (key === 'general') router.push('/leaderboard') - else if (key === 'user') router.push(`/leaderboard/${myAddress}?tab=staker`) + else if (key === 'user') router.push(`/leaderboard/${myAddress}?role=staker`) }} > {myAddress && }