|
|
|
@ -23,6 +23,17 @@ function BackButton({ children }) { |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const useStyles = makeStyles({ |
|
|
|
|
list: { |
|
|
|
|
width: window.innerWidth * 0.8, |
|
|
|
@ -89,6 +100,15 @@ export default function MobileNavbar(props) { |
|
|
|
|
</Link> |
|
|
|
|
</div> |
|
|
|
|
<div className="mobile-navbar__left d-flex" style={{ marginLeft: 10 }}> |
|
|
|
|
<select |
|
|
|
|
className="language-select" |
|
|
|
|
onChange={(e) => changeLanguage(e.target.value)} |
|
|
|
|
defaultValue={localStorage.getItem("language") || "fa"} |
|
|
|
|
> |
|
|
|
|
{["fa", "en", "ar"].map((lang, index) => ( |
|
|
|
|
<option key={index}>{lang}</option> |
|
|
|
|
))} |
|
|
|
|
</select> |
|
|
|
|
<Link |
|
|
|
|
style={{ fontSize: 12 }} |
|
|
|
|
to={"/auth"} |
|
|
|
@ -129,6 +149,15 @@ export default function MobileNavbar(props) { |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div className="mobile-navbar__left"> |
|
|
|
|
<select |
|
|
|
|
className="language-select" |
|
|
|
|
onChange={(e) => changeLanguage(e.target.value)} |
|
|
|
|
defaultValue={localStorage.getItem("language") || "fa"} |
|
|
|
|
> |
|
|
|
|
{["fa", "en", "ar"].map((lang, index) => ( |
|
|
|
|
<option key={index}>{lang}</option> |
|
|
|
|
))} |
|
|
|
|
</select> |
|
|
|
|
{page === "home" || page === "download" ? ( |
|
|
|
|
<Link to={"/products"}> |
|
|
|
|
<img src={search} alt={window.t("جستجو")} /> |
|
|
|
|