l-min-components 1.7.1533 → 1.7.1535
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
|
@@ -5,8 +5,8 @@ import React, {
|
|
|
5
5
|
useMemo,
|
|
6
6
|
useCallback,
|
|
7
7
|
forwardRef,
|
|
8
|
-
} from
|
|
9
|
-
import { Outlet, useLocation } from
|
|
8
|
+
} from "react";
|
|
9
|
+
import { Outlet, useLocation } from "react-router-dom";
|
|
10
10
|
import {
|
|
11
11
|
Layout,
|
|
12
12
|
CenterLayout,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
MainLayout,
|
|
16
16
|
ChildrenBox,
|
|
17
17
|
ChildrenWrap,
|
|
18
|
-
} from
|
|
18
|
+
} from "./index.styled";
|
|
19
19
|
import {
|
|
20
20
|
Header as HeaderComponent,
|
|
21
21
|
Banner,
|
|
@@ -23,16 +23,16 @@ import {
|
|
|
23
23
|
SideMenu,
|
|
24
24
|
FullPageLoader,
|
|
25
25
|
DeveloperBanner,
|
|
26
|
-
} from
|
|
26
|
+
} from "../";
|
|
27
27
|
import {
|
|
28
28
|
leftNavMenu,
|
|
29
29
|
user,
|
|
30
30
|
sideMenuOptions,
|
|
31
31
|
getLeftRoutes,
|
|
32
|
-
} from
|
|
33
|
-
import InstructorAccountSwitcher from
|
|
32
|
+
} from "../../hooks/leftNavMenu";
|
|
33
|
+
import InstructorAccountSwitcher from "../instructorAccountSwitcher";
|
|
34
34
|
// import SideMenu from "../sideBar/sideMenu";
|
|
35
|
-
import InstructorRightBar from
|
|
35
|
+
import InstructorRightBar from "../fileRightBar/instructorRightBar2";
|
|
36
36
|
import EnterpriseRightBar, {
|
|
37
37
|
FallbackRightBar,
|
|
38
38
|
} from "../fileRightBar/enterpriseRightBar";
|
|
@@ -56,18 +56,18 @@ const AppMainLayout = ({ children }) => {
|
|
|
56
56
|
const [rightComponent, setRightComponent] = useState();
|
|
57
57
|
const [generalData, setGeneralData] = useState({});
|
|
58
58
|
const [coming, setComing] = useState();
|
|
59
|
-
const [activePage, setActivePage] = useState(
|
|
60
|
-
const [page, setPage] = useState(
|
|
61
|
-
const [studyTab, setStudyTab] = useState(
|
|
59
|
+
const [activePage, setActivePage] = useState("reports");
|
|
60
|
+
const [page, setPage] = useState("index");
|
|
61
|
+
const [studyTab, setStudyTab] = useState("analysis");
|
|
62
62
|
const [selectedCourseId, setSelectedCourseId] = useState(null);
|
|
63
63
|
const [hasLayoutBackgroundImage, setHasLayoutBackgroundImage] =
|
|
64
64
|
useState(false);
|
|
65
65
|
const [sideMenuLayout, setSideMenuLayout] = useState(true);
|
|
66
|
-
const [defaultAcct, setDefaultAcct] = useState(
|
|
66
|
+
const [defaultAcct, setDefaultAcct] = useState("");
|
|
67
67
|
const [centerLayoutStyle, setCenterLayoutStyle] = useState({});
|
|
68
68
|
const [affiliatesActive, setAffiliatesActive] = useState(false);
|
|
69
|
-
const [accessToken, setAccessToken] = useState(
|
|
70
|
-
const [envType, setEnvType] = useState(
|
|
69
|
+
const [accessToken, setAccessToken] = useState("");
|
|
70
|
+
const [envType, setEnvType] = useState("");
|
|
71
71
|
const [newNotifications, setNewNotifications] = useState([]);
|
|
72
72
|
const [affiliateAccount, setAffiliateAccount] = useState(null);
|
|
73
73
|
const [gracePeriod, setGracePeriod] = useState(true); // test
|
|
@@ -77,7 +77,7 @@ const AppMainLayout = ({ children }) => {
|
|
|
77
77
|
const [newLoadingForPostDefaultAccount, setNewLoadingForPostDefaultAccount] =
|
|
78
78
|
useState(true);
|
|
79
79
|
const [selectedAccount, setSelectedAccount] = useState();
|
|
80
|
-
const [affilitateSearch, setAffilitateSearch] = useState(
|
|
80
|
+
const [affilitateSearch, setAffilitateSearch] = useState("");
|
|
81
81
|
const [showChildren, setShowChildren] = useState(false);
|
|
82
82
|
const [loading, setLoading] = useState(true);
|
|
83
83
|
|
|
@@ -92,15 +92,15 @@ const AppMainLayout = ({ children }) => {
|
|
|
92
92
|
// for mobile view
|
|
93
93
|
useEffect(() => {
|
|
94
94
|
const handleResize = () => setDeviceWidth(window.innerWidth);
|
|
95
|
-
window.addEventListener(
|
|
96
|
-
return () => window.removeEventListener(
|
|
95
|
+
window.addEventListener("resize", handleResize);
|
|
96
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
97
97
|
}, []);
|
|
98
98
|
|
|
99
99
|
// on page load check local storage for state of isOpen and set that to the state that controls the opening and closing of the navbar
|
|
100
100
|
useEffect(() => {
|
|
101
|
-
window.localStorage.getItem(
|
|
101
|
+
window.localStorage.getItem("isOpen") &&
|
|
102
102
|
setIsOpen(
|
|
103
|
-
window.localStorage.getItem(
|
|
103
|
+
window.localStorage.getItem("isOpen") === "true" ? true : false
|
|
104
104
|
);
|
|
105
105
|
}, []);
|
|
106
106
|
|
|
@@ -108,21 +108,21 @@ const AppMainLayout = ({ children }) => {
|
|
|
108
108
|
// active account type
|
|
109
109
|
const activeAccountType = useMemo(
|
|
110
110
|
() => String(generalData?.selectedAccount?.type).toLowerCase(),
|
|
111
|
-
[generalData]
|
|
111
|
+
[generalData]
|
|
112
112
|
);
|
|
113
113
|
const accountName = useMemo(() => {
|
|
114
114
|
const { user: User, selectedAccount } = generalData;
|
|
115
|
-
if (!User || !selectedAccount) return
|
|
115
|
+
if (!User || !selectedAccount) return "..."; // or an empty string
|
|
116
116
|
const defaultAccountName = String(User.first_name).concat(
|
|
117
|
-
|
|
118
|
-
User.last_name
|
|
117
|
+
" ",
|
|
118
|
+
User.last_name
|
|
119
119
|
);
|
|
120
120
|
switch (activeAccountType) {
|
|
121
|
-
case
|
|
121
|
+
case "enterprise":
|
|
122
122
|
return (
|
|
123
123
|
selectedAccount?.metadata?.organization_name ?? defaultAccountName
|
|
124
124
|
);
|
|
125
|
-
case
|
|
125
|
+
case "developer":
|
|
126
126
|
return (
|
|
127
127
|
selectedAccount?.metadata?.organization_name ??
|
|
128
128
|
selectedAccount?.metadata?.org_name ??
|
|
@@ -139,19 +139,19 @@ const AppMainLayout = ({ children }) => {
|
|
|
139
139
|
|
|
140
140
|
const findAccountNames = useCallback(
|
|
141
141
|
(account, User = generalData?.user) => {
|
|
142
|
-
if (!User || !account) return
|
|
142
|
+
if (!User || !account) return "";
|
|
143
143
|
switch (String(account.type).toLowerCase()) {
|
|
144
|
-
case
|
|
144
|
+
case "enterprise":
|
|
145
145
|
return account?.metadata?.organization_name;
|
|
146
|
-
case
|
|
146
|
+
case "developer":
|
|
147
147
|
return (
|
|
148
148
|
account?.metadata?.organization_name ?? account?.metadata?.org_name
|
|
149
149
|
);
|
|
150
150
|
default:
|
|
151
|
-
return User.first_name.concat(
|
|
151
|
+
return User.first_name.concat(" ", User.last_name);
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
|
-
[generalData]
|
|
154
|
+
[generalData]
|
|
155
155
|
);
|
|
156
156
|
const {
|
|
157
157
|
setDefaultAccount,
|
|
@@ -183,22 +183,24 @@ const AppMainLayout = ({ children }) => {
|
|
|
183
183
|
? ".learngual.ca"
|
|
184
184
|
: ".learngual.com";
|
|
185
185
|
document.cookie =
|
|
186
|
-
|
|
186
|
+
"defaultAccountID=" +
|
|
187
187
|
getDefaultAccount?.data?.id +
|
|
188
188
|
`; domain=${domain}; path=/; expires=${date.toUTCString()};`;
|
|
189
189
|
document.cookie =
|
|
190
|
-
|
|
190
|
+
"defaultAccountType=" +
|
|
191
191
|
getDefaultAccount?.data?.type +
|
|
192
192
|
`; domain=${domain}; path=/; expires=${date.toUTCString()};`;
|
|
193
193
|
localStorage.setItem("defaultLang", getDefaultAccount?.data?.language);
|
|
194
194
|
const { registration_step } = getDefaultAccount?.data;
|
|
195
195
|
// If registration step is "REGISTRATION_COMPLETED" - go to acct type selection page
|
|
196
|
-
if (registration_step ===
|
|
197
|
-
window.location.href =
|
|
196
|
+
if (registration_step === "REGISTRATION_COMPLETED") {
|
|
197
|
+
window.location.href = "/auth/account-type";
|
|
198
198
|
}
|
|
199
199
|
// If registration step is "REGISTRATION_PARTIALLY_COMPLETED" go to /register where the user can provide the missing fields.
|
|
200
|
-
else if (registration_step ===
|
|
201
|
-
|
|
200
|
+
else if (registration_step === "REGISTRATION_PARTIALLY_COMPLETED") {
|
|
201
|
+
// Update the registration step cookie
|
|
202
|
+
document.cookie = `registrationStep=${registration_step}; expires=${date.toUTCString()}; path=/; domain=${domain}`;
|
|
203
|
+
window.location.href = "/auth/sign-in";
|
|
202
204
|
}
|
|
203
205
|
|
|
204
206
|
// set default acct when you receive the default acct data
|
|
@@ -213,17 +215,17 @@ const AppMainLayout = ({ children }) => {
|
|
|
213
215
|
const defaultAccountType = getDefaultAccount?.data?.type?.toLowerCase();
|
|
214
216
|
const excludedPaths = ["settings", "notifications", "help"];
|
|
215
217
|
const shouldSkipNavigation = excludedPaths.some((path) =>
|
|
216
|
-
currentUrl.includes(path)
|
|
218
|
+
currentUrl.includes(path)
|
|
217
219
|
);
|
|
218
220
|
console.log(
|
|
219
|
-
|
|
221
|
+
"Navigation logic triggered - getDefaultAccount data received:",
|
|
220
222
|
{
|
|
221
223
|
currentUrl,
|
|
222
224
|
defaultAccountType,
|
|
223
225
|
shouldSkipNavigation,
|
|
224
226
|
hostname: window.location.hostname,
|
|
225
227
|
data: getDefaultAccount?.data,
|
|
226
|
-
}
|
|
228
|
+
}
|
|
227
229
|
);
|
|
228
230
|
if (!shouldSkipNavigation && defaultAccountType) {
|
|
229
231
|
const urlContainsAccountType = currentUrl.includes(defaultAccountType);
|
|
@@ -237,7 +239,7 @@ const AppMainLayout = ({ children }) => {
|
|
|
237
239
|
const targetUrl = `/${defaultAccountType}`;
|
|
238
240
|
|
|
239
241
|
// Try using window.location.replace for staging compatibility
|
|
240
|
-
if (window.location.hostname.includes(
|
|
242
|
+
if (window.location.hostname.includes("staging")) {
|
|
241
243
|
window.location.replace(targetUrl);
|
|
242
244
|
} else {
|
|
243
245
|
window.location.href = targetUrl;
|
|
@@ -254,10 +256,10 @@ const AppMainLayout = ({ children }) => {
|
|
|
254
256
|
handleGetUserPlan();
|
|
255
257
|
if (
|
|
256
258
|
setDefaultAccount?.response?.status === 207 &&
|
|
257
|
-
!window.location.host.includes(
|
|
258
|
-
!window.location.host.includes(
|
|
259
|
+
!window.location.host.includes("staging") &&
|
|
260
|
+
!window.location.host.includes("local")
|
|
259
261
|
) {
|
|
260
|
-
window.location.href =
|
|
262
|
+
window.location.href = "/auth/account-type";
|
|
261
263
|
} else {
|
|
262
264
|
setTimeout(() => {
|
|
263
265
|
setNewLoadingForPostDefaultAccount(false);
|
|
@@ -266,7 +268,7 @@ const AppMainLayout = ({ children }) => {
|
|
|
266
268
|
}
|
|
267
269
|
}, [setDefaultAccount?.data]);
|
|
268
270
|
useEffect(() => {
|
|
269
|
-
if (window.location.host.includes(
|
|
271
|
+
if (window.location.host.includes("coming")) {
|
|
270
272
|
setComing(true);
|
|
271
273
|
} else {
|
|
272
274
|
setComing(false);
|
|
@@ -274,12 +276,12 @@ const AppMainLayout = ({ children }) => {
|
|
|
274
276
|
}, []);
|
|
275
277
|
useEffect(() => {
|
|
276
278
|
let cookieValue = null;
|
|
277
|
-
const cookieName =
|
|
279
|
+
const cookieName = "defaultAccountType";
|
|
278
280
|
// Retrieve the value of the cookie
|
|
279
|
-
const cookies = document.cookie.split(
|
|
281
|
+
const cookies = document.cookie.split(";");
|
|
280
282
|
for (let i = 0; i < cookies.length; i++) {
|
|
281
283
|
const cookie = cookies[i].trim();
|
|
282
|
-
if (cookie.startsWith(cookieName +
|
|
284
|
+
if (cookie.startsWith(cookieName + "=")) {
|
|
283
285
|
cookieValue = cookie.substring(cookieName.length + 1);
|
|
284
286
|
setDefaultAcct(cookieValue);
|
|
285
287
|
break;
|
|
@@ -290,39 +292,39 @@ const AppMainLayout = ({ children }) => {
|
|
|
290
292
|
// set access token from cookie to context
|
|
291
293
|
useEffect(() => {
|
|
292
294
|
let cookieValue = null;
|
|
293
|
-
const cookieName =
|
|
295
|
+
const cookieName = "access";
|
|
294
296
|
|
|
295
297
|
// Retrieve the value of the cookie
|
|
296
|
-
const cookies = document.cookie.split(
|
|
298
|
+
const cookies = document.cookie.split(";");
|
|
297
299
|
for (let i = 0; i < cookies.length; i++) {
|
|
298
300
|
const cookie = cookies[i].trim();
|
|
299
|
-
if (cookie.startsWith(cookieName +
|
|
301
|
+
if (cookie.startsWith(cookieName + "=")) {
|
|
300
302
|
cookieValue = cookie.substring(cookieName.length + 1);
|
|
301
303
|
setAccessToken(cookieValue);
|
|
302
304
|
break;
|
|
303
305
|
}
|
|
304
306
|
}
|
|
305
|
-
console.log(
|
|
307
|
+
console.log("Calling handleGetDefaultAccount on staging/local");
|
|
306
308
|
handleGetDefaultAccount();
|
|
307
309
|
}, [defaultAcct]);
|
|
308
310
|
|
|
309
311
|
// setting current environment type
|
|
310
312
|
useEffect(() => {
|
|
311
|
-
if (window.location.hostname.includes(
|
|
312
|
-
setEnvType(
|
|
313
|
-
} else if (window.location.hostname.includes(
|
|
314
|
-
setEnvType(
|
|
313
|
+
if (window.location.hostname.includes("staging")) {
|
|
314
|
+
setEnvType("staging");
|
|
315
|
+
} else if (window.location.hostname.includes("localhost")) {
|
|
316
|
+
setEnvType("localhost");
|
|
315
317
|
} else {
|
|
316
|
-
setEnvType(
|
|
318
|
+
setEnvType("live");
|
|
317
319
|
}
|
|
318
320
|
setLoading(true);
|
|
319
321
|
}, []);
|
|
320
322
|
useEffect(() => {
|
|
321
|
-
const locaLang = localStorage.getItem(
|
|
323
|
+
const locaLang = localStorage.getItem("defaultLang");
|
|
322
324
|
const checkiIsObj =
|
|
323
325
|
locaLang && locaLang.toLocaleLowerCase().includes("slug");
|
|
324
326
|
if (checkiIsObj) {
|
|
325
|
-
localStorage.removeItem(
|
|
327
|
+
localStorage.removeItem("defaultLang");
|
|
326
328
|
window.location.reload();
|
|
327
329
|
}
|
|
328
330
|
}, []);
|
|
@@ -330,41 +332,41 @@ const AppMainLayout = ({ children }) => {
|
|
|
330
332
|
// const currentPlan = userPlanData?.data?.current_plan;
|
|
331
333
|
const planState = userPlanData?.data?.state;
|
|
332
334
|
const wordBank = [
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
335
|
+
"Sign out",
|
|
336
|
+
"Learning",
|
|
337
|
+
"Community",
|
|
338
|
+
"Fun",
|
|
339
|
+
"Duet",
|
|
340
|
+
"Speech",
|
|
341
|
+
"Settings",
|
|
342
|
+
"Notifications",
|
|
343
|
+
"Hello",
|
|
344
|
+
"API",
|
|
345
|
+
"Documentation",
|
|
346
|
+
"Reports",
|
|
347
|
+
"Created",
|
|
348
|
+
"Report",
|
|
349
|
+
"Dictionary",
|
|
348
350
|
"What's your language?",
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
351
|
+
"Add account",
|
|
352
|
+
"Developer accounts",
|
|
353
|
+
"Developer",
|
|
354
|
+
"Search",
|
|
355
|
+
"Get started",
|
|
356
|
+
"Sign in",
|
|
357
|
+
"Sorry, you can’t access your account on a mobile browser.",
|
|
356
358
|
"We know it's inconvenient. For better user accessibility, login with a desktop device or via our mobile app.",
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
"Download on google play",
|
|
360
|
+
"Download on apple store",
|
|
361
|
+
"Help",
|
|
362
|
+
"10% off your next subscription purchase?",
|
|
361
363
|
"Let's go!",
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
364
|
+
"Get a discount when you upgrade to a custom plan and unlock a new world of building.",
|
|
365
|
+
"Contact us",
|
|
366
|
+
"Get more API calls for less with our custom plan",
|
|
367
|
+
"Upgrade now for a 10% discount.",
|
|
368
|
+
"Build the future with Learngual!",
|
|
369
|
+
"Choose our custom plans for more calls and better flexibility.",
|
|
368
370
|
"We know it's inconvenient. For better user accessibility, login with a desktop device.",
|
|
369
371
|
// Additional text from codebase analysis - ONLY actual strings found
|
|
370
372
|
"Student",
|
|
@@ -404,8 +406,8 @@ const AppMainLayout = ({ children }) => {
|
|
|
404
406
|
"Ready",
|
|
405
407
|
"play",
|
|
406
408
|
// expired instructor
|
|
407
|
-
|
|
408
|
-
|
|
409
|
+
"You haven’t been added to an enterprise account yet",
|
|
410
|
+
"This account will be active once an enterprise assigns you as an instructor.",
|
|
409
411
|
];
|
|
410
412
|
const {
|
|
411
413
|
setDefaultLang,
|
|
@@ -419,7 +421,7 @@ const AppMainLayout = ({ children }) => {
|
|
|
419
421
|
|
|
420
422
|
const handleGetStorageSummary = async () => {
|
|
421
423
|
const accountType = generalData?.selectedAccount?.type?.toLowerCase();
|
|
422
|
-
if (accountType ===
|
|
424
|
+
if (accountType === "enterprise" || accountType === "instructor") {
|
|
423
425
|
const res = await handleGetFileStorageSummary(accountType);
|
|
424
426
|
res?.data &&
|
|
425
427
|
setStorageSummary({
|
|
@@ -438,11 +440,11 @@ const AppMainLayout = ({ children }) => {
|
|
|
438
440
|
handleGetDefaultAffiliate,
|
|
439
441
|
} = useHeader();
|
|
440
442
|
useEffect(() => {
|
|
441
|
-
if (activeAccountType ===
|
|
443
|
+
if (activeAccountType === "instructor") {
|
|
442
444
|
handleGetDefaultAffiliate();
|
|
443
445
|
} else if (
|
|
444
446
|
activeAccountType.length > 0 &&
|
|
445
|
-
activeAccountType?.toLowerCase() !==
|
|
447
|
+
activeAccountType?.toLowerCase() !== "instructor"
|
|
446
448
|
) {
|
|
447
449
|
setLoading(false);
|
|
448
450
|
}
|
|
@@ -468,7 +470,7 @@ const AppMainLayout = ({ children }) => {
|
|
|
468
470
|
const affiliateList = getAllAffiliateData?.data?.results?.map?.((account) => {
|
|
469
471
|
const image = account?.profile_photo?.url;
|
|
470
472
|
return {
|
|
471
|
-
name: account?.metadata?.organization_name ??
|
|
473
|
+
name: account?.metadata?.organization_name ?? "...",
|
|
472
474
|
image,
|
|
473
475
|
id: account?.id,
|
|
474
476
|
};
|
|
@@ -480,7 +482,7 @@ const AppMainLayout = ({ children }) => {
|
|
|
480
482
|
id: hasAxtiveAffiliateId,
|
|
481
483
|
});
|
|
482
484
|
} else {
|
|
483
|
-
deleteCookies(
|
|
485
|
+
deleteCookies("affiliateAccount");
|
|
484
486
|
setAffiliateAccount(null);
|
|
485
487
|
}
|
|
486
488
|
}, [hasAxtiveAffiliateId, activeAccountType]);
|
|
@@ -578,7 +580,7 @@ const AppMainLayout = ({ children }) => {
|
|
|
578
580
|
style={centerLayoutStyle}
|
|
579
581
|
href={window.location.href}
|
|
580
582
|
>
|
|
581
|
-
{activeAccountType ===
|
|
583
|
+
{activeAccountType === "instructor" &&
|
|
582
584
|
!accountIsPendingDeletion &&
|
|
583
585
|
affiliateList?.length > 0 &&
|
|
584
586
|
defaultAffiliateIsSuccess && (
|
|
@@ -604,7 +606,7 @@ const AppMainLayout = ({ children }) => {
|
|
|
604
606
|
{!generalData?.selectedAccount ? (
|
|
605
607
|
<BlankState />
|
|
606
608
|
) : accountIsPendingDeletion &&
|
|
607
|
-
!window.location.pathname.includes(
|
|
609
|
+
!window.location.pathname.includes("settings") ? (
|
|
608
610
|
<PendingDeleteState
|
|
609
611
|
deleteDate={
|
|
610
612
|
generalData?.selectedAccount?.pending_delete_datetime
|
|
@@ -612,12 +614,12 @@ const AppMainLayout = ({ children }) => {
|
|
|
612
614
|
/>
|
|
613
615
|
) : (
|
|
614
616
|
<>
|
|
615
|
-
{activeAccountType ===
|
|
616
|
-
(planState ===
|
|
617
|
-
planState ===
|
|
617
|
+
{activeAccountType === "enterprise" &&
|
|
618
|
+
(planState === "GRACE PERIOD" ||
|
|
619
|
+
planState === "EXPIRED" ||
|
|
618
620
|
(!userPlanData?.loading && !planState)) &&
|
|
619
|
-
!window.location.pathname.includes(
|
|
620
|
-
!window.location.pathname.includes(
|
|
621
|
+
!window.location.pathname.includes("file-m") &&
|
|
622
|
+
!window.location.pathname.includes("settings") ? (
|
|
621
623
|
<GracePeriod
|
|
622
624
|
getCurrentSubscriptionData={
|
|
623
625
|
getCurrentSubscriptionData
|
|
@@ -626,11 +628,11 @@ const AppMainLayout = ({ children }) => {
|
|
|
626
628
|
handleCurrentSubscription
|
|
627
629
|
}
|
|
628
630
|
gracePeriod={gracePeriod}
|
|
629
|
-
stateType={planState ===
|
|
631
|
+
stateType={planState === "GRACE PERIOD" ? 1 : 2}
|
|
630
632
|
planState={planState}
|
|
631
633
|
findText={findText}
|
|
632
634
|
/>
|
|
633
|
-
) : activeAccountType ===
|
|
635
|
+
) : activeAccountType === "instructor" &&
|
|
634
636
|
!userPlanData?.loading &&
|
|
635
637
|
!planState &&
|
|
636
638
|
!loading &&
|
|
@@ -639,20 +641,20 @@ const AppMainLayout = ({ children }) => {
|
|
|
639
641
|
getDefaultAffiliateData?.data &&
|
|
640
642
|
!getDefaultAffiliateData?.loading &&
|
|
641
643
|
!getAllAffiliateData?.loading &&
|
|
642
|
-
!window.location.pathname.includes(
|
|
644
|
+
!window.location.pathname.includes("notif") ? (
|
|
643
645
|
<div className="instructor_expired">
|
|
644
|
-
<h1>{findText(
|
|
646
|
+
<h1>{findText("Dashboard")}</h1>
|
|
645
647
|
<div className="instructor_expired_body">
|
|
646
648
|
<div className="instructor_expired_center">
|
|
647
649
|
<img src={instructorImage} alt="" />
|
|
648
650
|
<h4>
|
|
649
651
|
{findText(
|
|
650
|
-
|
|
652
|
+
"You haven’t been added to an enterprise account yet"
|
|
651
653
|
)}
|
|
652
654
|
</h4>
|
|
653
655
|
<p>
|
|
654
656
|
{findText(
|
|
655
|
-
|
|
657
|
+
"This account will be active once an enterprise assigns you as an instructor."
|
|
656
658
|
)}
|
|
657
659
|
</p>
|
|
658
660
|
</div>
|
|
@@ -678,13 +680,13 @@ const AppMainLayout = ({ children }) => {
|
|
|
678
680
|
{rightLayout && !coming && (
|
|
679
681
|
<RightLayout>
|
|
680
682
|
{rightComponent ??
|
|
681
|
-
(activeAccountType ===
|
|
683
|
+
(activeAccountType === "enterprise" ? (
|
|
682
684
|
<EnterpriseRightBar
|
|
683
685
|
planState={planState}
|
|
684
686
|
affiliateAccount={affiliateAccount}
|
|
685
687
|
isPendingDelete={accountIsPendingDeletion}
|
|
686
688
|
/>
|
|
687
|
-
) : activeAccountType ===
|
|
689
|
+
) : activeAccountType === "instructor" ? (
|
|
688
690
|
// <>
|
|
689
691
|
// {affiliateAccount?.id ? (
|
|
690
692
|
// <AffiliateRightBar
|
|
@@ -703,12 +705,12 @@ const AppMainLayout = ({ children }) => {
|
|
|
703
705
|
isPendingDelete={accountIsPendingDeletion}
|
|
704
706
|
/>
|
|
705
707
|
)
|
|
706
|
-
) : activeAccountType ===
|
|
708
|
+
) : activeAccountType === "personal" ? (
|
|
707
709
|
<PersonalRightBar
|
|
708
710
|
findText={findText}
|
|
709
711
|
onShowTest={setShowTest}
|
|
710
712
|
/>
|
|
711
|
-
) : activeAccountType ===
|
|
713
|
+
) : activeAccountType === "developer" ? (
|
|
712
714
|
<DeveloperBanner findText={findText} />
|
|
713
715
|
) : (
|
|
714
716
|
<FallbackRightBar />
|
|
@@ -6,10 +6,11 @@ if (!window.translationCache) {
|
|
|
6
6
|
window.translationCache = {};
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
const environment = window.location.hostname.includes("staging")
|
|
10
|
+
? "learngual-bucket"
|
|
11
|
+
: "learngual-production";
|
|
9
12
|
const CACHE_DURATION = 60 * 60 * 1000; // 1 hour in milliseconds
|
|
10
|
-
const S3_BASE_URL = `https
|
|
11
|
-
window.location.hostname.includes("staging") ? "" : "learngual-production/"
|
|
12
|
-
}media/media/`;
|
|
13
|
+
const S3_BASE_URL = `https://${environment}.sfo3.digitaloceanspaces.com/${environment}/media/media/`;
|
|
13
14
|
|
|
14
15
|
const useTranslation = (initialSentences = []) => {
|
|
15
16
|
const value = localStorage?.getItem("defaultLang");
|