From aa2645ae8ee227ba260a7fee02ca22702df0909a Mon Sep 17 00:00:00 2001 From: Michael Gummere Date: Mon, 6 May 2024 11:51:04 -0400 Subject: [PATCH] fix sort position --- components/Footer/Footer.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/Footer/Footer.tsx b/components/Footer/Footer.tsx index fbae739..20b5c58 100644 --- a/components/Footer/Footer.tsx +++ b/components/Footer/Footer.tsx @@ -82,6 +82,11 @@ export default function Footer() { "lastfm", ]; + // sort in place by alphabetical order before building the iconsDisplay object + menus.sort((a, b) => { + return a.title.localeCompare(b.title); + }); + menus.forEach((menu) => { // filter out the socials that are not enabled menu.children = menu.children.filter((child) => { @@ -132,11 +137,6 @@ export default function Footer() { return menu.children.length > 0; }); - // sort the menus - menus.sort((a, b) => { - return a.title.localeCompare(b.title); - }); - return (
-- 2.45.2