l-min-components 1.7.1595 → 1.7.1597
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/reportsComponents/fullAnalysis/components/Grammar.v2.jsx +28 -25
- package/src/components/reportsComponents/fullAnalysis/components/translateDropdown.jsx +10 -8
- package/src/components/reportsComponents/fullAnalysis/data.grammar.v2.jsx +182 -2684
- package/src/components/reportsComponents/fullAnalysis/icons/emptyBoxIcon.jsx +74 -0
- package/src/components/reportsComponents/fullAnalysis/index.jsx +75 -52
- package/src/components/reportsComponents/fullAnalysis/style.jsx +34 -1
- package/src/components/reportsComponents/hooks/useRreportUtils.jsx +43 -0
- package/src/components/reportsComponents/reportQuestions/contants.jsx +10 -0
- package/src/components/reportsComponents/reportQuestions/index.jsx +3 -1
- package/src/components/reportsComponents/reportQuestions/questions/quizMultipleChoice.jsx +1 -1
- package/src/components/reportsComponents/reportQuestions/questions/quizNewWritten.jsx +2 -2
- package/src/hooks/useTranslation.jsx +37 -33
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
GrammarHeaderContent,
|
|
6
6
|
GrammarV2Content,
|
|
7
7
|
GrammarV2ContentWrapper,
|
|
8
|
+
GrammarV2ContentWrapperTranslate,
|
|
8
9
|
GrammarV2Correct,
|
|
9
10
|
GrammarV2Feedback,
|
|
10
11
|
GrammarV2FeedbackList,
|
|
@@ -226,32 +227,34 @@ const GrammarV2 = ({ Aidata, isPersonal }) => {
|
|
|
226
227
|
{selectedSection === 2 &&
|
|
227
228
|
isPersonal &&
|
|
228
229
|
feedbackIssues?.length > 0 && (
|
|
229
|
-
<
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
if (res?.data) {
|
|
242
|
-
const list = res?.data?.data?.map((item, idx) => {
|
|
243
|
-
const text = feedbackToTranslate[idx];
|
|
244
|
-
return {
|
|
245
|
-
text,
|
|
246
|
-
value: item,
|
|
247
|
-
};
|
|
230
|
+
<GrammarV2ContentWrapperTranslate>
|
|
231
|
+
<TranslateDropdown
|
|
232
|
+
loading={translateLangData?.loading}
|
|
233
|
+
onChange={async (lang) => {
|
|
234
|
+
const code = lang?.code;
|
|
235
|
+
if (code === "en" || !lang) {
|
|
236
|
+
setTranslate(null);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
const res = await handleTranslate({
|
|
240
|
+
phrase: feedbackToTranslate,
|
|
241
|
+
language: code,
|
|
248
242
|
});
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
243
|
+
if (res?.data) {
|
|
244
|
+
const list = res?.data?.data?.map((item, idx) => {
|
|
245
|
+
const text = feedbackToTranslate[idx];
|
|
246
|
+
return {
|
|
247
|
+
text,
|
|
248
|
+
value: item,
|
|
249
|
+
};
|
|
250
|
+
});
|
|
251
|
+
setTranslate(list);
|
|
252
|
+
} else {
|
|
253
|
+
setTranslate(null);
|
|
254
|
+
}
|
|
255
|
+
}}
|
|
256
|
+
/>
|
|
257
|
+
</GrammarV2ContentWrapperTranslate>
|
|
255
258
|
)}
|
|
256
259
|
{selectedSection === 1 && selectOperation && (
|
|
257
260
|
<div className="feedback_section">
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { useContext, useState } from
|
|
2
|
-
import styled from
|
|
3
|
-
import { FullAnalysisContext } from
|
|
4
|
-
import OutsideAlerter from
|
|
5
|
-
import classNames from
|
|
1
|
+
import React, { useContext, useState } from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { FullAnalysisContext } from "..";
|
|
4
|
+
import OutsideAlerter from "../../../outsideEventChecker";
|
|
5
|
+
import classNames from "classnames";
|
|
6
6
|
const TranslateDropdown = ({ onChange, loading }) => {
|
|
7
7
|
const { languageData } = useContext(FullAnalysisContext);
|
|
8
8
|
const [selected, setSelected] = useState(null);
|
|
@@ -17,14 +17,14 @@ const TranslateDropdown = ({ onChange, loading }) => {
|
|
|
17
17
|
>
|
|
18
18
|
<Container>
|
|
19
19
|
<DropdownMenu
|
|
20
|
-
className={classNames(loading &&
|
|
20
|
+
className={classNames(loading && "disabled")}
|
|
21
21
|
onClick={() => {
|
|
22
22
|
if (loading) return;
|
|
23
23
|
setToggle(!toggle);
|
|
24
24
|
}}
|
|
25
25
|
>
|
|
26
|
-
<WordIcon />{
|
|
27
|
-
{loading ?
|
|
26
|
+
<WordIcon />{" "}
|
|
27
|
+
{loading ? "Please wait..." : selected?.name || "Translate"}
|
|
28
28
|
<Arrow />
|
|
29
29
|
</DropdownMenu>
|
|
30
30
|
{toggle && (
|
|
@@ -52,6 +52,8 @@ export default TranslateDropdown;
|
|
|
52
52
|
const Container = styled.div`
|
|
53
53
|
position: relative;
|
|
54
54
|
width: fit-content;
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: flex-end;
|
|
55
57
|
|
|
56
58
|
min-width: 175px;
|
|
57
59
|
`;
|