l-min-components 1.0.701 → 1.0.705
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
|
@@ -26,6 +26,7 @@ import InstructorRightBar from "../fileRightBar/instructorRightBar";
|
|
|
26
26
|
import EnterpriseRightBar from "../fileRightBar/enterpriseRightBar";
|
|
27
27
|
import PersonalRightBar from "../fileRightBar/personalRightBar";
|
|
28
28
|
import useHeader from "../header/getHeaderDetails";
|
|
29
|
+
import GracePeriod from "../deactivated";
|
|
29
30
|
|
|
30
31
|
const AppMainLayout = () => {
|
|
31
32
|
const [isOpen, setIsOpen] = useState(true);
|
|
@@ -48,11 +49,15 @@ const AppMainLayout = () => {
|
|
|
48
49
|
const [accessToken, setAccessToken] = useState("");
|
|
49
50
|
const [envType, setEnvType] = useState("");
|
|
50
51
|
const [newNotifications, setNewNotifications] = useState([]);
|
|
52
|
+
const [deactivated, setDeactivated] = useState(true) // testing, until we get account setup
|
|
53
|
+
|
|
51
54
|
const {
|
|
52
55
|
setDefaultAccount,
|
|
53
56
|
handleSetDefaultAccount,
|
|
54
57
|
notificationMarkReadData,
|
|
55
58
|
handleGetNotificationMarkRead,
|
|
59
|
+
userPlanData,
|
|
60
|
+
handleGetUserPlan,
|
|
56
61
|
} = useHeader();
|
|
57
62
|
|
|
58
63
|
useEffect(() => {
|
|
@@ -128,6 +133,13 @@ const AppMainLayout = () => {
|
|
|
128
133
|
}, []);
|
|
129
134
|
console.log("envType", envType);
|
|
130
135
|
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
handleGetUserPlan()
|
|
138
|
+
}, [])
|
|
139
|
+
|
|
140
|
+
const currentPlan = userPlanData?.data?.current_plan;
|
|
141
|
+
const planState = userPlanData?.data?.state
|
|
142
|
+
|
|
131
143
|
return (
|
|
132
144
|
<OutletContext.Provider
|
|
133
145
|
value={{
|
|
@@ -206,7 +218,7 @@ const AppMainLayout = () => {
|
|
|
206
218
|
/>
|
|
207
219
|
)}
|
|
208
220
|
|
|
209
|
-
<Outlet />
|
|
221
|
+
{window.location.pathname.includes("enterprise") && deactivated ? <GracePeriod /> : <Outlet />}
|
|
210
222
|
</CenterLayout>
|
|
211
223
|
|
|
212
224
|
{rightLayout && !coming && (
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useLocation } from "react-router-dom";
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
|
|
5
|
+
const routes = [
|
|
6
|
+
{ path: "dashboard", title: "Dashboard" },
|
|
7
|
+
{ path: "reports", title: "Reports" },
|
|
8
|
+
{ path: "courses", title: "Courses" },
|
|
9
|
+
{ path: "manage-teams", title: "Manage Teams" },
|
|
10
|
+
{ path: "msg/messages", title: "Messages" },
|
|
11
|
+
{ path: "announcements", title: "Announcements" },
|
|
12
|
+
{ path: "file-manager", title: "File Manager" },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const GracePeriod = () => {
|
|
16
|
+
const location = useLocation();
|
|
17
|
+
|
|
18
|
+
const getTitleFromPath = (path) => {
|
|
19
|
+
const route = routes.find(route => path.includes(route.path));
|
|
20
|
+
return route?.title || "Dashboard";
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const pageTitle = getTitleFromPath(location.pathname);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<GracePeriodWrapper>
|
|
27
|
+
<h1>{pageTitle}</h1>
|
|
28
|
+
<div className="gracePeriod_account">
|
|
29
|
+
<div className="content">
|
|
30
|
+
<p>Sorry, you can’t access your account</p>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</GracePeriodWrapper>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const GracePeriodWrapper = styled.div`
|
|
38
|
+
h1 {
|
|
39
|
+
margin-top: 0px;
|
|
40
|
+
margin-bottom: 20px;
|
|
41
|
+
color: #313333;
|
|
42
|
+
font-size: 24px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.gracePeriod_account {
|
|
46
|
+
border-radius: 30.67px;
|
|
47
|
+
background: var(--white, #fff);
|
|
48
|
+
display: flex;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
align-items: center;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 670px;
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
|
|
55
|
+
.content {
|
|
56
|
+
border-radius: 15px;
|
|
57
|
+
background: var(--Neutral-10, #f5f7f7);
|
|
58
|
+
display: flex;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
align-items: center;
|
|
61
|
+
display: inline-flex;
|
|
62
|
+
padding: 30px 18px;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: 30px;
|
|
66
|
+
|
|
67
|
+
p {
|
|
68
|
+
color: var(--Neutral-90, #313333);
|
|
69
|
+
text-align: center;
|
|
70
|
+
font-feature-settings: "salt" on, "liga" off;
|
|
71
|
+
font-family: Nunito;
|
|
72
|
+
font-size: 25px;
|
|
73
|
+
font-style: normal;
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
line-height: 120%; /* 30px */
|
|
76
|
+
width: 306px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
|
|
82
|
+
export default GracePeriod;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import useAxios from "axios-hooks";
|
|
2
|
+
|
|
3
|
+
const useAccount = () => {
|
|
4
|
+
|
|
5
|
+
// current plan
|
|
6
|
+
const [{ ...userPlanData }, getUserPlan] = useAxios(
|
|
7
|
+
{
|
|
8
|
+
url: `/payment/v1/current_plan/`,
|
|
9
|
+
method: "GET",
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
{
|
|
13
|
+
manual: true,
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const handleGetUserPlan = async () => {
|
|
18
|
+
try {
|
|
19
|
+
await getUserPlan();
|
|
20
|
+
} catch (err) {
|
|
21
|
+
console.log(err);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
|
|
33
|
+
userPlanData,
|
|
34
|
+
handleGetUserPlan,
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export default useAccount;
|
|
@@ -154,6 +154,26 @@ const handleGetNotificationMarkRead = async () => {
|
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
+
// current plan
|
|
158
|
+
const [{ ...userPlanData }, getUserPlan] = useAxios(
|
|
159
|
+
{
|
|
160
|
+
url: `/payment/v1/current_plan/`,
|
|
161
|
+
method: "GET",
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
{
|
|
165
|
+
manual: true,
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
const handleGetUserPlan = async () => {
|
|
170
|
+
try {
|
|
171
|
+
await getUserPlan();
|
|
172
|
+
} catch (err) {
|
|
173
|
+
console.log(err);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
157
177
|
return {
|
|
158
178
|
handleGetUserDetails,
|
|
159
179
|
userDetails,
|
|
@@ -170,7 +190,10 @@ const handleGetNotificationMarkRead = async () => {
|
|
|
170
190
|
notificationMarkReadData,
|
|
171
191
|
handleGetNotificationMarkRead,
|
|
172
192
|
notificationData,
|
|
173
|
-
handleGetNotification
|
|
193
|
+
handleGetNotification,
|
|
194
|
+
|
|
195
|
+
userPlanData,
|
|
196
|
+
handleGetUserPlan,
|
|
174
197
|
};
|
|
175
198
|
};
|
|
176
199
|
export default useHeader;
|