l-min-components 1.0.270 → 1.0.275

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.270",
3
+ "version": "1.0.275",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -17,6 +17,7 @@
17
17
  "axios-hooks": "^4.0.0",
18
18
  "chart.js": "^4.2.1",
19
19
  "classnames": "^2.3.2",
20
+ "js-cookie": "^3.0.5",
20
21
  "l-min-components": "^1.0.220",
21
22
  "moment": "^2.29.4",
22
23
  "prop-types": "^15.8.1",
@@ -55,7 +55,7 @@ const AccountDropdown = (props) => {
55
55
  />
56
56
  </div>
57
57
  <div>
58
- <h1>
58
+ <h1 style={{ textTransform: "capitalize" }}>
59
59
  {" "}
60
60
  {props?.selectedAccount?.metadata?.organization_name ||
61
61
  props?.activeAccountName}
@@ -101,7 +101,7 @@ const AccountDropdown = (props) => {
101
101
  )} */}
102
102
  {props?.developerAccountData.length > 0 && (
103
103
  <div>
104
- <h3 style={{ marginBottom: 10 }}>Developer account</h3>
104
+ <h3 style={{ marginBottom: 10 }}>Developer accounts</h3>
105
105
  {props?.developerAccountData?.map((developerItem, idx) => (
106
106
  <div
107
107
  className={`account-info ${
@@ -131,7 +131,7 @@ const AccountDropdown = (props) => {
131
131
  />
132
132
  </div>
133
133
  <div className="account-details">
134
- <h1>
134
+ <h1 style={{ textTransform: "capitalize" }}>
135
135
  {" "}
136
136
  {developerItem?.metadata?.organization_name ||
137
137
  props.accountName}
@@ -275,7 +275,9 @@ const HeaderComponent = (props) => {
275
275
  />
276
276
  </div>
277
277
  <div className="user-info-container">
278
- <h5>{selectedAccount?.metadata?.organization_name}</h5>
278
+ <h5 style={{ textTransform: "capitalize" }}>
279
+ {selectedAccount?.metadata?.organization_name}
280
+ </h5>
279
281
  <h6 style={{ textTransform: "capitalize" }}>
280
282
  {selectedAccount?.type?.toLowerCase()}
281
283
  </h6>
@@ -3,7 +3,7 @@ import styled from "styled-components";
3
3
  /* styles for header component authenticated users */
4
4
  export const Navbar = styled.nav`
5
5
  background-color: rgba(255, 255, 255, 1);
6
- padding: 10px 10px 10px 20px;
6
+ padding: 10px 30px 10px 20px;
7
7
  display: flex;
8
8
  font-family: "Nunito";
9
9
  width: 100%;
@@ -43,7 +43,7 @@ export const NavGroup = styled.div`
43
43
  }
44
44
  .dropdown_list {
45
45
  position: absolute;
46
- top: 75px;
46
+ top: 65px;
47
47
  width: fit-content;
48
48
  background: white;
49
49
  padding: 15px 0;
@@ -542,7 +542,7 @@ export const NavGroup2 = styled.div`
542
542
  }
543
543
  .dropdown_list {
544
544
  position: absolute;
545
- top: 75px;
545
+ top: 65px;
546
546
  width: fit-content;
547
547
  background: white;
548
548
  padding: 15px 0;
@@ -35,7 +35,7 @@ const UserCard = ({ user, isOpen }) => {
35
35
 
36
36
  generalData?.accounts?.results?.map((account, idx) => {
37
37
  if (account?.id === activeDeveloperAccount) {
38
- return setOrganizationName(account?.metadata?.organization_name);
38
+ return setOrganizationName(account);
39
39
  }
40
40
  });
41
41
  }
@@ -49,7 +49,7 @@ const UserCard = ({ user, isOpen }) => {
49
49
  ) : (
50
50
  <>
51
51
  <Avatar
52
- src={userDetails?.data?.profile_picture?.url || avatar}
52
+ src={organizationName?.profile_photo?.url || avatar}
53
53
  isOpen={isOpen}
54
54
  />
55
55
  <UserDetail isOpen={isOpen}>
@@ -60,7 +60,7 @@ const UserCard = ({ user, isOpen }) => {
60
60
  fontWeight: 700,
61
61
  fontSize: 15,
62
62
  }}
63
- >{`${organizationName}.`}</Handle>
63
+ >{`${organizationName?.metadata?.organization_name}.`}</Handle>
64
64
  </UserDetail>
65
65
  </>
66
66
  )}
@@ -9,18 +9,56 @@ import {
9
9
  } from "./styles";
10
10
  import { CiLogout } from "react-icons/ci";
11
11
  import { HiOutlineLogout } from "react-icons/hi";
12
- import LogoutIcon from "./svg/logout"
12
+ import LogoutIcon from "./svg/logout";
13
+ // import deleteCookies from "../../utils/deleteCookies";
14
+ import Cookies from "js-cookie";
13
15
 
14
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
+ };
15
46
  return (
16
47
  <NavWrapper>
17
48
  <NavItems>
18
49
  {routes.map((route) => (
19
50
  <NavItem key={route.path}>
20
51
  <NavLinkStyled
21
- to={route.path}
22
- activeClassName="active"
23
- // className={route?.label === "Learning" ? "active" : ""}
52
+ onClick={() => (window.location.href = route.path)}
53
+ className={
54
+ route?.label !== "Learning"
55
+ ? window.location.pathname.includes(
56
+ route?.label.toLowerCase()
57
+ )
58
+ ? "active"
59
+ : ""
60
+ : !window.location.host?.includes("comingsoon") && "active"
61
+ }
24
62
  >
25
63
  <Icon>{route.icon}</Icon>
26
64
  <span className="text">{route.label}</span>
@@ -28,7 +66,23 @@ const SideBar = ({ routes }) => {
28
66
  </NavItem>
29
67
  ))}
30
68
  </NavItems>
31
- <IconContainer>
69
+ <IconContainer
70
+ onClick={() => {
71
+ deleteCookies("access");
72
+ deleteCookies("refresh");
73
+ setTimeout(() => {
74
+ if (
75
+ window.location.hostname.includes("localhost") ||
76
+ window.location.hostname.includes("staging")
77
+ ) {
78
+ window.location.href =
79
+ "demo-test-01.learngual.com/login/developer";
80
+ } else {
81
+ window.location.href = "demo.learngual.com/login/developer";
82
+ }
83
+ }, 500);
84
+ }}
85
+ >
32
86
  <LogoutIcon className="logout" />
33
87
  <p>Sign Out</p>
34
88
  </IconContainer>
@@ -40,32 +40,32 @@ export const user = {
40
40
 
41
41
  export const leftNavMenu = [
42
42
  {
43
- path: "/learning",
43
+ path: "https://developer-staging-01.learngual.com/",
44
44
  label: "Learning",
45
45
  icon: <Learning />,
46
46
  },
47
47
  {
48
- path: "/community",
48
+ path: "https://comingsoon.learngual.com/community",
49
49
  label: "Community",
50
50
  icon: <CommunityIcon />,
51
51
  },
52
52
  {
53
- path: "/fun",
53
+ path: "https://comingsoon.learngual.com/fun",
54
54
  label: "Fun",
55
55
  icon: <FunIcon />,
56
56
  },
57
57
  {
58
- path: "/duet",
58
+ path: "https://comingsoon.learngual.com/duet",
59
59
  label: "Duet",
60
60
  icon: <DuetIcon />,
61
61
  },
62
62
  {
63
- path: "/speech",
63
+ path: "https://comingsoon.learngual.com/speech",
64
64
  label: "Speech",
65
65
  icon: <SpeechIcon />,
66
66
  },
67
67
  {
68
- path: "/dictionary",
68
+ path: "https://comingsoon.learngual.com/dictionary",
69
69
  label: "Dictionary",
70
70
  icon: <DictionaryIcon />,
71
71
  },