Compare commits

...

2 Commits

  1. 150
      public/index.html
  2. 2
      src/AppRouter.js
  3. 48
      src/views/Home/Navbar/Laptop/index.js
  4. 11
      src/views/Home/Navbar/Laptop/index.scss

@ -1,85 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1"
user-scalable="false"
/>
<meta name="theme-color" content="#000000" />
<meta name="description" content="دانوین" />
<link
href="https://api.mapbox.com/mapbox-gl-js/v1.10.1/mapbox-gl.css"
rel="stylesheet"
/>
<meta name="mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>دانوین</title>
<!-- Google Tag Manager -->
<script src="ar.js"></script>
<script src="en.js"></script>
<script>
const lang = localStorage.getItem("language");
window.ar = ar;
window.en = en;
function t(val) {
const lang_ = window[lang];
if (!lang_) return val;
if (!lang_[val]) console.error(val);
return lang_[val] || "*" + val;
}
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="false" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="دانوین" />
<link href="https://api.mapbox.com/mapbox-gl-js/v1.10.1/mapbox-gl.css" rel="stylesheet" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({
"gtm.start": new Date().getTime(),
event: "gtm.js",
});
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != "dataLayer" ? "&l=" + l : "";
j.async = true;
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, "script", "dataLayer", "GTM-WVV8H9L");
</script>
<!-- End Google Tag Manager -->
</head>
<title>دانوین</title>
<!-- Google Tag Manager -->
<script src="ar.js"></script>
<script src="en.js"></script>
<script>
const lang = localStorage.getItem("language");
window.lang = lang
window.ar = ar;
window.en = en;
function t(val) {
const lang_ = window[lang];
if (!lang_) return val;
if (!lang_[val]) console.error(val);
return lang_[val] || "*" + val;
}
<body>
<!-- Google Tag Manager (noscript) -->
<noscript
><iframe
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) -->
<div id="root"></div>
<script>
if ("serviceWorker" in navigator) {
window.addEventListener("load", function () {
navigator.serviceWorker
.register("./serviceworker.js")
.then((registration) => {
// Registration was successful
console.log(
"ServiceWorker registration successful with scope: ",
registration.scope
);
})
.catch((err) => {
console.log(err);
});
});
}
</script>
</body>
</html>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({
"gtm.start": new Date().getTime(),
event: "gtm.js",
});
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != "dataLayer" ? "&l=" + l : "";
j.async = true;
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, "script", "dataLayer", "GTM-WVV8H9L");
</script>
<!-- End Google Tag Manager -->
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe 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) -->
<div id="root"></div>
<script>
if ("serviceWorker" in navigator) {
window.addEventListener("load", function () {
navigator.serviceWorker
.register("./serviceworker.js")
.then((registration) => {
// Registration was successful
console.log(
"ServiceWorker registration successful with scope: ",
registration.scope
);
})
.catch((err) => {
console.log(err);
});
});
}
</script>
</body>
</html>

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

@ -142,11 +142,27 @@ class LaptopNavbar extends Component {
</Menu>
<select
className="language-select"
onChange={(e) => changeLanguage(e.target.value)}
defaultValue={localStorage.getItem("language") || "fa"}
onChange={(e) => {
window.localStorage.setItem("language", e.target.value);
window.location.reload();
}}
>
{["fa", "en", "ar"].map((lang, index) => (
<option key={index}>{lang}</option>
{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>
<div
@ -179,11 +195,27 @@ class LaptopNavbar extends Component {
<div className="d-flex">
<select
className="language-select"
onChange={(e) => changeLanguage(e.target.value)}
defaultValue={localStorage.getItem("language") || "fa"}
onChange={(e) => {
window.localStorage.setItem("language", e.target.value);
window.location.reload();
}}
>
{["fa", "en", "ar"].map((lang, index) => (
<option key={index}>{lang}</option>
{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>
<Link

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

Loading…
Cancel
Save