Integrated the group names into the Footer.jsx
This commit is contained in:
parent
3f20e8eb42
commit
05509ddfda
@ -5,11 +5,13 @@ import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
|||||||
import {faHome, faVolumeHigh, faVolumeMute} from "@fortawesome/free-solid-svg-icons";
|
import {faHome, faVolumeHigh, faVolumeMute} from "@fortawesome/free-solid-svg-icons";
|
||||||
import {MusicContext} from "@/common/contexts/MusicContext.jsx";
|
import {MusicContext} from "@/common/contexts/MusicContext.jsx";
|
||||||
import {useContext} from "react";
|
import {useContext} from "react";
|
||||||
|
import {GroupContext} from "@/common/contexts/GroupContext.jsx";
|
||||||
|
|
||||||
export const Footer = () => {
|
export const Footer = () => {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
const {musicEnabled, setMusicEnabled} = useContext(MusicContext);
|
const {musicEnabled, setMusicEnabled} = useContext(MusicContext);
|
||||||
|
const {groupName} = useContext(GroupContext);
|
||||||
|
|
||||||
const isLegalPage = location.pathname === "/imprint" || location.pathname === "/privacy" || location.pathname === "/end";
|
const isLegalPage = location.pathname === "/imprint" || location.pathname === "/privacy" || location.pathname === "/end";
|
||||||
const isIngame = location.pathname === "/game" || location.pathname === "/end" || location.pathname === "/create";
|
const isIngame = location.pathname === "/game" || location.pathname === "/end" || location.pathname === "/create";
|
||||||
@ -17,25 +19,29 @@ export const Footer = () => {
|
|||||||
return (
|
return (
|
||||||
<footer>
|
<footer>
|
||||||
<div className={"footer-left" + ((isIngame || location.pathname.startsWith("/join"))
|
<div className={"footer-left" + ((isIngame || location.pathname.startsWith("/join"))
|
||||||
&& location.pathname !== "/end" ? " ingame" : "")}>
|
&& location.pathname !== "/end" ? " ingame" : "")}>
|
||||||
<a title="BS2AB" href="https://www.bs2ab.de/" target="_blank" rel="noreferrer" className="glassy footer-info">
|
<a title="BS2AB" href="https://www.bs2ab.de/" target="_blank" rel="noreferrer"
|
||||||
|
className="glassy footer-info">
|
||||||
<img src={Logo} alt="Logo"/>
|
<img src={Logo} alt="Logo"/>
|
||||||
<h2>Erstellt in Zusammenarbeit mit BS2AB</h2>
|
<h2>Erstellt in Zusammenarbeit mit BS2AB</h2>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{isLegalPage && <Link className="glassy footer-home" to="/">
|
{isLegalPage && <Link className="glassy footer-home" to="/">
|
||||||
<FontAwesomeIcon icon={faHome}/>
|
<FontAwesomeIcon icon={faHome}/>
|
||||||
</Link>}
|
</Link>}
|
||||||
|
|
||||||
{isIngame && <div className="glassy footer-home" onClick={() => setMusicEnabled(!musicEnabled)}>
|
{isIngame && <div className="glassy footer-home" onClick={() => setMusicEnabled(!musicEnabled)}>
|
||||||
<FontAwesomeIcon icon={musicEnabled ? faVolumeHigh : faVolumeMute}/>
|
<FontAwesomeIcon icon={musicEnabled ? faVolumeHigh : faVolumeMute}/>
|
||||||
</div>}
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={"glassy footer-legal" + ((isIngame || location.pathname.startsWith("/join"))
|
<div className={"glassy footer-legal" + ((isIngame || location.pathname.startsWith("/join"))
|
||||||
&& location.pathname !== "/end" ? " ingame" : "")}>
|
&& location.pathname !== "/end" ? " ingame" : "")}>
|
||||||
<Link to={"/privacy"}>Datenschutz</Link>
|
{groupName !== "" && <p>{groupName}</p>}
|
||||||
<Link to={"/imprint"}>Impressum</Link>
|
{groupName === "" && <>
|
||||||
|
<Link to={"/privacy"}>Datenschutz</Link>
|
||||||
|
<Link to={"/imprint"}>Impressum</Link>
|
||||||
|
</>}
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user