l-min-components 1.0.273 → 1.0.277

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.273",
3
+ "version": "1.0.277",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -10,15 +10,47 @@ import {
10
10
  import { CiLogout } from "react-icons/ci";
11
11
  import { HiOutlineLogout } from "react-icons/hi";
12
12
  import LogoutIcon from "./svg/logout";
13
- import deleteCookies from "../../utils/deleteCookies";
13
+ // import deleteCookies from "../../utils/deleteCookies";
14
+ import Cookies from "js-cookie";
14
15
 
15
16
  const SideBar = ({ routes }) => {
17
+ const deleteCookies = (name) => {
18
+ const date = new Date();
19
+ date.setHours(date.getHours() - 1);
20
+ const { host } = window.location;
21
+ const env = host.includes("localhost")
22
+ ? "local"
23
+ : host.includes("test") || host.includes("staging")
24
+ ? "staging"
25
+ : "production";
26
+ if (env === "staging") {
27
+ Cookies.remove(name, {
28
+ domain: ".learngual.com",
29
+ expires: date,
30
+ path: "/",
31
+ });
32
+ } else if (env === "local") {
33
+ Cookies.remove(name, {
34
+ domain: ".localhost",
35
+ expires: date,
36
+ path: "/",
37
+ });
38
+ } else {
39
+ Cookies.remove(name, {
40
+ domain: ".learngual.com",
41
+ expires: date,
42
+ path: "/",
43
+ });
44
+ }
45
+ };
16
46
  return (
17
47
  <NavWrapper>
18
48
  <NavItems>
19
49
  {routes.map((route) => (
20
50
  <NavItem key={route.path}>
21
51
  <NavLinkStyled
52
+ activeClassName="active"
53
+ to={route?.path}
22
54
  onClick={() => (window.location.href = route.path)}
23
55
  className={
24
56
  route?.label !== "Learning"