l-min-components 1.0.1066 → 1.0.1072

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.1066",
3
+ "version": "1.0.1072",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -1,20 +1,26 @@
1
1
  import React, { useEffect, useState } from "react";
2
2
  import { Editor } from "react-draft-wysiwyg";
3
- import { EditorState, convertToRaw, ContentState } from "draft-js";
3
+ import {
4
+ EditorState,
5
+ convertToRaw,
6
+ ContentState,
7
+ convertFromHTML,
8
+ } from "draft-js";
4
9
  import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
5
10
  import toalbarOptions from "./toalbarOptions";
6
11
  import { Container } from "./styled";
7
12
  import draftToHtml from "draftjs-to-html";
8
- import htmlToDraft from "html-to-draftjs";
13
+ // import htmlToDraft from "html-to-draftjs";
9
14
 
10
15
  function TextEditor({ onChange, defaultValue }) {
11
16
  let defaultState;
12
17
 
13
18
  if (defaultValue) {
14
- const contentBlock = htmlToDraft(defaultValue);
19
+ const contentBlock = convertFromHTML(defaultValue);
15
20
  if (contentBlock) {
16
- const contentState = ContentState.createFromBlockArray(
17
- contentBlock.contentBlocks
21
+ const contentState = ContentState?.createFromBlockArray(
22
+ contentBlock?.contentBlocks,
23
+ contentBlock?.entityMap
18
24
  );
19
25
  defaultState = EditorState?.createWithContent(contentState);
20
26
  }
@@ -33,27 +33,26 @@ const GracePeriod = ({
33
33
  return (
34
34
  <GracePeriodWrapper>
35
35
  <h1>{pageTitle}</h1>
36
- {!gracePeriod &&
37
- <Expire>
38
- <h4>Hey Enterprise, You do not have any active plan</h4>
36
+ {!gracePeriod && (
37
+ <Expire>
38
+ <h4>Hey Enterprise, You do not have any active plan</h4>
39
39
 
40
- <div
41
- onClick={() => {
42
- window.location.href =
43
- "https://559staging.learngual.com/settings/payment";
44
- }}
45
- >
46
- <Button
47
- text="Choose a Plan"
48
- styles={{
49
- height: "35px",
50
- padding: "4px 20px",
51
- fontSize: "14px",
40
+ <div
41
+ onClick={() => {
42
+ window.location.href = "/settings/payment";
52
43
  }}
53
- />
54
- </div>
55
- </Expire>
56
- }
44
+ >
45
+ <Button
46
+ text="Choose a Plan"
47
+ styles={{
48
+ height: "35px",
49
+ padding: "4px 20px",
50
+ fontSize: "14px",
51
+ }}
52
+ />
53
+ </div>
54
+ </Expire>
55
+ )}
57
56
  <div className="gracePeriod_account">
58
57
  <div className="content">
59
58
  <p>Sorry, you can’t access your account</p>
@@ -118,7 +117,7 @@ const Expire = styled.div`
118
117
  border-radius: 25px;
119
118
  background: rgba(48, 212, 104, 0.15);
120
119
  display: flex;
121
- padding: 15px 26px;
120
+ padding: 15px 26px;
122
121
  flex-direction: column;
123
122
  align-items: flex-start;
124
123
  gap: 10px;
@@ -119,7 +119,8 @@ const SubscriptionExpiredModal = ({
119
119
  closeTimeoutMS={1000}
120
120
  ariaHideApp={false}
121
121
  contentLabel="Selected Option"
122
- shouldCloseOnOverlayClick={false}>
122
+ shouldCloseOnOverlayClick={false}
123
+ >
123
124
  <ModalCardContainer>
124
125
  {/* <CloseModalButton
125
126
  onClick={() => {
@@ -166,10 +167,7 @@ const SubscriptionExpiredModal = ({
166
167
  margin: 0,
167
168
  backgroundColor: "transparent",
168
169
  }}
169
- onClick={() =>
170
- (window.location.href =
171
- "https://559staging.learngual.com/settings/payment")
172
- }
170
+ onClick={() => (window.location.href = "/settings/payment")}
173
171
  />
174
172
  <ButtonComponent
175
173
  text={"Renew subscription"}
@@ -112,7 +112,9 @@ const AccountDropdown = (props) => {
112
112
  <>
113
113
  {props?.developerAccountData.length > 0 && (
114
114
  <div>
115
- <h3 style={{ marginBottom: 10 }}>{props.findText("Developer accounts")}</h3>
115
+ <h3 style={{ marginBottom: 10 }}>
116
+ {props.findText("Developer accounts")}
117
+ </h3>
116
118
  {props?.developerAccountData
117
119
  ?.filter((developerItem) => !developerItem?.pending_delete) // filter out pending delete items
118
120
  .map((developerItem, idx) => {
@@ -130,7 +132,8 @@ const AccountDropdown = (props) => {
130
132
  handleRedirectFunc(developerItem);
131
133
  }, 1000);
132
134
  }}
133
- key={idx}>
135
+ key={idx}
136
+ >
134
137
  <div className="avatar-container">
135
138
  <img
136
139
  src={
@@ -176,7 +179,8 @@ const AccountDropdown = (props) => {
176
179
  handleRedirectFunc(instructorItem);
177
180
  }, 1000);
178
181
  }}
179
- key={idx}>
182
+ key={idx}
183
+ >
180
184
  <div className="avatar-container">
181
185
  <img
182
186
  src={
@@ -218,7 +222,8 @@ const AccountDropdown = (props) => {
218
222
  handleRedirectFunc(enterpriseItem);
219
223
  }, 1000);
220
224
  }}
221
- key={idx}>
225
+ key={idx}
226
+ >
222
227
  <div className="avatar-container">
223
228
  <img
224
229
  src={
@@ -265,7 +270,8 @@ const AccountDropdown = (props) => {
265
270
  handleRedirectFunc(personalItem);
266
271
  }, 1000);
267
272
  }}
268
- key={idx}>
273
+ key={idx}
274
+ >
269
275
  <div className="avatar-container">
270
276
  <img
271
277
  src={
@@ -297,15 +303,10 @@ const AccountDropdown = (props) => {
297
303
  <AccountDropdownFooter>
298
304
  <button
299
305
  onClick={() => {
300
- if (window.location.hostname.includes("staging")) {
301
- window.location.href =
302
- "https://559staging.learngual.com/auth/account-type";
303
- } else if (!window.location.hostname.includes("localhost")) {
304
- window.location.href =
305
- "https://learngual.com/auth/account-type";
306
- }
306
+ window.location.href = "/auth/account-type";
307
307
  }}
308
- style={{ cursor: "pointer" }}>
308
+ style={{ cursor: "pointer" }}
309
+ >
309
310
  <AddIcon /> {props.findText("Add account")}
310
311
  </button>
311
312
  </AccountDropdownFooter>
@@ -63,7 +63,7 @@ const HeaderComponent = (props) => {
63
63
  handleRetrieveUserDetails,
64
64
  updateUserAccountData,
65
65
  handleUpdateUserAccount,
66
- handleGetUnreadNotificationPersonal
66
+ handleGetUnreadNotificationPersonal,
67
67
  } = useHeader();
68
68
  const { pathname } = useLocation();
69
69
  const { setGeneralData, generalData, notificationMarkReadData } =
@@ -76,10 +76,10 @@ const HeaderComponent = (props) => {
76
76
  : userAccountsDetail?.data?.[0]?.type?.toLowerCase();
77
77
 
78
78
  useEffect(() => {
79
- if(currentAccountType) {
80
- setAccountType(currentAccountType)
79
+ if (currentAccountType) {
80
+ setAccountType(currentAccountType);
81
81
  }
82
- }, [currentAccountType])
82
+ }, [currentAccountType]);
83
83
 
84
84
  useEffect(() => {
85
85
  setIsOpen(false);
@@ -94,7 +94,7 @@ const HeaderComponent = (props) => {
94
94
  }
95
95
 
96
96
  if (accountType && accountType === "personal") {
97
- handleGetUnreadNotificationPersonal()
97
+ handleGetUnreadNotificationPersonal();
98
98
  }
99
99
  }, [accountType]);
100
100
 
@@ -445,8 +445,7 @@ const HeaderComponent = (props) => {
445
445
  <li>
446
446
  <a
447
447
  onClick={() => {
448
- window.location.href =
449
- "https://559staging.learngual.com/settings/account";
448
+ window.location.href = "/settings/account";
450
449
  }}
451
450
  className={
452
451
  window.location.pathname.includes("settings") ? "active" : ""
@@ -469,7 +468,7 @@ const HeaderComponent = (props) => {
469
468
  e.preventDefault();
470
469
  e.stopPropagation();
471
470
  } else {
472
- window.location.href = `https://559staging.learngual.com/${
471
+ window.location.href = `/${
473
472
  selectedAccount?.type
474
473
  ? selectedAccount?.type?.toLowerCase()
475
474
  : userAccountsDetail?.data?.[0]?.type?.toLowerCase()
@@ -496,8 +495,7 @@ const HeaderComponent = (props) => {
496
495
  <li style={{ marginLeft: "20%", cursor: "pointer" }}>
497
496
  <a
498
497
  onClick={() => {
499
- window.location.href =
500
- "https://559staging.learngual.com/help-center";
498
+ window.location.href = "/help-center";
501
499
  }}
502
500
  className={
503
501
  window.location.pathname.includes("help-center") ? "active" : ""
@@ -26,7 +26,7 @@ const SideMenu = ({
26
26
  affiliatesActive,
27
27
  setRightComponent,
28
28
  planState,
29
- findText
29
+ findText,
30
30
  }) => {
31
31
  //console.log("user type", userType);
32
32
  // const [isOpen, setIsOpen] = useState(false);
@@ -276,7 +276,7 @@ const SideMenu = ({
276
276
  ) {
277
277
  newTab
278
278
  ? window.open(path, "_blank")
279
- : (window.location.href = `https://559staging.learngual.com${path}`);
279
+ : (window.location.href = `${path}`);
280
280
  } else if (window.location.hostname.includes("localhost")) {
281
281
  newTab
282
282
  ? window.open(path, "_blank")
@@ -287,31 +287,21 @@ const SideMenu = ({
287
287
  ) {
288
288
  newTab
289
289
  ? window.open(path, "_blank")
290
- : (window.location.href = `https://developer.learngual.com${path}`);
290
+ : (window.location.href = `${path}`);
291
291
  }
292
292
 
293
293
  if (!newTab) {
294
294
  if (window.location.hostname.includes("559staging")) {
295
- window.location.href = `https://559staging.learngual.com${path}`;
295
+ window.location.href = `${path}`;
296
296
  } else if (window.location.hostname.includes("localhost")) {
297
297
  window.location.href = `http://localhost:${window.location.port}${path}`;
298
+ } else {
299
+ window.location.href = `${path}`;
298
300
  }
299
301
  }
300
302
  }}
301
- // to={route.path}
302
303
  key={index}
303
- className={cx(
304
- `${route.text} ${
305
- active && "active"
306
- // active && planState !== "GRACE PERIOD"
307
- // ? "active"
308
- // : active && planState === "GRACE PERIOD"
309
- // ? "grace_period_active"
310
- // : !active && planState === "GRACE PERIOD"
311
- // ? "grace_period"
312
- // : ""
313
- }`
314
- )}
304
+ className={cx(`${route.text} ${active && "active"}`)}
315
305
  minimal={isOpen}
316
306
  >
317
307
  <IconContainer active={active}>
@@ -13,7 +13,6 @@ import Cookies from "js-cookie";
13
13
  import { OutletContext } from "../AppMainLayout";
14
14
 
15
15
  const SideBar = ({ routes, findText }) => {
16
-
17
16
  const deleteCookies = (name) => {
18
17
  const date = new Date();
19
18
  date.setHours(date.getHours() - 1);
@@ -83,11 +82,9 @@ const SideBar = ({ routes, findText }) => {
83
82
  window.location.hostname.includes("localhost") ||
84
83
  window.location.hostname.includes("staging")
85
84
  ) {
86
- window.location.href =
87
- "https://559staging.learngual.com/auth/sign-in/";
85
+ window.location.href = "/auth/sign-in/";
88
86
  } else {
89
- window.location.href =
90
- "https://demo.learngual.com/login/developer";
87
+ window.location.href = "/login/developer";
91
88
  }
92
89
  }, 500);
93
90
  }}
@@ -52,32 +52,32 @@ export const user = {
52
52
 
53
53
  export const leftNavMenu = [
54
54
  {
55
- path: "https://559staging.learngual.com/developer",
55
+ path: "/developer",
56
56
  label: "Learning",
57
57
  icon: <Learning />,
58
58
  },
59
59
  {
60
- path: "https://comingsoon.learngual.com/community",
60
+ path: "/community",
61
61
  label: "Community",
62
62
  icon: <CommunityIcon />,
63
63
  },
64
64
  {
65
- path: "https://comingsoon.learngual.com/fun",
65
+ path: "/fun",
66
66
  label: "Fun",
67
67
  icon: <FunIcon />,
68
68
  },
69
69
  {
70
- path: "https://comingsoon.learngual.com/duet",
70
+ path: "/duet",
71
71
  label: "Duet",
72
72
  icon: <DuetIcon />,
73
73
  },
74
74
  {
75
- path: "https://comingsoon.learngual.com/speech",
75
+ path: "/speech",
76
76
  label: "Speech",
77
77
  icon: <SpeechIcon />,
78
78
  },
79
79
  {
80
- path: "https://comingsoon.learngual.com/dictionary",
80
+ path: "/dictionary",
81
81
  label: "Dictionary",
82
82
  icon: <DictionaryIcon />,
83
83
  },