import React from "react"; import Accordion from "../Componets/Acardion"; import CheckField from "../Componets/CheckField"; //import Menu from "../Componets/menu"; /*const menuItm = [ { name: "portage", text: "portage", url: "/sport" }, { name: "webpp", text: "App", url: "/app" } ];*/ class PageSettings extends React.Component { settings = { USE: [], lang: "RU" }; styleUseinfo = { mobile: { position: "fixed", bottom: "0px", left: "0px", width: "100vw", background: "#FFF", borderTop: "1px solid #CDC", paddingTop: "5px" }, nomob: { margin: "5px" } }; langs = [ { title: "RU", link: "" }, { title: "EN", link: "" }, { title: "DE", link: "" } ]; isMobile() { try { document.createEvent("TouchEvent"); return true; } catch (e) { return false; } } changLang(lang) { console.log(lang); if ( document.getElementById(lang).style.background !== "#0F0" || document.getElementById(lang).style.background !== "rgb(0, 255, 0)" ) { document.getElementById(lang).style.background = "#0F0"; document.getElementById(this.settings.lang).style.background = "#FFF"; this.settings.lang = lang; //document.getElementById(lang).style.background = "#FFF"; //this.IntstallPackageParamms.USE.map((us, i)=>( // if( us== use)this.IntstallPackageParamms.USE[i].delete //)) } else { document.getElementById(lang).style.background = "#0F0"; this.settings.lang = lang; //this.settings.USE[this.IntstallPackageParamms.USE.length + 1] = use; } console.log(this.settings); } addUse(use) { console.log(use); if ( document.getElementById(use).style.background === "#0F0" || document.getElementById(use).style.background === "rgb(0, 255, 0)" ) { document.getElementById(use).style.background = "#FFF"; //this.IntstallPackageParamms.USE.map((us, i)=>( // if( us== use)this.IntstallPackageParamms.USE[i].delete //)) } else { document.getElementById(use).style.background = "#0F0"; //this.settings.USE[this.IntstallPackageParamms.USE.length + 1] = use; } console.log(this.settings); } VuseInfo(uId, use) { //console.log(typeof(use)); console.log(uId); //console.log(Object.keys(this.props.uses)); if (use in this.props.uses) { document.getElementById("useInfo").textContent = use; //document.getElementById(uId).style.background = "orange"; //alert(this.props.useDes[use]); } else { document.getElementById("useInfo").textContent = use; } //document.getElementById("useInfo").textContent = use; } TitleView() { try { if (document.getElementById("pTitle").textContent !== "Настройки") { document.getElementById("pTitle").textContent = "Настройки"; } } catch (e) { console.log(e); } } render() { this.TitleView(); return (

UI


Тема
    {}
    {Object.keys(this.langs).map((lng) => (
  • this.changLang(this.langs[lng].title)} > {this.langs[lng].title}
  • ))}

Адресс сервера {" "}

{Object.keys(this.props.uses).map((u, j) => ( this.VuseInfo(u, this.props.uses[u])} onClick={() => this.addUse(u)} > {u} ))}
); } } export default PageSettings;