Updated the Header.jsx
This commit is contained in:
parent
99b7f62289
commit
7c471d97a7
@ -1,16 +1,19 @@
|
|||||||
import "./styles.sass";
|
import "./styles.sass";
|
||||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||||
import {faGear} from "@fortawesome/free-solid-svg-icons";
|
import {faBars, faGear} from "@fortawesome/free-solid-svg-icons";
|
||||||
import {getByPath} from "@/common/routes";
|
import {getByPath} from "@/common/routes";
|
||||||
import {useLocation} from "react-router-dom";
|
import {useLocation} from "react-router-dom";
|
||||||
|
|
||||||
export const Header = () => {
|
export const Header = ({open, setOpen}) => {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const path = getByPath(location.pathname);
|
const path = getByPath(location.pathname);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="header">
|
<div className="header">
|
||||||
<h1>{path.category} / <span>{path.name}</span></h1>
|
<div className="header-left">
|
||||||
|
{!open && <FontAwesomeIcon icon={faBars} className="open-menu" onClick={() => setOpen(true)}/>}
|
||||||
|
<h1>{path?.category} / <span>{path?.name}</span></h1>
|
||||||
|
</div>
|
||||||
<FontAwesomeIcon icon={faGear} />
|
<FontAwesomeIcon icon={faGear} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user