From bfb3e1495aa42594cdb07c459173051d95917efc Mon Sep 17 00:00:00 2001 From: Z8MB1E Date: Fri, 21 Aug 2026 16:57:31 -0400 Subject: [PATCH] feat(awards): sort awards by experience points in award display --- src/app/(frontend)/profile/[username]/page.tsx | 12 +++++++----- src/scripts/run-migrations.ts | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/(frontend)/profile/[username]/page.tsx b/src/app/(frontend)/profile/[username]/page.tsx index b61400a..fde431c 100644 --- a/src/app/(frontend)/profile/[username]/page.tsx +++ b/src/app/(frontend)/profile/[username]/page.tsx @@ -402,11 +402,13 @@ export default async function ProfilePage({ params }: ProfilePageProps) { {awards.length > 0 ? (
- {awards.map((award) => { - const awardImage = - award.image && typeof award.image === "object" ? (award.image as Media) : null; - return ; - })} + {awards + .sort((a, b) => (b.experiencePoints ?? 0) - (a.experiencePoints ?? 0)) + .map((award) => { + const awardImage = + award.image && typeof award.image === "object" ? (award.image as Media) : null; + return ; + })}
) : ( diff --git a/src/scripts/run-migrations.ts b/src/scripts/run-migrations.ts index 3202a9a..5eb5608 100644 --- a/src/scripts/run-migrations.ts +++ b/src/scripts/run-migrations.ts @@ -301,7 +301,7 @@ async function main() { `${RED}${BOLD} ╔══════════════════════════════════════════╗${RESET}`, ); log( - `${RED}${BOLD} ║ YOU ARE ABOUT TO MIGRATE PRODUCTION ║${RESET}`, + `${RED}${BOLD} ║ YOU ARE ABOUT TO MIGRATE PRODUCTION ║${RESET}`, ); log( `${RED}${BOLD} ╚══════════════════════════════════════════╝${RESET}\n`,