update public/index.html, AppRouter.js, src/views/Home/Navbar/Laptop/index.js and src/views/Home/Navbar/Laptop/index.scss

front
amir hosein gorji 3 years ago
parent ded3106345
commit 042384df90
  1. 32
      public/index.html
  2. 2
      src/AppRouter.js
  3. 52
      src/views/Home/Navbar/Laptop/index.js
  4. 11
      src/views/Home/Navbar/Laptop/index.scss

@ -1,19 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta <meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="false" />
name="viewport"
content="width=device-width, initial-scale=1"
user-scalable="false"
/>
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="دانوین" /> <meta name="description" content="دانوین" />
<link <link href="https://api.mapbox.com/mapbox-gl-js/v1.10.1/mapbox-gl.css" rel="stylesheet" />
href="https://api.mapbox.com/mapbox-gl-js/v1.10.1/mapbox-gl.css"
rel="stylesheet"
/>
<meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" />
@ -25,6 +19,7 @@
<script src="en.js"></script> <script src="en.js"></script>
<script> <script>
const lang = localStorage.getItem("language"); const lang = localStorage.getItem("language");
window.lang = lang
window.ar = ar; window.ar = ar;
window.en = en; window.en = en;
function t(val) { function t(val) {
@ -49,18 +44,12 @@
})(window, document, "script", "dataLayer", "GTM-WVV8H9L"); })(window, document, "script", "dataLayer", "GTM-WVV8H9L");
</script> </script>
<!-- End Google Tag Manager --> <!-- End Google Tag Manager -->
</head> </head>
<body> <body>
<!-- Google Tag Manager (noscript) --> <!-- Google Tag Manager (noscript) -->
<noscript <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WVV8H9L" height="0" width="0"
><iframe style="display: none; visibility: hidden"></iframe></noscript>
src="https://www.googletagmanager.com/ns.html?id=GTM-WVV8H9L"
height="0"
width="0"
style="display: none; visibility: hidden"
></iframe
></noscript>
<!-- End Google Tag Manager (noscript) --> <!-- End Google Tag Manager (noscript) -->
<div id="root"></div> <div id="root"></div>
<script> <script>
@ -81,5 +70,6 @@
}); });
} }
</script> </script>
</body> </body>
</html> </html>

@ -218,7 +218,7 @@ class AppRouter extends Component {
)} )}
</Route> </Route>
<Route exact path={"/profile"}> <Route exact path={"/profile"}>
{mobile ? status ? <Auth page={"profile"} /> : null : null} {status ? <Auth page={"profile"} /> : null}
</Route> </Route>
<Route exact path={"/qr-scan"}> <Route exact path={"/qr-scan"}>
{mobile ? ( {mobile ? (

@ -129,9 +129,29 @@ class LaptopNavbar extends Component {
{window.t("خروج")}{" "} {window.t("خروج")}{" "}
</MenuItem> </MenuItem>
</Menu> </Menu>
<select className="language-select"> <select
{["fa", "en", "ar"].map((lang, index) => ( className="language-select"
<option key={index}>{lang}</option> onChange={(e) => {
window.localStorage.setItem("language", e.target.value);
window.location.reload();
}}
>
{console.log(window.lang)}
{[
{ key: "فارسی", lang: "fa", default: true },
{ key: "English", lang: "en" },
{ key: "العربیه", lang: "ar" },
].map((el, index) => (
<option
key={el.lang}
value={el.lang}
selected={
(!window.lang && el.default) || el.lang == window.lang
}
>
{el.key}
</option>
))} ))}
</select> </select>
<div <div
@ -162,9 +182,29 @@ class LaptopNavbar extends Component {
</> </>
) : ( ) : (
<div className="d-flex"> <div className="d-flex">
<select className="language-select"> <select
{["fa", "en", "ar"].map((lang, index) => ( className="language-select"
<option key={index}>{lang}</option> onChange={(e) => {
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" },
{ key: "العربیه", lang: "ar" },
].map((el, index) => (
<option
key={el.lang}
value={el.lang}
selected={
(!window.lang && el.default) || el.lang == window.lang
}
>
{el.key}
</option>
))} ))}
</select> </select>
<Link <Link

@ -3,15 +3,16 @@
margin: 0px auto; margin: 0px auto;
.language-select { .language-select {
border: none; border: 1px solid #6cbe44;
outline: none; outline: none;
width: 50px; width: 100px;
background-color: #6cbe44;
color: white; color: #6cbe44;
font-weight: 500; font-weight: 500;
margin: 0px 10px; margin: 0px 10px;
border-radius: 5px; border-radius: 5px;
padding: 0px 4px; padding: 3px;
} }
&__header { &__header {

Loading…
Cancel
Save