import React, { useState } from 'react';
import AppRu from './App-ru';
import AppEng from './App-eng';
import AppHebrew from './App-hebrew';
import stylesHeader from './components-ru/headers/Header.module.css';
import { Helmet } from 'react-helmet';
import AppButtonLanguage from './App-button-language.module.css'
function App() {
const [language, setLanguage] = useState(false);
const [languageRus, setLanguageRus] = useState(false);
const [languageEng, setLanguageEng] = useState(false);
const [languageHebrew, setLanguageHebrew] = useState(false);
const MenuButton = () => {
setLanguage(!language);
setLanguageEng(!languageEng)
};
const ButtonlanguageRus = () => {
setLanguageRus(true);
setLanguageEng(false);
setLanguageHebrew(false);
};
const ButtonlanguageEng = () => {
setLanguageRus(false);
setLanguageEng(true);
setLanguageHebrew(false);
};
const ButtonlanguageHebrew = () => {
setLanguageRus(false);
setLanguageEng(false);
setLanguageHebrew(true);
};
return (
<div>
{language ? null : (
<div>
<AppEng/>
<div className={stylesHeader.languageSettingsButton} onClick={MenuButton}>
<h1 className={stylesHeader.languageSettingsText} onClick={MenuButton}>Eng</h1>
</div>
</div>
)}
{language && (
<div className={AppButtonLanguage.Vector}>
<h1 className={AppButtonLanguage.Eng} onClick={ButtonlanguageEng}>
Eng
</h1>
<div className={AppButtonLanguage.VectorTwo} />
<h1 className={AppButtonLanguage.Rus} onClick={ButtonlanguageRus}>
Rus
</h1>
<h1 className={AppButtonLanguage.AppHebrew} onClick={ButtonlanguageHebrew}>
עִברִית
</h1>
</div>
)}
{languageRus && <AppRu />}
{languageHebrew && <AppHebrew />}
{languageEng && <AppEng />}
</div>
);
}
export default App
Можете дать подсказку? Буду благодарен за любую помощь! const [currentLang, setCurrentLang]=useState("")
const setLang =(lang)=>{
setCurrentLang(lang)
}
<h1 className={AppButtonLanguage.Eng} onClick={()=>{setLang("Eng")}}>
Eng </h1>
<h1 className={stylesHeader.languageSettingsText} onClick={MenuButton}>{currentLang}</h1>
{language && ( <ClickAwayListener onClickAway={функция которая задает окну true & false}><div> </div> </ClickAwayListener> )}