Skip to content

Commit

Permalink
Merge pull request #2 from Bolado/dev
Browse files Browse the repository at this point in the history
refactor: Enhance Header Styling & Profile Page Component Structure
  • Loading branch information
Bolado authored Nov 16, 2024
2 parents 737206c + 5dce9bd commit d1e575b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
8 changes: 6 additions & 2 deletions frontend/src/components/global-header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ const GlobalHeader = () => {
const logged = useLoaderData();
return (
<>
<header className="flex justify-between items-center p-3">
<h1 className="cinzel text-xl">SW:LC Rune Builder</h1>
<header className="flex justify-between items-center p-3 bg-slate-500/10">
<Link to="/build/new">
<h1 className="cinzel text-xl text-bold">
SW:Lost Centuria Rune Builder
</h1>
</Link>
{logged ? (
<Link to="/profile">
<ProfileButton />
Expand Down
34 changes: 19 additions & 15 deletions frontend/src/pages/profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,28 @@ const Profile = () => {
<div className="max-w-7xl mx-auto">
<h2 className="cinzel text-4xl text-center my-8">Your Builds</h2>
<ul>
{builds.map((build) => {
// deserialize the build object
const b = deserializeBuildState(build.build);
return (
<li
className="p-2 m-2 hover:bg-blue-500/30 rounded-md"
key={build._id}
>
<Link to={`/build/${build._id}`}>
<h3 className="cinzel text-xl font-bold mr-4 ">{b.name}</h3>
<h3 className="text-md mr-4">Monster: {b.monster.name}</h3>
</Link>
</li>
);
})}
<BuildsList builds={builds} />
</ul>
</div>
);
};

const BuildsList = ({ builds }) => {
return builds.map((build, i) => {
// deserialize the build object
const b = deserializeBuildState(build.build);
return (
<li
className={`p-2 m-2 hover:bg-slate-500/30 rounded-md bg-slate-500/10 `}
key={build._id}
>
<Link to={`/build/${build._id}`}>
<h3 className="cinzel text-xl font-bold mr-4 ">{b.name}</h3>
<h3 className="text-md mr-4">Monster: {b.monster.name}</h3>
</Link>
</li>
);
});
};

export default Profile;

0 comments on commit d1e575b

Please sign in to comment.