l-min-components 1.0.366 → 1.0.374
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 +1 -1
- package/src/components/AppMainLayout/index.jsx +8 -1
- package/src/components/fileRightBar/assets/Ellipse.png +0 -0
- package/src/components/fileRightBar/assets/Ellipse2.png +0 -0
- package/src/components/fileRightBar/assets/Ellipse3.png +0 -0
- package/src/components/fileRightBar/assets/Ellipse4.png +0 -0
- package/src/components/fileRightBar/assets/lession.jsx +11 -0
- package/src/components/fileRightBar/assets/lessonflag.jsx +11 -0
- package/src/components/fileRightBar/assets/newLanguage.png +0 -0
- package/src/components/fileRightBar/assets/slider.jsx +13 -0
- package/src/components/fileRightBar/components/ugradeLock.jsx +5 -1
- package/src/components/fileRightBar/instructorRightBar.jsx +101 -0
- package/src/components/fileRightBar/styles/index.jsx +182 -8
- package/src/components/index.js +2 -0
- package/src/components/sideBar/sideMenu/index.jsx +20 -3
- package/src/components/sideBar/userCard/index.jsx +25 -1
- package/src/components/sideBar/userCard/styles/index.jsx +2 -1
- package/src/hooks/leftNavMenu.jsx +1 -0
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
SideMenu,
|
|
21
21
|
} from "../";
|
|
22
22
|
import { leftNavMenu, user, sideMenuOptions } from "../../hooks/leftNavMenu";
|
|
23
|
+
import InstructorAccountSwitcher from "../instructorAccountSwitcher";
|
|
23
24
|
// import SideMenu from "../sideBar/sideMenu";
|
|
24
25
|
|
|
25
26
|
const AppMainLayout = () => {
|
|
@@ -38,6 +39,7 @@ const AppMainLayout = () => {
|
|
|
38
39
|
const [sideMenuLayout, setSideMenuLayout] = useState(true);
|
|
39
40
|
const [defaultAcct, setDefaultAcct] = useState("");
|
|
40
41
|
const [centerLayoutStyle, setCenterLayoutStyle] = useState({});
|
|
42
|
+
const [affiliatesActive, setAffiliatesActive] = useState(false);
|
|
41
43
|
|
|
42
44
|
useEffect(() => {
|
|
43
45
|
if (window.location.host.includes("coming")) {
|
|
@@ -82,7 +84,8 @@ const AppMainLayout = () => {
|
|
|
82
84
|
selectedCourseId,
|
|
83
85
|
setSelectedCourseId,
|
|
84
86
|
centerLayoutStyle,
|
|
85
|
-
setCenterLayoutStyle
|
|
87
|
+
setCenterLayoutStyle,
|
|
88
|
+
setAffiliatesActive
|
|
86
89
|
}}
|
|
87
90
|
>
|
|
88
91
|
<Layout
|
|
@@ -99,6 +102,7 @@ const AppMainLayout = () => {
|
|
|
99
102
|
<SideMenu
|
|
100
103
|
user={user}
|
|
101
104
|
routes={sideMenuOptions}
|
|
105
|
+
affiliatesActive={affiliatesActive}
|
|
102
106
|
userType={
|
|
103
107
|
window.location.pathname.includes("enterprise")
|
|
104
108
|
? "enterprise"
|
|
@@ -118,6 +122,9 @@ const AppMainLayout = () => {
|
|
|
118
122
|
)}
|
|
119
123
|
</LeftLayout>
|
|
120
124
|
<CenterLayout isOpen={isOpen} style={centerLayoutStyle}>
|
|
125
|
+
{window.location.pathname.includes("instructor") && (
|
|
126
|
+
<InstructorAccountSwitcher />
|
|
127
|
+
)}
|
|
121
128
|
<Outlet />
|
|
122
129
|
</CenterLayout>
|
|
123
130
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const LessonIcon = () => {
|
|
2
|
+
return(
|
|
3
|
+
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<path d="M13.2047 10.3862V3.3902C13.2047 2.69466 12.6367 2.1788 11.9469 2.23676H11.9121C10.6949 2.34109 8.84595 2.96128 7.81423 3.61046L7.7157 3.67421C7.54761 3.77855 7.26939 3.77855 7.1013 3.67421L6.9564 3.58727C5.92467 2.94389 4.08148 2.3295 2.86428 2.23096C2.17454 2.173 1.6123 2.69466 1.6123 3.3844V10.3862C1.6123 10.9426 2.06441 11.4643 2.62084 11.5339L2.78893 11.557C4.04671 11.7251 5.98843 12.3627 7.1013 12.9713L7.12448 12.9829C7.28098 13.0698 7.53022 13.0698 7.68092 12.9829C8.79379 12.3685 10.7413 11.7251 12.0049 11.557L12.1962 11.5339C12.7526 11.4643 13.2047 10.9426 13.2047 10.3862Z" stroke="white" stroke-width="1.00467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M7.4082 3.86523V12.5595" stroke="white" stroke-width="1.00467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
<path d="M4.94477 5.60352H3.64062" stroke="white" stroke-width="1.00467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
<path d="M5.37948 7.34375H3.64062" stroke="white" stroke-width="1.00467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8
|
+
</svg>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
export default LessonIcon
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const LessonFlag = () => {
|
|
2
|
+
return(
|
|
3
|
+
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<path d="M5.51758 5.92969C6.5493 6.30644 7.67376 6.30644 8.70548 5.92969" stroke="white" stroke-width="0.772826" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M9.90592 1.84375H4.31839C3.0838 1.84375 2.08105 2.85229 2.08105 4.08108V12.2479C2.08105 13.2912 2.82876 13.7317 3.74456 13.2275L6.5731 11.6567C6.87451 11.4886 7.36139 11.4886 7.65699 11.6567L10.4855 13.2275C11.4013 13.7375 12.149 13.297 12.149 12.2479V4.08108C12.1432 2.85229 11.1405 1.84375 9.90592 1.84375Z" stroke="white" stroke-width="1.15924" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
<path d="M9.90592 1.84375H4.31839C3.0838 1.84375 2.08105 2.85229 2.08105 4.08108V12.2479C2.08105 13.2912 2.82876 13.7317 3.74456 13.2275L6.5731 11.6567C6.87451 11.4886 7.36139 11.4886 7.65699 11.6567L10.4855 13.2275C11.4013 13.7375 12.149 13.297 12.149 12.2479V4.08108C12.1432 2.85229 11.1405 1.84375 9.90592 1.84375Z" stroke="white" stroke-width="0.772826" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
</svg>
|
|
8
|
+
)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default LessonFlag;
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const SliderIcon = () => {
|
|
2
|
+
return(
|
|
3
|
+
<svg width="53" height="5" viewBox="0 0 53 5" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<rect x="0.871094" y="0.384766" width="19.3206" height="3.86413" rx="1.93206" fill="#00C2C2"/>
|
|
5
|
+
<rect x="23.2832" y="0.384766" width="7.72826" height="3.86413" rx="1.93206" fill="#DFE6E6"/>
|
|
6
|
+
<rect x="34.1025" y="0.384766" width="7.72826" height="3.86413" rx="1.93206" fill="#DFE6E6"/>
|
|
7
|
+
<rect x="44.9219" y="0.384766" width="7.72826" height="3.86413" rx="1.93206" fill="#DFE6E6"/>
|
|
8
|
+
</svg>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default SliderIcon;
|
|
13
|
+
|
|
@@ -11,6 +11,7 @@ const UpgradeComponent = () => {
|
|
|
11
11
|
return (
|
|
12
12
|
|
|
13
13
|
<Upgrade>
|
|
14
|
+
<div className="container">
|
|
14
15
|
<img src={UpgradeIcon} alt="upgrad lock" />
|
|
15
16
|
<p>
|
|
16
17
|
Upgrade to <span>ENTERPRISE</span> for more features.
|
|
@@ -21,12 +22,15 @@ const UpgradeComponent = () => {
|
|
|
21
22
|
styles={{
|
|
22
23
|
marginTop: "12px",
|
|
23
24
|
fontSize: "16px",
|
|
24
|
-
width: "
|
|
25
|
+
width: "171px",
|
|
25
26
|
height: "38.641px",
|
|
26
27
|
gap: "8px",
|
|
27
28
|
padding: "15.457px 30.913px",
|
|
28
29
|
}}
|
|
29
30
|
/>
|
|
31
|
+
|
|
32
|
+
</div>
|
|
33
|
+
|
|
30
34
|
</Upgrade>
|
|
31
35
|
);
|
|
32
36
|
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
BannerWrapper,
|
|
4
|
+
InstructorContainer,
|
|
5
|
+
NewLanguage,
|
|
6
|
+
RecentAdded,
|
|
7
|
+
Container,
|
|
8
|
+
Upgrade,
|
|
9
|
+
Users,
|
|
10
|
+
UploadProgressContainer
|
|
11
|
+
} from "./styles";
|
|
12
|
+
import Button from "../button";
|
|
13
|
+
import CircularProgressBar from "./components/progressBar";
|
|
14
|
+
import UpgradeIcon from "./assets/Feature.png";
|
|
15
|
+
import { UploadProgress } from "./assets/uploadProgressIcon";
|
|
16
|
+
import ProgressBar from "../progressBar";
|
|
17
|
+
import UpgradeComponent from "./components/ugradeLock";
|
|
18
|
+
import LessonIcon from "./assets/lession";
|
|
19
|
+
import LessonFlag from "./assets/lessonflag";
|
|
20
|
+
import Ellipse from "./assets/Ellipse.png";
|
|
21
|
+
import Ellipse2 from "./assets/Ellipse2.png";
|
|
22
|
+
import Ellipse3 from "./assets/Ellipse3.png";
|
|
23
|
+
import Ellipse4 from "./assets/Ellipse4.png";
|
|
24
|
+
import SliderIcon from "./assets/slider";
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @param {{
|
|
29
|
+
* onClick: function,
|
|
30
|
+
* }} props - properties of graph Component
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
const InstructorRightBar = (props) => {
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<InstructorContainer>
|
|
38
|
+
<BannerWrapper>
|
|
39
|
+
<div className="head_instructor">
|
|
40
|
+
<h3>Learn a new language today</h3>
|
|
41
|
+
</div>
|
|
42
|
+
<NewLanguage>
|
|
43
|
+
<div className="top_section">
|
|
44
|
+
<div className="lession_cont">
|
|
45
|
+
<LessonIcon />
|
|
46
|
+
<p> 9 lessions</p>
|
|
47
|
+
</div>
|
|
48
|
+
<div className="flag_cont">
|
|
49
|
+
<LessonFlag />
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div className="buttom_section">
|
|
55
|
+
<p>French for Beginners</p>
|
|
56
|
+
</div>
|
|
57
|
+
</NewLanguage>
|
|
58
|
+
<SliderIcon />
|
|
59
|
+
<Button
|
|
60
|
+
type="primary"
|
|
61
|
+
text="Create Personal Account"
|
|
62
|
+
styles={{
|
|
63
|
+
marginTop: "29px",
|
|
64
|
+
fontSize: "16px",
|
|
65
|
+
width: "203px",
|
|
66
|
+
gap: "8px",
|
|
67
|
+
padding: "20px 6px",
|
|
68
|
+
height: "40px",
|
|
69
|
+
boxShadow: "0px 10px 20px 0px rgba(254, 191, 16, 0.25)",
|
|
70
|
+
}}
|
|
71
|
+
onClick={props.onClick}
|
|
72
|
+
/>
|
|
73
|
+
</BannerWrapper>
|
|
74
|
+
<RecentAdded>
|
|
75
|
+
<div className="top_area">
|
|
76
|
+
<h5>Recently added</h5>
|
|
77
|
+
<p>See all</p>
|
|
78
|
+
</div>
|
|
79
|
+
<div className="users_list">
|
|
80
|
+
<div className="user">
|
|
81
|
+
<img src={Ellipse} alt="user" />
|
|
82
|
+
</div>
|
|
83
|
+
<div className="user">
|
|
84
|
+
<img src={Ellipse2} alt="user" />
|
|
85
|
+
</div>
|
|
86
|
+
<div className="user">
|
|
87
|
+
<img src={Ellipse3} alt="user" />
|
|
88
|
+
</div>
|
|
89
|
+
<div className="user">
|
|
90
|
+
<img src={Ellipse4} alt="user" />
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
</RecentAdded>
|
|
95
|
+
<UpgradeComponent />
|
|
96
|
+
|
|
97
|
+
</InstructorContainer>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export default InstructorRightBar;
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import { FaArrowRight } from "react-icons/fa";
|
|
3
3
|
import BannerImg from "../assets/Vector19.png"
|
|
4
|
+
import InstructorBanner from "../assets/newLanguage.png";
|
|
5
|
+
import UpgradeIcon from "../assets/Feature.png";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export const InstructorContainer = styled.div`
|
|
9
|
+
background: #fff;
|
|
10
|
+
max-width: 232px;
|
|
11
|
+
display: flex;
|
|
12
|
+
/* align-items: center; */
|
|
13
|
+
text-align: center;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
padding: 10px 0px;
|
|
16
|
+
border-radius: 30px;
|
|
17
|
+
|
|
18
|
+
`;
|
|
4
19
|
|
|
5
20
|
export const Container = styled.div`
|
|
6
21
|
background-color: transparent;
|
|
@@ -39,6 +54,19 @@ export const BannerWrapper = styled.div`
|
|
|
39
54
|
margin-bottom: 20px;
|
|
40
55
|
width: 100%;
|
|
41
56
|
|
|
57
|
+
.head_instructor{
|
|
58
|
+
width: 100%;
|
|
59
|
+
h3{
|
|
60
|
+
color: var(--Neutral-90, #313333);
|
|
61
|
+
font-family: Nunito;
|
|
62
|
+
font-size: 13.911px;
|
|
63
|
+
font-style: normal;
|
|
64
|
+
font-weight: 700;
|
|
65
|
+
line-height: 15.457px; /* 111.111% */
|
|
66
|
+
letter-spacing: 0.278px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
42
70
|
.head{
|
|
43
71
|
display: flex;
|
|
44
72
|
align-items: center;
|
|
@@ -126,17 +154,27 @@ export const AbsoluteSVG = styled.svg`
|
|
|
126
154
|
|
|
127
155
|
|
|
128
156
|
export const Upgrade = styled.div`
|
|
129
|
-
|
|
157
|
+
padding: 10px;
|
|
158
|
+
margin-top: 20px;
|
|
159
|
+
|
|
160
|
+
.container{
|
|
161
|
+
/* background-color: #fff; */
|
|
162
|
+
border-radius: 23.185px;
|
|
163
|
+
background: var(--Neutral-10, #F5F7F7);
|
|
130
164
|
width: 100%;
|
|
131
165
|
max-width: 232px;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
overflow: hidden;
|
|
135
|
-
border-radius: 30px;
|
|
166
|
+
padding: 10px 0px;
|
|
167
|
+
/* border-radius: 30px; */
|
|
136
168
|
display: flex;
|
|
137
169
|
flex-direction: column;
|
|
138
170
|
justify-content: center;
|
|
139
171
|
align-items: center;
|
|
172
|
+
margin-top: 20px;
|
|
173
|
+
|
|
174
|
+
img{
|
|
175
|
+
object-fit: cover;
|
|
176
|
+
margin-top: -27%;
|
|
177
|
+
}
|
|
140
178
|
|
|
141
179
|
p{
|
|
142
180
|
color: var(--neutral-80, #4A4D4D);
|
|
@@ -149,7 +187,7 @@ export const Upgrade = styled.div`
|
|
|
149
187
|
letter-spacing: 0.773px;
|
|
150
188
|
width: 70%;
|
|
151
189
|
text-align: center;
|
|
152
|
-
margin-top:
|
|
190
|
+
margin-top: 0px;
|
|
153
191
|
|
|
154
192
|
span{
|
|
155
193
|
color: var(--primary-color-main, #FEBF10);
|
|
@@ -161,7 +199,7 @@ export const Upgrade = styled.div`
|
|
|
161
199
|
letter-spacing: 0.773px;
|
|
162
200
|
}
|
|
163
201
|
}
|
|
164
|
-
|
|
202
|
+
}
|
|
165
203
|
`;
|
|
166
204
|
|
|
167
205
|
export const Users = styled.div`
|
|
@@ -290,4 +328,140 @@ export const UploadProgressContainer = styled.div`
|
|
|
290
328
|
}
|
|
291
329
|
}
|
|
292
330
|
|
|
293
|
-
`
|
|
331
|
+
`
|
|
332
|
+
|
|
333
|
+
export const NewLanguage = styled.div`
|
|
334
|
+
background-image: url(${InstructorBanner});
|
|
335
|
+
background-size: cover;
|
|
336
|
+
background-repeat: no-repeat;
|
|
337
|
+
margin-top: 10px;
|
|
338
|
+
width: 100%;
|
|
339
|
+
height: 126.743px;
|
|
340
|
+
display: flex;
|
|
341
|
+
flex-direction: column;
|
|
342
|
+
justify-content: start;
|
|
343
|
+
gap: 60px;
|
|
344
|
+
padding: 10px;
|
|
345
|
+
margin-bottom: 10px;
|
|
346
|
+
|
|
347
|
+
.top_section{
|
|
348
|
+
display: flex;
|
|
349
|
+
justify-content: space-between;
|
|
350
|
+
align-items: center;
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
.lession_cont{
|
|
354
|
+
display: flex;
|
|
355
|
+
align-items: center;
|
|
356
|
+
border-radius: 6.183px;
|
|
357
|
+
background: rgba(12, 13, 13, 0.1);
|
|
358
|
+
padding: 3px;
|
|
359
|
+
|
|
360
|
+
p{
|
|
361
|
+
color: var(--white, #FFF);
|
|
362
|
+
font-family: Nunito;
|
|
363
|
+
font-size: 10.82px;
|
|
364
|
+
font-style: normal;
|
|
365
|
+
font-weight: 700;
|
|
366
|
+
line-height: 17.002px; /* 157.143% */
|
|
367
|
+
letter-spacing: 0.216px;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
svg{
|
|
371
|
+
margin-right: 4px;;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.flag_cont{
|
|
376
|
+
border-radius: 6.183px;
|
|
377
|
+
background: rgba(12, 13, 13, 0.1);
|
|
378
|
+
padding: 3px;
|
|
379
|
+
display: flex;
|
|
380
|
+
justify-content: center;
|
|
381
|
+
align-items: center;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.buttom_section{
|
|
386
|
+
display: flex;
|
|
387
|
+
justify-content: start;
|
|
388
|
+
|
|
389
|
+
p{
|
|
390
|
+
color: var(--white, #FFF);
|
|
391
|
+
font-family: Nunito;
|
|
392
|
+
font-size: 14.911px;
|
|
393
|
+
font-style: normal;
|
|
394
|
+
font-weight: 700;
|
|
395
|
+
line-height: 10.82px; /* 77.778% */
|
|
396
|
+
letter-spacing: 0.278px;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
`
|
|
400
|
+
|
|
401
|
+
export const RecentAdded = styled.div`
|
|
402
|
+
display: flex;
|
|
403
|
+
flex-direction: column;
|
|
404
|
+
padding: 10px 20px;
|
|
405
|
+
margin-top: -30px;
|
|
406
|
+
.top_area{
|
|
407
|
+
display: flex;
|
|
408
|
+
justify-content: space-between;
|
|
409
|
+
align-items: center;
|
|
410
|
+
margin-bottom: 10px;
|
|
411
|
+
|
|
412
|
+
h5{
|
|
413
|
+
color: var(--Neutral-90, #313333);
|
|
414
|
+
font-family: Nunito;
|
|
415
|
+
font-size: 13.911px;
|
|
416
|
+
font-style: normal;
|
|
417
|
+
font-weight: 700;
|
|
418
|
+
line-height: 15.457px; /* 111.111% */
|
|
419
|
+
letter-spacing: 0.278px;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
p{
|
|
423
|
+
color: var(--Primary-color-main, #FEBF10);
|
|
424
|
+
font-family: Nunito;
|
|
425
|
+
font-size: 12px;
|
|
426
|
+
font-style: normal;
|
|
427
|
+
font-weight: 700;
|
|
428
|
+
line-height: 15.457px; /* 128.804% */
|
|
429
|
+
letter-spacing: 0.24px;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
.users_list {
|
|
433
|
+
display: flex;
|
|
434
|
+
gap: 12px;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.user {
|
|
438
|
+
position: relative; /* Make the parent container relative */
|
|
439
|
+
width: 40px;
|
|
440
|
+
height: 40px;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.user::before {
|
|
444
|
+
content: "";
|
|
445
|
+
position: absolute;
|
|
446
|
+
width: 8px;
|
|
447
|
+
height: 8px;
|
|
448
|
+
background-color: #30D468;
|
|
449
|
+
border-radius: 50%;
|
|
450
|
+
bottom: 0;
|
|
451
|
+
right: 0;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.user:nth-child(2)::before {
|
|
455
|
+
background-color: #F39B33;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.user:nth-child(3)::before {
|
|
459
|
+
background-color: #30D468;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.user:nth-child(4)::before {
|
|
463
|
+
background-color: #C6CCCC;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
`;
|
package/src/components/index.js
CHANGED
|
@@ -31,3 +31,5 @@ export { OutletContext as OutletContext } from "./AppMainLayout";
|
|
|
31
31
|
export { default as DatePickerCalender } from "./datePicker";
|
|
32
32
|
export { default as TextEditor } from "./textEditor";
|
|
33
33
|
export { default as MessageAddon } from "./messageAddon/messages";
|
|
34
|
+
export { default as InstructorAccountSwitcher } from "./instructorAccountSwitcher";
|
|
35
|
+
export { default as InstructorRightBar } from "./fileRightBar/instructorRightBar"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import {
|
|
4
4
|
SideMenuContainer,
|
|
@@ -21,18 +21,35 @@ const SideMenu = ({
|
|
|
21
21
|
onLogout = () => {},
|
|
22
22
|
isOpen,
|
|
23
23
|
setIsOpen,
|
|
24
|
+
affiliatesActive,
|
|
24
25
|
}) => {
|
|
25
26
|
// const [isOpen, setIsOpen] = useState(false);
|
|
26
27
|
const onToggle = () => {
|
|
27
28
|
setIsOpen(!isOpen);
|
|
28
29
|
};
|
|
29
30
|
|
|
31
|
+
// Normal route filter
|
|
30
32
|
const filteredRoutes = routes.find(
|
|
31
33
|
(route) => route.userType === userType
|
|
32
34
|
)?.routes;
|
|
35
|
+
const [routeFilter, setRouteFilter] = useState(filteredRoutes);
|
|
36
|
+
|
|
37
|
+
// filter route to remove contract
|
|
38
|
+
const affiliatesFilteredRoute = filteredRoutes?.filter(
|
|
39
|
+
(route) => !route.affiliates
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
console.log("filteredRoutes", routeFilter, affiliatesActive);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (!affiliatesActive) {
|
|
45
|
+
setRouteFilter(affiliatesFilteredRoute);
|
|
46
|
+
} else {
|
|
47
|
+
setRouteFilter(filteredRoutes);
|
|
48
|
+
}
|
|
49
|
+
}, [affiliatesActive]);
|
|
33
50
|
|
|
34
51
|
const renderNavigationItem = (route, index) => {
|
|
35
|
-
const { icon, iconActive, text, notifications, path } = route;
|
|
52
|
+
const { icon, iconActive, text, notifications, path, affiliates } = route;
|
|
36
53
|
const handlePathCheck = () => {
|
|
37
54
|
let statusText;
|
|
38
55
|
console.log(window.location.pathname, "pathname");
|
|
@@ -245,7 +262,7 @@ const SideMenu = ({
|
|
|
245
262
|
<UserCard user={user} isOpen={isOpen} />
|
|
246
263
|
|
|
247
264
|
<NavigationContainer>
|
|
248
|
-
{
|
|
265
|
+
{routeFilter && routeFilter?.map(renderNavigationItem)}
|
|
249
266
|
</NavigationContainer>
|
|
250
267
|
|
|
251
268
|
<LogoutButtonContainer onClick={onLogout}>
|
|
@@ -51,8 +51,32 @@ const UserCard = ({ user, isOpen }) => {
|
|
|
51
51
|
<Avatar
|
|
52
52
|
src={organizationName?.profile_photo?.url || avatar}
|
|
53
53
|
isOpen={isOpen}
|
|
54
|
+
onClick={() => {
|
|
55
|
+
if (window.location.pathname.includes("personal")) {
|
|
56
|
+
window.location.href = `${window.location.protocol}//${window.location.hostname}/personal/profile`;
|
|
57
|
+
}
|
|
58
|
+
if (window.location.pathname.includes("enterprise")) {
|
|
59
|
+
window.location.href = `${window.location.protocol}//${window.location.hostname}/enterprise/profile`;
|
|
60
|
+
}
|
|
61
|
+
if (window.location.pathname.includes("instructor")) {
|
|
62
|
+
window.location.href = `${window.location.protocol}//${window.location.hostname}/instructor/profile`;
|
|
63
|
+
}
|
|
64
|
+
}}
|
|
54
65
|
/>
|
|
55
|
-
<UserDetail
|
|
66
|
+
<UserDetail
|
|
67
|
+
isOpen={isOpen}
|
|
68
|
+
onClick={() => {
|
|
69
|
+
if (window.location.pathname.includes("personal")) {
|
|
70
|
+
window.location.href = `${window.location.protocol}//${window.location.hostname}/personal/profile`;
|
|
71
|
+
}
|
|
72
|
+
if (window.location.pathname.includes("enterprise")) {
|
|
73
|
+
window.location.href = `${window.location.protocol}//${window.location.hostname}/enterprise/profile`;
|
|
74
|
+
}
|
|
75
|
+
if (window.location.pathname.includes("instructor")) {
|
|
76
|
+
window.location.href = `${window.location.protocol}//${window.location.hostname}/instructor/profile`;
|
|
77
|
+
}
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
56
80
|
<UserName>Hello</UserName>
|
|
57
81
|
<Handle
|
|
58
82
|
style={{
|
|
@@ -15,7 +15,7 @@ export const UserDetail = styled.div`
|
|
|
15
15
|
flex-direction: column;
|
|
16
16
|
gap: 5px;
|
|
17
17
|
align-items: center;
|
|
18
|
-
|
|
18
|
+
cursor: pointer;
|
|
19
19
|
`;
|
|
20
20
|
|
|
21
21
|
export const Avatar = styled.img`
|
|
@@ -23,6 +23,7 @@ export const Avatar = styled.img`
|
|
|
23
23
|
width: ${({ isOpen }) => (isOpen ? "47px" : "28px")};
|
|
24
24
|
height: ${({ isOpen }) => (isOpen ? "47px" : "28px")};
|
|
25
25
|
border-radius: 50%;
|
|
26
|
+
cursor: pointer;
|
|
26
27
|
`;
|
|
27
28
|
|
|
28
29
|
export const UserName = styled.div`
|