l-min-components 1.0.262 → 1.0.264

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.262",
3
+ "version": "1.0.264",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
Binary file
@@ -53,6 +53,9 @@ export const RightLayout = styled.div`
53
53
  max-height: 609px;
54
54
  height: 609px;
55
55
  right: 20px;
56
+ @media screen and (max-width: 1023px) {
57
+ display: none;
58
+ }
56
59
  > div {
57
60
  width: 100%;
58
61
  }
@@ -55,7 +55,8 @@ const AccountDropdown = (props) => {
55
55
  props?.activeAccountName}
56
56
  </h1>
57
57
  <h2 style={{ textTransform: "capitalize" }}>
58
- {props?.selectedAccount?.type || props.activeAccountType}{" "}
58
+ {props?.selectedAccount?.type?.toLowerCase() ||
59
+ props.activeAccountType}{" "}
59
60
  </h2>
60
61
  </div>
61
62
  </AccountDropdownHeader>
@@ -94,10 +95,12 @@ const AccountDropdown = (props) => {
94
95
  )} */}
95
96
  {props?.developerAccountData.length > 0 && (
96
97
  <div>
97
- <h3>Developer account</h3>
98
+ <h3 style={{ marginBottom: 10 }}>Developer account</h3>
98
99
  {props?.developerAccountData?.map((developerItem, idx) => (
99
100
  <div
100
- className="account-info"
101
+ className={`account-info ${
102
+ developerItem === props?.selectedAccount ? "activated" : ""
103
+ }`}
101
104
  onClick={() => {
102
105
  props?.setSelectedAccount(developerItem);
103
106
 
@@ -134,7 +137,9 @@ const AccountDropdown = (props) => {
134
137
  <h3>Instructor account</h3>
135
138
  {props?.instructorAccountData?.map((instructorItem, idx) => (
136
139
  <div
137
- className="account-info"
140
+ className={`account-info ${
141
+ instructorItem === props?.selectedAccount ? "activated" : ""
142
+ }`}
138
143
  onClick={() => {
139
144
  props?.setSelectedAccount(instructorItem);
140
145
  if (window.location.port) {
@@ -167,7 +172,9 @@ const AccountDropdown = (props) => {
167
172
  <h3>Enterprise account</h3>
168
173
  {props?.enterpriseAccountData?.map((enterpriseItem, idx) => (
169
174
  <div
170
- className="account-info"
175
+ className={`account-info ${
176
+ enterpriseItem === props?.selectedAccount ? "activated" : ""
177
+ }`}
171
178
  onClick={() => {
172
179
  props?.setSelectedAccount(enterpriseItem);
173
180
  if (window.location.port) {
@@ -22,7 +22,7 @@ import {
22
22
  import useHeader from "./getHeaderDetails";
23
23
  import { OutletContext } from "..";
24
24
  import { useLocation } from "react-router-dom";
25
- import usFlag from "../../assets/images/18165.jpg";
25
+ import usFlag from "../../assets/images/usFlag.png";
26
26
  /**
27
27
  * @param {{
28
28
  * type: string,
@@ -198,6 +198,7 @@ const HeaderComponent = (props) => {
198
198
  window.location.href =
199
199
  "https://developer-staging-01.learngual.com/settings/";
200
200
  }}
201
+ style={{ cursor: "pointer" }}
201
202
  >
202
203
  <SettingIcon /> Settings
203
204
  </a>
@@ -16,6 +16,14 @@ export const NavGroup = styled.div`
16
16
  width: 44%;
17
17
  display: flex;
18
18
  justify-content: end;
19
+ align-items: center;
20
+ @media screen and (max-width: 1530px) {
21
+ width: fit-content;
22
+ margin-left: auto;
23
+ }
24
+ @media screen and (max-width: 1023px) {
25
+ display: none;
26
+ }
19
27
  .language_dropdown {
20
28
  display: flex;
21
29
  align-items: center;
@@ -68,6 +76,9 @@ export const Nav = styled.ul`
68
76
  margin: 0 10px;
69
77
  padding: 0 5px;
70
78
  width: 57%;
79
+ @media screen and (max-width: 1530px) {
80
+ width: 40%;
81
+ }
71
82
  & li {
72
83
  display: flex;
73
84
  align-items: center;
@@ -118,6 +129,14 @@ export const SearchInputGroup = styled.div`
118
129
  padding: 9px;
119
130
  margin: 0 15px;
120
131
  position: relative;
132
+ @media screen and (max-width: 1530px) {
133
+ width: 200px;
134
+ padding: 9px;
135
+ height: fit-content;
136
+ input {
137
+ width: 100%;
138
+ }
139
+ }
121
140
  &:focus {
122
141
  width: 130px;
123
142
  }
@@ -191,6 +210,9 @@ export const UserProfile = styled.div`
191
210
  color: rgba(49, 51, 51, 1);
192
211
  font-size: 16px;
193
212
  font-weight: 700;
213
+ @media screen and (max-width: 1530px) {
214
+ font-size: 12px;
215
+ }
194
216
  }
195
217
 
196
218
  & h6 {
@@ -270,7 +292,7 @@ export const AccountDropdownLayout = styled.div`
270
292
  background-color: #ffffff;
271
293
  font-family: "Nunito";
272
294
  width: 286px;
273
- min-height: 300px;
295
+ max-height: 530px;
274
296
  box-shadow: 0px 2px 40px rgba(0, 0, 0, 0.08);
275
297
  border-radius: 30px;
276
298
  display: flex;
@@ -370,6 +392,9 @@ export const AccountDropdownBody = styled.div`
370
392
  }
371
393
  }
372
394
  }
395
+ & .activated {
396
+ background-color: rgba(239, 248, 248, 1);
397
+ }
373
398
 
374
399
  & .account-details {
375
400
  margin-left: 10px;
@@ -5,7 +5,7 @@ import { Navbar2, NavGroup2, Nav2, CountryFlagGroup2 } from "./index.styled";
5
5
  import { ArrowDownIcon } from "./assets/svg/arrow-down";
6
6
  import ButtonComponent from "../button";
7
7
  import { useLocation, useNavigate } from "react-router-dom";
8
- import usFlag from "../../assets/images/18165.jpg";
8
+ import usFlag from "../../assets/images/usFlag.png";
9
9
 
10
10
  /**
11
11
  * @param {{
@@ -33,8 +33,28 @@ const SideMenu = ({
33
33
 
34
34
  const renderNavigationItem = (route, index) => {
35
35
  const { icon, text, notifications, path } = route;
36
- const active = window.location.pathname === route.path;
37
- console.log(active);
36
+ const handlePathCheck = () => {
37
+ let statusText;
38
+ console.log(window.location.pathname, "pathname");
39
+ if (
40
+ (window.location.pathname.includes("api") && path === "/") ||
41
+ (window.location.pathname === "/" && path === "/")
42
+ ) {
43
+ return (statusText = true);
44
+ }
45
+ if (
46
+ window.location.pathname.includes("documentation") &&
47
+ path === "/documentation"
48
+ ) {
49
+ return (statusText = true);
50
+ }
51
+ if (window.location.pathname.includes("report") && path === "/report") {
52
+ return (statusText = true);
53
+ } else {
54
+ return (statusText = false);
55
+ }
56
+ };
57
+ const active = handlePathCheck();
38
58
 
39
59
  return (
40
60
  <NavigationItemContainer
@@ -1,4 +1,4 @@
1
- import React, { useEffect } from "react";
1
+ import React, { useContext, useEffect, useState } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import {
4
4
  UserCardContainer,
@@ -10,15 +10,40 @@ import {
10
10
  import useHeader from "../../header/getHeaderDetails";
11
11
  import Loader from "../../loader";
12
12
  import avatar from "../../../assets/images/avatar.png";
13
+ import { OutletContext } from "../../AppMainLayout";
13
14
 
14
15
  const UserCard = ({ user, isOpen }) => {
15
16
  const { handleGetUserDetails, userDetails } = useHeader();
17
+ const [organizationName, setOrganizationName] = useState();
18
+ const { generalData } = useContext(OutletContext);
19
+ console.log(generalData, "data");
16
20
  useEffect(() => {
17
21
  handleGetUserDetails();
22
+ if (generalData?.accounts) {
23
+ const cookies = document.cookie;
24
+ const cookieArray = cookies.split(";");
25
+ let activeDeveloperAccount;
26
+ for (let i = 0; i < cookieArray.length; i++) {
27
+ const cookie = cookieArray[i].trim();
28
+ if (cookie.startsWith("activeDeveloperAccount=")) {
29
+ activeDeveloperAccount = cookie.substring(
30
+ "activeDeveloperAccount=".length,
31
+ cookie.length
32
+ );
33
+ break;
34
+ }
35
+ }
36
+ generalData?.accounts?.results?.map((account, idx) => {
37
+ if (account?.id === activeDeveloperAccount) {
38
+ return setOrganizationName(account?.metadata?.organization_name);
39
+ }
40
+ });
41
+ }
18
42
  }, []);
43
+
19
44
  return (
20
45
  <UserCardContainer isOpen={isOpen}>
21
- {userDetails?.loading ? (
46
+ {userDetails?.loading && !organizationName ? (
22
47
  <Loader zoom={0.3} />
23
48
  ) : (
24
49
  <>
@@ -27,12 +52,14 @@ const UserCard = ({ user, isOpen }) => {
27
52
  isOpen={isOpen}
28
53
  />
29
54
  <UserDetail isOpen={isOpen}>
30
- <UserName>
31
- {userDetails?.data?.first_name +
32
- " " +
33
- userDetails?.data?.last_name}
34
- </UserName>
35
- <Handle>{`@ ${userDetails?.data?.username}`}</Handle>
55
+ <UserName>Hello</UserName>
56
+ <Handle
57
+ style={{
58
+ textTransform: "capitalize",
59
+ fontWeight: 700,
60
+ fontSize: 15,
61
+ }}
62
+ >{`${organizationName}.`}</Handle>
36
63
  </UserDetail>
37
64
  </>
38
65
  )}