Updated the PageTitle.jsx
This commit is contained in:
parent
5288aa22ad
commit
87b49f9ed9
@ -1,10 +1,16 @@
|
|||||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||||
import {faBookAtlas} from "@fortawesome/free-solid-svg-icons";
|
import {faBookAtlas} from "@fortawesome/free-solid-svg-icons";
|
||||||
import "./styles.sass";
|
import "./styles.sass";
|
||||||
|
import {useContext} from "react";
|
||||||
|
import {StateContext} from "@/common/contexts/StateContext";
|
||||||
|
|
||||||
export const PageTitle = () => (
|
export const PageTitle = ({allowBack = false}) => {
|
||||||
<div className="page-title">
|
const {setCurrentState} = useContext(StateContext);
|
||||||
<FontAwesomeIcon icon={faBookAtlas} />
|
|
||||||
|
return (
|
||||||
|
<div className={"page-title" + (allowBack ? " title-clickable" : "")} onClick={() => allowBack ? setCurrentState("Home") : ""}>
|
||||||
|
<FontAwesomeIcon icon={faBookAtlas}/>
|
||||||
<h1>CountryGuessr</h1>
|
<h1>CountryGuessr</h1>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user