introducing menu
This commit is contained in:
parent
db6e485271
commit
5692307080
24
src/components/Menu.jsx
Normal file
24
src/components/Menu.jsx
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
import { useContext } from "react";
|
||||||
|
import { NavLink } from "react-router-dom";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
import { LanguageContext, useLanguage } from "../hooks/useLanguage";
|
||||||
|
|
||||||
|
export default function Menu() {
|
||||||
|
let location = useLocation();
|
||||||
|
const { language, changeLanguage } = useLanguage();
|
||||||
|
|
||||||
|
console.log(language);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<nav className='main-menu'>
|
||||||
|
<button onClick={changeLanguage}>Change language</button>
|
||||||
|
|
||||||
|
<nav>
|
||||||
|
<ul className='navlist'>
|
||||||
|
<NavLink to='/'>Home</NavLink>
|
||||||
|
<NavLink to='/Play'>Play</NavLink>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</nav>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user