Skip to content

Commit

Permalink
fixing header sizes and elements positions
Browse files Browse the repository at this point in the history
  • Loading branch information
AmiltonCabral committed Aug 21, 2024
1 parent 602a41b commit ad0d854
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 33 deletions.
24 changes: 8 additions & 16 deletions src/components/Header/header.module.css
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
.header {
display: flex;
align-items: center;
justify-content: space-between;
background-color: var(--color-primary);
padding: 16px;
box-shadow: 0px 4px 2px -2px gray;
padding: 0 16px;
height: 4rem;
}

.backButtonContainer {
/* same with from Image tag */
min-width: 40px;
}

.backButton {
font-size: 24px;
border: none;
background: none;
cursor: pointer;
margin-right: 20px;
}

.title {
flex: 1;
text-align: center;
margin: 0;
font-size: 24px;
}

.backIcon {
width: 25px;
height: auto;
}
26 changes: 11 additions & 15 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,24 @@ import Image from "next/image";
const Header = () => {
const pathname = usePathname();

const getTitle = () => {
return (
return (
<header className={styles.header}>
<div className={styles.backButtonContainer}>
{pathname !== "/" && (
<Link href="/">
<button className={styles.backButton}>
<Image src="/arrow.svg" alt="Back" width={20} height={30} />
</button>
</Link>
)}
</div>
<Image
src="/logo.svg"
width={90}
height={60}
alt="Logo"
className={styles.logo}
/>
);
};

return (
<header className={styles.header}>
{pathname !== "/" && (
<Link href="/">
<button className={styles.backButton}>
<Image src="/arrow.svg" alt="Back" width={40} height={40} />
</button>
</Link>
)}
<h1 className={styles.title}>{getTitle()}</h1>
<Profile />
</header>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/Navbar/navbar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
position: fixed;
bottom: 0;
width: 100%;
max-height: 4rem;
border-top: 1px solid var(--background-tertiary);
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/Profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const Profile = () => {
src={profilePicture}
alt="Profile"
className={styles.profilePicture}
width={30}
height={30}
width={Number.MAX_SAFE_INTEGER}
height={Number.MAX_SAFE_INTEGER}
/>
</div>
);
Expand Down

0 comments on commit ad0d854

Please sign in to comment.