l-min-components 1.0.223 → 1.0.225

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.223",
3
+ "version": "1.0.225",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -17,13 +17,14 @@
17
17
  "axios-hooks": "^4.0.0",
18
18
  "chart.js": "^4.2.1",
19
19
  "classnames": "^2.3.2",
20
- "l-min-components": "^1.0.197",
20
+ "l-min-components": "^1.0.220",
21
21
  "moment": "^2.29.4",
22
22
  "prop-types": "^15.8.1",
23
23
  "rc-slider": "^10.1.1",
24
24
  "rc-tooltip": "^6.0.1",
25
25
  "react": "^18.2.0",
26
26
  "react-chartjs-2": "^5.2.0",
27
+ "react-cookie": "^4.1.1",
27
28
  "react-datepicker": "^4.10.0",
28
29
  "react-dom": "^18.2.0",
29
30
  "react-flags-select": "^2.2.3",
@@ -58,7 +58,19 @@ const HeaderComponent = (props) => {
58
58
  accounts: userAccountsDetail?.data,
59
59
  user: userDetails?.data,
60
60
  }));
61
-
61
+ const cookies = document.cookie;
62
+ const cookieArray = cookies.split(";");
63
+ let activeDeveloperAccount;
64
+ for (let i = 0; i < cookieArray.length; i++) {
65
+ const cookie = cookieArray[i].trim();
66
+ if (cookie.startsWith("activeDeveloperAccount=")) {
67
+ activeDeveloperAccount = cookie.substring(
68
+ "activeDeveloperAccount=".length,
69
+ cookie.length
70
+ );
71
+ break;
72
+ }
73
+ }
62
74
  let personalArray = [];
63
75
  let developerArray = [];
64
76
  let instructorArray = [];
@@ -94,7 +106,10 @@ const HeaderComponent = (props) => {
94
106
  setSelectedAccount(personalArray[0]);
95
107
  }
96
108
  if (window.location.host?.includes("developer")) {
97
- setSelectedAccount(developerArray[0]);
109
+ setSelectedAccount(
110
+ developerArray.find((item) => item.id === activeDeveloperAccount) ??
111
+ {}
112
+ );
98
113
  }
99
114
  if (pathname?.includes("instructor")) {
100
115
  setSelectedAccount(instructorArray[0]);
@@ -43,14 +43,14 @@ const SideMenu = ({
43
43
  window.location.hostname.includes("staging") &&
44
44
  window.location.hostname.includes("developer")
45
45
  ) {
46
- window.location.href = `developer-staging-01.learngual.com/${path}`;
46
+ window.location.href = `https://developer-staging-01.learngual.com/${path}`;
47
47
  } else if (window.location.hostname.includes("localhost")) {
48
48
  window.location.href = `http://localhost:${window.location.port}${path}`;
49
49
  } else if (
50
50
  window.location.hostname.includes("developer") &&
51
51
  !window.location.hostname.includes("staging")
52
52
  ) {
53
- window.location.href = `developer.learngual.com/${path}`;
53
+ window.location.href = `https://developer.learngual.com/${path}`;
54
54
  }
55
55
  }}
56
56
  // to={route.path}