l-min-components 1.7.1475 → 1.7.1476

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.7.1475",
3
+ "version": "1.7.1476",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -38,21 +38,30 @@ const AccountDropdown = (props) => {
38
38
  }, [props?.selectedAccount]);
39
39
 
40
40
  const handleRedirectFunc = ({ type, id }) => {
41
+ // optimize the use of this base later because it's redeclared on multiple files
42
+ const base = `${
43
+ window.location.hostname.includes("localhost") ||
44
+ window.location.hostname.includes("staging")
45
+ ? `https://559staging.learngual.${
46
+ window.location.hostname.includes(".ca") ? "ca" : "com"
47
+ }`
48
+ : `https://www.learngual.${
49
+ window.location.hostname.includes(".ca") ? "ca" : "com"
50
+ }`
51
+ }`;
41
52
  if (window.location.port) {
42
53
  window.location.href = `${window.location.protocol}//${
43
54
  window.location.hostname
44
55
  }:${window.location.port}/${type?.toLowerCase()}`;
45
56
  } else {
46
- window.location.href = `${window.location.protocol}//${
47
- window.location.hostname
48
- }/${type?.toLowerCase()}`;
57
+ window.location.href = `${base}/${type?.toLowerCase()}`;
49
58
  }
50
59
  // //console.log(id, "bam");
51
60
  };
52
61
 
53
62
  // console.log(props?.selectedAccount, "selected");
54
63
 
55
- const [isLoading, setIsLoading] = useState(false)
64
+ const [isLoading, setIsLoading] = useState(false);
56
65
 
57
66
  return (
58
67
  <>
@@ -129,12 +138,12 @@ const AccountDropdown = (props) => {
129
138
  : ""
130
139
  }`}
131
140
  onClick={() => {
132
- setIsLoading(true)
141
+ setIsLoading(true);
133
142
 
134
143
  deleteCookies([
135
144
  "defaultAccountType",
136
145
  "defaultAccountID",
137
- "activeDeveloperAccount"
146
+ "activeDeveloperAccount",
138
147
  ]);
139
148
 
140
149
  props?.setSelectedAccount(developerItem);
@@ -185,12 +194,12 @@ const AccountDropdown = (props) => {
185
194
  : ""
186
195
  }`}
187
196
  onClick={() => {
188
- setIsLoading(true)
197
+ setIsLoading(true);
189
198
 
190
199
  deleteCookies([
191
200
  "defaultAccountType",
192
201
  "defaultAccountID",
193
- "activeDeveloperAccount"
202
+ "activeDeveloperAccount",
194
203
  ]);
195
204
  props?.setSelectedAccount(instructorItem);
196
205
  setTimeout(() => {
@@ -233,8 +242,12 @@ const AccountDropdown = (props) => {
233
242
  : ""
234
243
  }`}
235
244
  onClick={() => {
236
- setIsLoading(true)
237
- deleteCookies(["defaultAccountType", "defaultAccountID", "activeDeveloperAccount"]);
245
+ setIsLoading(true);
246
+ deleteCookies([
247
+ "defaultAccountType",
248
+ "defaultAccountID",
249
+ "activeDeveloperAccount",
250
+ ]);
238
251
  props?.setSelectedAccount(enterpriseItem);
239
252
  setTimeout(() => {
240
253
  handleRedirectFunc(enterpriseItem);
@@ -275,10 +288,11 @@ const AccountDropdown = (props) => {
275
288
  : ""
276
289
  }`}
277
290
  onClick={() => {
278
- setIsLoading(true)
291
+ setIsLoading(true);
279
292
  deleteCookies([
280
293
  "defaultAccountType",
281
- "defaultAccountID","activeDeveloperAccount"
294
+ "defaultAccountID",
295
+ "activeDeveloperAccount",
282
296
  ]);
283
297
  props?.setSelectedAccount(personalItem);
284
298
  setTimeout(() => {
@@ -323,7 +337,7 @@ const AccountDropdown = (props) => {
323
337
  </button>
324
338
  </AccountDropdownFooter>
325
339
  </AccountDropdownLayout>
326
- {isLoading&&<FullPageLoader hasBackground fixed={true} />}
340
+ {isLoading && <FullPageLoader hasBackground fixed={true} />}
327
341
  </>
328
342
  );
329
343
  };