l-min-components 1.7.1331 → 1.7.1333

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.7.1331",
3
+ "version": "1.7.1333",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -5,7 +5,7 @@ import { IoCloseOutline } from "react-icons/io5";
5
5
  import { FaCheck } from "react-icons/fa6";
6
6
  import ButtonComponent from "../button";
7
7
 
8
- const Grammer = ({ data }) => {
8
+ const Grammer = ({ data, hideScore }) => {
9
9
  const [selected, setSelected] = useState(null);
10
10
  const [showVersion, setShowVersion] = useState(null);
11
11
 
@@ -134,9 +134,11 @@ const Grammer = ({ data }) => {
134
134
  <CursorClickIcon />
135
135
  <p>Click on the words/sentences highlighted in red to see feedback</p>
136
136
  </div>
137
- <p>
138
- Points: <span>{data?.["Grammar Score"] || 0}</span>
139
- </p>
137
+ {!hideScore && (
138
+ <p>
139
+ Points: <span>{data?.["Grammar Score"] || 0}</span>
140
+ </p>
141
+ )}
140
142
  </Header>
141
143
  <Content>
142
144
  <div className="text_content">
@@ -12,6 +12,7 @@ const AIAnalysis = ({
12
12
  options = [],
13
13
  data,
14
14
  onClose,
15
+ hideScore,
15
16
  }) => {
16
17
  const [selected, setSelectied] = useState(options[0]?.value);
17
18
 
@@ -31,16 +32,18 @@ const AIAnalysis = ({
31
32
  <Relevant
32
33
  data={data?.relevance[0]?.model_data}
33
34
  student_text={data?.student_text}
35
+ hideScore={hideScore}
34
36
  />
35
37
  )}
36
38
  {selected === "grammar" && (
37
- <Grammer data={data?.grammar[0]?.model_data} />
39
+ <Grammer data={data?.grammar[0]?.model_data} hideScore={hideScore} />
38
40
  )}
39
41
  {selected === "speech" &&
40
42
  data?.speech_analysis[0]?.model_data?.Reference && (
41
43
  <Speech
42
44
  data={data?.speech_analysis[0]?.model_data}
43
45
  audio={data?.audio}
46
+ hideScore={hideScore}
44
47
  />
45
48
  )}
46
49
  </Wrapper>
@@ -2,16 +2,18 @@ import React, { useState } from "react";
2
2
  import styled from "styled-components";
3
3
  import ArrowDown from "./assets/arrowDown";
4
4
 
5
- const Relevant = ({ data, student_text }) => {
5
+ const Relevant = ({ data, student_text, hideScore }) => {
6
6
  return (
7
7
  <Container>
8
8
  <Header>
9
9
  <h2 className={data?.Evaluation === "Not Relevant" ? "error" : ""}>
10
10
  {data?.Evaluation}
11
11
  </h2>
12
- <p>
13
- Points: <span>{data?.Point || 0}</span>
14
- </p>
12
+ {!hideScore && (
13
+ <p>
14
+ Points: <span>{data?.Point || 0}</span>
15
+ </p>
16
+ )}
15
17
  </Header>
16
18
  <Dropdown label="Feedback" isFeedback text={data?.Feedback} />
17
19
  {student_text && <Dropdown label="Student essay" text={student_text} />}
@@ -7,7 +7,7 @@ import DropdownResult from "./dropdownResult";
7
7
  import WordWheel from "./wordWheel";
8
8
  import formatScore from "../../utils/formatScore";
9
9
 
10
- const Speech = ({ data, audio }) => {
10
+ const Speech = ({ data, audio, hideScore }) => {
11
11
  const wordsData = Object.values(data["Word Phonetic Evaluation"])?.map(
12
12
  (word, idx) => ({ id: idx, value: word })
13
13
  );
@@ -50,9 +50,11 @@ const Speech = ({ data, audio }) => {
50
50
  <CursorClickIcon />
51
51
  <p>Click on the word to see detailed feedback</p>
52
52
  </div>
53
- <p>
54
- Points: <span>{formatScore(data["General Score"]) || 0}</span>
55
- </p>
53
+ {!hideScore && (
54
+ <p>
55
+ Points: <span>{formatScore(data["General Score"]) || 0}</span>
56
+ </p>
57
+ )}
56
58
  </Header>
57
59
  <WordContent>
58
60
  <p>
@@ -440,7 +440,8 @@ const AppMainLayout = ({ children }) => {
440
440
  />
441
441
  ) : window.location.pathname.includes("instructor") &&
442
442
  !planState &&
443
- !userPlanData?.loading ? (
443
+ !userPlanData?.loading &&
444
+ !affiliateAccount?.id ? (
444
445
  <div className="instructor_expired">
445
446
  <h1>Dashboard</h1>
446
447
  <div className="instructor_expired_body">
@@ -472,7 +473,10 @@ const AppMainLayout = ({ children }) => {
472
473
  <RightLayout>
473
474
  {rightComponent ??
474
475
  (activeAccountType === "enterprise" ? (
475
- <EnterpriseRightBar planState={planState} />
476
+ <EnterpriseRightBar
477
+ planState={planState}
478
+ affiliateAccount={affiliateAccount}
479
+ />
476
480
  ) : activeAccountType === "instructor" ? (
477
481
  affiliateAccount?.id ? (
478
482
  <AffiliateRightBar
@@ -12,7 +12,7 @@ import BoxIcon from "./boxIcon";
12
12
  import InstructorMessage from "./messageSection";
13
13
  import redirectURL from "../../../utils/redirectURL";
14
14
 
15
- const InstructorRightBar = ({ planState }) => {
15
+ const InstructorRightBar = ({ planState, affiliateAccount }) => {
16
16
  const { handleGetCoursesData, coursesData } = api();
17
17
 
18
18
  useEffect(() => {
@@ -37,7 +37,7 @@ const InstructorRightBar = ({ planState }) => {
37
37
  const port = window?.location?.port ? `:${window.location.port}` : "";
38
38
  const protocol = window?.location?.protocol;
39
39
 
40
- return (
40
+ return planState || affiliateAccount?.id ? (
41
41
  <EnterpriseContainer
42
42
  className={planState === "GRACE PERIOD" ? "grace_period" : ""}
43
43
  >
@@ -103,7 +103,7 @@ const InstructorRightBar = ({ planState }) => {
103
103
  }}
104
104
  />
105
105
  </EnterpriseContainer>
106
- );
106
+ ) : null;
107
107
  };
108
108
 
109
109
  const CustomDotsContainer = styled.li`