From a8fdf5f9f0176e66eed8ea54b48f122051601d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Pradel?= Date: Sat, 23 Mar 2024 11:49:34 +0100 Subject: [PATCH] fix: top protocol sorting by value --- src/components/Stats/TopProtocolsBarList/index.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/Stats/TopProtocolsBarList/index.tsx b/src/components/Stats/TopProtocolsBarList/index.tsx index 9da75f5..5826cc8 100644 --- a/src/components/Stats/TopProtocolsBarList/index.tsx +++ b/src/components/Stats/TopProtocolsBarList/index.tsx @@ -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 ; };