From 5dce9bd38c82eb74a670f6888bc308f70c2ecb83 Mon Sep 17 00:00:00 2001 From: Igor Date: Sat, 16 Nov 2024 03:08:40 +0100 Subject: [PATCH] Refactor profile page by extracting BuildsList component for improved readability and maintainability --- frontend/src/pages/profile.jsx | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/frontend/src/pages/profile.jsx b/frontend/src/pages/profile.jsx index 1c94377..0384bc6 100644 --- a/frontend/src/pages/profile.jsx +++ b/frontend/src/pages/profile.jsx @@ -7,24 +7,28 @@ const Profile = () => {

Your Builds

); }; +const BuildsList = ({ builds }) => { + return builds.map((build, i) => { + // deserialize the build object + const b = deserializeBuildState(build.build); + return ( +
  • + +

    {b.name}

    +

    Monster: {b.monster.name}

    + +
  • + ); + }); +}; + export default Profile;