amir hosein gorji 3 years ago
commit 0331967dec
  1. 13
      src/views/Home/Navbar/Laptop/index.js

@ -25,6 +25,17 @@ const fontSize = {
}, },
}; };
const changeLanguage = (val) => {
if (val === "fa") {
localStorage.removeItem("language");
} else if (val === "en") {
localStorage.setItem("language", "en");
} else {
localStorage.setItem("language", "ar");
}
window.location.reload();
};
class LaptopNavbar extends Component { class LaptopNavbar extends Component {
state = {}; state = {};
@ -188,9 +199,9 @@ class LaptopNavbar extends Component {
window.localStorage.setItem("language", e.target.value); window.localStorage.setItem("language", e.target.value);
window.location.reload(); window.location.reload();
}} }}
value={window.lang}
> >
{console.log(window.lang)} {console.log(window.lang)}
{[ {[
{ key: "فارسی", lang: "fa", default: true }, { key: "فارسی", lang: "fa", default: true },
{ key: "English", lang: "en" }, { key: "English", lang: "en" },

Loading…
Cancel
Save