l-min-components 1.0.185 → 1.0.191

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.0.185",
3
+ "version": "1.0.191",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -29,7 +29,7 @@ const AccountDropdown = (props) => {
29
29
  if (pathname?.includes("personal")) {
30
30
  setSelectedAccount(personalAccountData[0]);
31
31
  }
32
- if (pathname?.includes("developer")) {
32
+ if (window.location.host?.includes("developer")) {
33
33
  setSelectedAccount(developerAccountData[0]);
34
34
  }
35
35
  if (pathname?.includes("instructor")) {
@@ -78,8 +78,16 @@ const AccountDropdown = (props) => {
78
78
  }
79
79
  }, [props?.data?.data]);
80
80
  useEffect(() => {
81
- if (selectedAccount) {
82
- window.localStorage.setItem("current-account", selectedAccount);
81
+ if (selectedAccount?.type === "DEVELOPER") {
82
+ date.setDate(date.getDate() + 28);
83
+ document.cookie =
84
+ "activeDeveloperAccount=" +
85
+ selectedAccount?.id +
86
+ `; domain=${
87
+ window.location.href.includes("localhost")
88
+ ? ".localhost"
89
+ : ".learngual.com"
90
+ }; path=/; expires=${date.toUTCString()};`;
83
91
  }
84
92
  }, [selectedAccount]);
85
93
  return (
@@ -146,10 +154,17 @@ const AccountDropdown = (props) => {
146
154
  className="account-info"
147
155
  onClick={() => {
148
156
  setSelectedAccount(developerItem);
149
- if (window.location.port) {
150
- window.location.href = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/developer`;
151
- } else {
152
- window.location.href = `${window.location.protocol}//${window.location.hostname}/developer`;
157
+
158
+ if (
159
+ window.location.port &&
160
+ window.location.host.includes("developer")
161
+ ) {
162
+ window.location.href = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/`;
163
+ } else if (
164
+ !window.location.port &&
165
+ window.location.host.includes("developer")
166
+ ) {
167
+ window.location.href = `${window.location.protocol}//${window.location.hostname}/`;
153
168
  }
154
169
  }}
155
170
  key={idx}
@@ -374,6 +374,7 @@ export const Navbar2 = styled.nav`
374
374
  align-items: center;
375
375
  position: fixed;
376
376
  z-index: 99;
377
+ justify-content: space-between;
377
378
  `;
378
379
 
379
380
  export const Nav2 = styled.ul`
@@ -33,7 +33,7 @@ const HeaderComponentTwo = (props) => {
33
33
  return (
34
34
  <Navbar2>
35
35
  <img src={logo} alt="Learngual logo" />
36
- <Nav2>
36
+ {/* <Nav2>
37
37
  <li>
38
38
  <a href="#" className="active">
39
39
  What we do
@@ -48,14 +48,14 @@ const HeaderComponentTwo = (props) => {
48
48
  <li>
49
49
  <a href="#">Contact</a>
50
50
  </li>
51
- </Nav2>
51
+ </Nav2> */}
52
52
 
53
53
  <NavGroup2>
54
54
  <CountryFlagGroup2>
55
55
  <ReactFlagsSelect
56
56
  selected={selected}
57
57
  onSelect={(code) => setSelected(code)}
58
- showOptionLabel={false}
58
+ showOptionLabel={true}
59
59
  />
60
60
  <ArrowDownIcon />
61
61
  </CountryFlagGroup2>