From ddcf7dc58fb26c5a26f258412caa1009a2581adc Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 26 Feb 2022 17:46:52 -0800 Subject: [PATCH] Add redesigned components and info to Profile page --- pages/[username].tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pages/[username].tsx b/pages/[username].tsx index c63e9f45..a5d309c8 100644 --- a/pages/[username].tsx +++ b/pages/[username].tsx @@ -3,6 +3,7 @@ import { useRouter } from 'next/router' import api from '~utils/api' +import ProfileHeader from '~components/ProfileHeader' import GridRep from '~components/GridRep' import GridRepCollection from '~components/GridRepCollection' @@ -14,8 +15,11 @@ interface User { interface Party { id: string + name: string + raid: Raid shortcode: string weapons: GridWeapon[] + updated_at: string } const ProfileRoute: React.FC = () => { @@ -44,7 +48,9 @@ const ProfileRoute: React.FC = () => { username: response.data.user.username, granblueId: response.data.user.granblue_id }) - setParties(response.data.user.parties) + + const parties: Party[] = response.data.user.parties + setParties(parties.sort((a, b) => (a.updated_at > b.updated_at) ? -1 : 1)) }) .then(() => { setFound(true) @@ -65,7 +71,7 @@ const ProfileRoute: React.FC = () => { const content = (parties && parties.length > 0) ? renderGrids() : renderNoGrids() return (
-

{user.username}

+ {content}
) @@ -82,6 +88,9 @@ const ProfileRoute: React.FC = () => { parties.map((party, i) => { return