Skip to content

Commit

Permalink
fix: top protocol sorting by value
Browse files Browse the repository at this point in the history
  • Loading branch information
pradel committed Mar 23, 2024
1 parent e23fca8 commit a8fdf5f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/Stats/TopProtocolsBarList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ const getData = async () => {
export const TopProtocolsBarList = async () => {
const stats = await getData();

const formattedData = stats.map((d) => ({
name: protocolsInfo[d.protocol].name,
value: d.uniqueSenders,
href: `/protocols/${d.protocol}`,
}));
const formattedData = stats
.map((d) => ({
name: protocolsInfo[d.protocol].name,
value: d.uniqueSenders,
href: `/protocols/${d.protocol}`,
}))
.sort((a, b) => b.value - a.value);

return <TopProtocolsBarListClient data={formattedData} />;
};

0 comments on commit a8fdf5f

Please sign in to comment.