Skip to content

Commit

Permalink
Explorer: Sort block program ids in filter dropdown (#22674)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry authored Jan 22, 2022
1 parent 88bf3c7 commit 477cb53
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion explorer/src/components/block/BlockHistoryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,13 @@ const FilterDropdown = ({
filterOptions.push({ name, programId, transactionCount });
});

filterOptions.sort();
filterOptions.sort((a, b) => {
if (a.transactionCount !== b.transactionCount) {
return b.transactionCount - a.transactionCount;
} else {
return b.name > a.name ? -1 : 1;
}
});

return (
<div className="dropdown me-2">
Expand Down

1 comment on commit 477cb53

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for explorer ready!

✅ Preview
https://explorer-gcvjsd4ke-solana-labs.vercel.app

Built with commit 477cb53.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.