|
|
@ -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 = {}; |
|
|
|
|
|
|
|
|
|
|
@ -129,7 +140,11 @@ class LaptopNavbar extends Component { |
|
|
|
{window.t("خروج")}{" "} |
|
|
|
{window.t("خروج")}{" "} |
|
|
|
</MenuItem> |
|
|
|
</MenuItem> |
|
|
|
</Menu> |
|
|
|
</Menu> |
|
|
|
<select className="language-select"> |
|
|
|
<select |
|
|
|
|
|
|
|
className="language-select" |
|
|
|
|
|
|
|
onChange={(e) => changeLanguage(e.target.value)} |
|
|
|
|
|
|
|
defaultValue={localStorage.getItem("language") || "fa"} |
|
|
|
|
|
|
|
> |
|
|
|
{["fa", "en", "ar"].map((lang, index) => ( |
|
|
|
{["fa", "en", "ar"].map((lang, index) => ( |
|
|
|
<option key={index}>{lang}</option> |
|
|
|
<option key={index}>{lang}</option> |
|
|
|
))} |
|
|
|
))} |
|
|
@ -162,7 +177,11 @@ class LaptopNavbar extends Component { |
|
|
|
</> |
|
|
|
</> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<div className="d-flex"> |
|
|
|
<div className="d-flex"> |
|
|
|
<select className="language-select"> |
|
|
|
<select |
|
|
|
|
|
|
|
className="language-select" |
|
|
|
|
|
|
|
onChange={(e) => changeLanguage(e.target.value)} |
|
|
|
|
|
|
|
defaultValue={localStorage.getItem("language") || "fa"} |
|
|
|
|
|
|
|
> |
|
|
|
{["fa", "en", "ar"].map((lang, index) => ( |
|
|
|
{["fa", "en", "ar"].map((lang, index) => ( |
|
|
|
<option key={index}>{lang}</option> |
|
|
|
<option key={index}>{lang}</option> |
|
|
|
))} |
|
|
|
))} |
|
|
|