blob: d94cef8647e6777f28c150fc7821b285c50d811e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import { useContext } from 'react';
import { AllowedLanguages, LanguageContext } from '../Locales/Context';
import { GetLocalizedString } from '../Locales/Locales';
import './Elements.css';
type SidebarProps = {
setLang: (newLang: AllowedLanguages) => void;
};
function Sidebar({setLang}: SidebarProps) {
var language = useContext(LanguageContext);
return (
<nav className='Sidebar'>
<div className='SidebarContents'>
<h1> {GetLocalizedString("contents", language)} </h1>
<ul>
</ul>
<button onClick={() => setLang("ru")}> ru </button>
<button onClick={() => setLang("en")}> en </button>
</div>
</nav>
);
}
export default Sidebar;
|