Skip to content

Commit

Permalink
Merge pull request #967 from autonomys/feat/enable-and-fix-leaderboar…
Browse files Browse the repository at this point in the history
…d-in-explorer

Enable and fix leaderboard in explorer
  • Loading branch information
marc-aurele-besner authored Nov 19, 2024
2 parents 39d62d1 + 50b6196 commit d04362d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion explorer/src/app/[chain]/leaderboard/accounts/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export async function generateMetadata({ params: { chain } }: ChainPageProps): P
}

const Page: FC<ChainPageProps> = ({ params: { chain } }) =>
isRouteSupportingNetwork(chain, Routes.staking) ? <AccountLeaderboard /> : <NotFound />
isRouteSupportingNetwork(chain, Routes.leaderboard) ? <AccountLeaderboard /> : <NotFound />

export default Page
2 changes: 1 addition & 1 deletion explorer/src/app/[chain]/leaderboard/farmers/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export async function generateMetadata({ params: { chain } }: ChainPageProps): P
}

const Page: FC<ChainPageProps> = ({ params: { chain } }) =>
isRouteSupportingNetwork(chain, Routes.staking) ? <FarmerLeaderboard /> : <NotFound />
isRouteSupportingNetwork(chain, Routes.leaderboard) ? <FarmerLeaderboard /> : <NotFound />

export default Page
2 changes: 1 addition & 1 deletion explorer/src/app/[chain]/leaderboard/nominators/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export async function generateMetadata({ params: { chain } }: ChainPageProps): P
}

const Page: FC<ChainPageProps> = ({ params: { chain } }) =>
isRouteSupportingNetwork(chain, Routes.staking) ? <NominatorLeaderboard /> : <NotFound />
isRouteSupportingNetwork(chain, Routes.leaderboard) ? <NominatorLeaderboard /> : <NotFound />

export default Page
2 changes: 1 addition & 1 deletion explorer/src/app/[chain]/leaderboard/operators/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export async function generateMetadata({ params: { chain } }: ChainPageProps): P
}

const Page: FC<ChainPageProps> = ({ params: { chain } }) =>
isRouteSupportingNetwork(chain, Routes.staking) ? <OperatorLeaderboard /> : <NotFound />
isRouteSupportingNetwork(chain, Routes.leaderboard) ? <OperatorLeaderboard /> : <NotFound />

export default Page
2 changes: 1 addition & 1 deletion explorer/src/app/[chain]/leaderboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import type { ChainPageProps } from 'types/app'
import { isRouteSupportingNetwork } from 'utils/route'

const Page: FC<ChainPageProps> = ({ params: { chain } }) =>
isRouteSupportingNetwork(chain, Routes.staking) ? <AccountLeaderboard /> : <NotFound />
isRouteSupportingNetwork(chain, Routes.leaderboard) ? <AccountLeaderboard /> : <NotFound />

export default Page
16 changes: 8 additions & 8 deletions explorer/src/components/Leaderboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const AccountLeaderboard: FC = () => {
<LeaderboardList
title='Remark Count'
query={Query.QUERY_ACCOUNT_REMARK_COUNT}
table='leaderboard_account_remarks_total_counts'
table='leaderboard_account_remark_counts'
idLink={(id) => INTERNAL_ROUTES.accounts.id.page(network, Routes.consensus, id)}
valueType='number'
/>
Expand Down Expand Up @@ -246,7 +246,7 @@ export const FarmerLeaderboard: FC = () => {
<LeaderboardList
title='Vote Count'
query={Query.QUERY_FARMER_VOTE_TOTAL_COUNT}
table='leaderboard_farmer_votes_total_counts'
table='leaderboard_farmer_vote_total_counts'
idLabel='Farmer'
idLink={(id) => INTERNAL_ROUTES.accounts.id.page(network, Routes.consensus, id)}
valueType='number'
Expand All @@ -256,7 +256,7 @@ export const FarmerLeaderboard: FC = () => {
<LeaderboardList
title='Vote Value'
query={Query.QUERY_FARMER_VOTE_TOTAL_VALUE}
table='leaderboard_farmer_votes_total_values'
table='leaderboard_farmer_vote_total_values'
idLabel='Farmer'
idLink={(id) => INTERNAL_ROUTES.accounts.id.page(network, Routes.consensus, id)}
valueLabel='Total reward'
Expand All @@ -267,7 +267,7 @@ export const FarmerLeaderboard: FC = () => {
<LeaderboardList
title='Block Count'
query={Query.QUERY_FARMER_BLOCK_TOTAL_COUNT}
table='leaderboard_farmer_blocks_total_counts'
table='leaderboard_farmer_block_total_counts'
idLabel='Farmer'
idLink={(id) => INTERNAL_ROUTES.accounts.id.page(network, Routes.consensus, id)}
valueType='number'
Expand All @@ -277,7 +277,7 @@ export const FarmerLeaderboard: FC = () => {
<LeaderboardList
title='Block Value'
query={Query.QUERY_FARMER_BLOCK_TOTAL_VALUE}
table='leaderboard_farmer_blocks_total_values'
table='leaderboard_farmer_block_total_values'
idLabel='Farmer'
idLink={(id) => INTERNAL_ROUTES.accounts.id.page(network, Routes.consensus, id)}
valueLabel='Total reward'
Expand All @@ -300,7 +300,7 @@ export const OperatorLeaderboard: FC = () => {
<LeaderboardList
title='Rewards Collected'
query={Query.QUERY_OPERATOR_TOTAL_REWARDS_COLLECTED}
table='leaderboard_operator_rewards_collected'
table='leaderboard_operator_total_rewards_collecteds'
idLabel='Operator'
idLink={(id) => INTERNAL_ROUTES.operators.id.page(network, Routes.staking, id)}
showAccountIcon={false}
Expand All @@ -311,7 +311,7 @@ export const OperatorLeaderboard: FC = () => {
<LeaderboardList
title='Tax Collected'
query={Query.QUERY_OPERATOR_TOTAL_TAX_COLLECTED}
table='leaderboard_operator_tax_collected'
table='leaderboard_operator_total_tax_collecteds'
idLabel='Operator'
idLink={(id) => INTERNAL_ROUTES.operators.id.page(network, Routes.staking, id)}
showAccountIcon={false}
Expand All @@ -322,7 +322,7 @@ export const OperatorLeaderboard: FC = () => {
<LeaderboardList
title='Bundle Count'
query={Query.QUERY_OPERATOR_BUNDLE_TOTAL_COUNT}
table='leaderboard_operator_bundles_total_counts'
table='leaderboard_operator_bundle_total_counts'
idLabel='Operator'
idLink={(id) => INTERNAL_ROUTES.operators.id.page(network, Routes.staking, id)}
showAccountIcon={false}
Expand Down
1 change: 0 additions & 1 deletion explorer/src/constants/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const ROUTES: Route[] = [
{
name: Routes.leaderboard,
title: 'Leaderboard',
networks: [NetworkId.GEMINI_3H],
},
{
name: Routes.domains,
Expand Down

0 comments on commit d04362d

Please sign in to comment.