diff --git a/src/views/Home/Navbar/Laptop/index.js b/src/views/Home/Navbar/Laptop/index.js index a5c2056..3debb57 100644 --- a/src/views/Home/Navbar/Laptop/index.js +++ b/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 { state = {}; @@ -188,9 +199,9 @@ class LaptopNavbar extends Component { window.localStorage.setItem("language", e.target.value); window.location.reload(); }} - value={window.lang} > {console.log(window.lang)} + {[ { key: "فارسی", lang: "fa", default: true }, { key: "English", lang: "en" },