-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #228 from markalbrand56/front_searchbar
header home implementation
- Loading branch information
Showing
5 changed files
with
178 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React, { useState } from "react" | ||
import { FaBars, FaTimes } from "react-icons/fa" | ||
import { LuLogOut } from "react-icons/lu" | ||
import styles from "./HeaderHome.module.css" | ||
import { navigate } from "../../store" | ||
|
||
const HeaderHome = () => { | ||
const [showNavbar, setShowNavbar] = useState(false) | ||
|
||
const handleShowNavbar = () => { | ||
setShowNavbar(!showNavbar) | ||
} | ||
|
||
const renderActions = () => { | ||
return ( | ||
<div className="actions"> | ||
<div className={styles.actionlinks}> | ||
<a href="/login" className={styles.buttonlogin}> | ||
Iniciar Sesión | ||
</a> | ||
<a href="/signup">Registrarse</a> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
const handleHome = () => { | ||
navigate("/") | ||
} | ||
|
||
return ( | ||
<nav className={styles.navbar}> | ||
<div className={styles.container}> | ||
<div className={styles.logoheader}> | ||
<button className="buttonlogo" onClick={handleHome} type="button"> | ||
<img src="/images/Ue_2.svg" alt="Logo" /> | ||
</button> | ||
</div> | ||
<div className={styles.menuicon} onClick={handleShowNavbar}> | ||
{showNavbar ? ( | ||
<FaTimes size={30} style={{ color: "#000" }} /> | ||
) : ( | ||
<FaBars size={30} style={{ color: "#000" }} /> | ||
)} | ||
</div> | ||
<div className={styles.navelements + " " + (showNavbar && styles.active)}> | ||
{renderActions()} | ||
</div> | ||
</div> | ||
</nav> | ||
) | ||
} | ||
|
||
export default HeaderHome |
118 changes: 118 additions & 0 deletions
118
uniEmpleos/src/components/HeaderHome/HeaderHome.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
.container{ | ||
display: flex; | ||
align-items: center; | ||
width: 100%; | ||
} | ||
|
||
.navbar { | ||
width: 100%; | ||
height: 100px; | ||
background-color: #ffffff; | ||
position: relative; | ||
} | ||
|
||
.buttonlogin { | ||
color: #a08ae5; | ||
border: 2px solid #a08ae5; | ||
padding: 10px 20px; | ||
border-radius: 10px; | ||
} | ||
|
||
a.buttonlogin { | ||
color: #a08ae5 !important; | ||
} | ||
|
||
.navelements{ | ||
margin-left: auto; | ||
margin-right: 20px; | ||
} | ||
|
||
.menuicon { | ||
display: none; | ||
} | ||
|
||
.actionlinks { | ||
display: flex; | ||
gap: 40px; | ||
align-items: center; | ||
} | ||
|
||
|
||
@media (max-width: 600px){ | ||
|
||
.actionlinks { | ||
flex-direction: column; | ||
position: static; | ||
gap: 40px; | ||
margin-top: 40px; | ||
} | ||
|
||
.menuicon { | ||
display: block; | ||
cursor: pointer; | ||
margin-left: auto; | ||
margin-right: 10px; | ||
} | ||
|
||
.navelements { | ||
position: absolute; | ||
right: 0; | ||
top: 90px; | ||
background-color: #ffffff; | ||
width: 0px; | ||
height: calc(100vh - 60px); | ||
transition: all 0.3s ease-in; | ||
overflow: hidden; | ||
margin: 0; | ||
} | ||
|
||
.navelements ul { | ||
display: flex; | ||
justify-content: space-between; | ||
list-style-type: none; | ||
} | ||
|
||
.navelements ul li:not(:last-child) { | ||
margin-right: 60px; | ||
} | ||
|
||
.navelements ul a { | ||
font-size: 16px; | ||
font-weight: 400; | ||
color: #2f234f; | ||
text-decoration: none; | ||
} | ||
|
||
.navelements ul a.active { | ||
color: #574c4c; | ||
font-weight: 500; | ||
position: relative; | ||
} | ||
|
||
.navelements ul a.active::after { | ||
content: ''; | ||
position: absolute; | ||
bottom: -4px; | ||
left: 0; | ||
width: 100%; | ||
height: 2px; | ||
background-color: #574c4c; | ||
} | ||
|
||
.navelements.active { | ||
width: 100%; | ||
overflow-y: hidden; | ||
height: calc(100vh - 100px); | ||
} | ||
|
||
.navelements ul { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.navelements ul li { | ||
margin-right: unset; | ||
margin-top: 22px; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters