summaryrefslogtreecommitdiff
path: root/front/src/Emelents/Sidebar.tsx
blob: 4802e76c37896d15fcd58441caffe8f2636b3d0a (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 { GetString } 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'>
                <button onClick={() => setLang("ru")}> ru </button>
                <button onClick={() => setLang("en")}> en </button>
                <h1> {GetString("contents", language)} </h1>
                <ul>
                </ul>
            </div>
        </nav>
    );
}

export default Sidebar;