Skip to content

Commit

Permalink
Merge pull request #26 from myroslav111/myroslav_branche_17
Browse files Browse the repository at this point in the history
fix: was fixed problem with switch language
  • Loading branch information
myroslav111 authored Sep 25, 2022
2 parents 101c6ba + 4859b5c commit 1b45c1c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/SelectLanguage/SelectLanguage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import InputLabel from '@mui/material/InputLabel';
import OutlinedInput from '@mui/material/OutlinedInput';
import FormControl from '@mui/material/FormControl';
import Select from '@mui/material/Select';
// import TopicIcon from '@mui/icons-material/Topic';
import { Context } from 'components/App';

export default function SelectLanguge() {
// const [currentLanguage, setCurrentLanguage] = useState(() =>
// localStorage.getItem('language')
// );
const [open, setOpen] = React.useState(false);
const { lang } = useContext(Context);
const [open, setOpen] = useState(false);
const [language, setLanguage] = useState('');
const { currentLanguageOnApp } = useContext(Context);

Expand All @@ -43,7 +43,7 @@ export default function SelectLanguge() {
<div>
<img
src={
language === 'en' || language === ''
lang === 'en'
? 'https://img.icons8.com/doodle/48/000000/great-britain.png'
: 'https://img.icons8.com/doodle/48/000000/germany.png'
}
Expand Down Expand Up @@ -97,8 +97,12 @@ export default function SelectLanguge() {
fontWeight: '700',
}}
>
<option value={'en'}>EN</option>
<option value={'de'}>DE</option>
<option disabled={lang === 'en'} value={'en'}>
EN
</option>
<option disabled={lang === 'de'} value={'de'}>
DE
</option>
</Select>
</FormControl>
</Box>
Expand Down

0 comments on commit 1b45c1c

Please sign in to comment.