Skip to content

Commit

Permalink
#0000 solving sonar lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinkyapandetekdi committed Oct 13, 2024
1 parent 9803bcc commit d429c98
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 13 deletions.
35 changes: 24 additions & 11 deletions src/components/Layouts.jsx/MainLayout.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Card, CardContent, Typography } from "@mui/material";
import Stack from "@mui/material/Stack";

import PropTypes from "prop-types";
import practicebgstone from "../../assets/images/practice-bg-stone.svg";
import practicebgstone2 from "../../assets/images/practice-bg-stone2.svg";
import practicebgstone3 from "../../assets/images/practice-bg-stone3.svg";
Expand Down Expand Up @@ -243,9 +243,7 @@ const MainLayout = (props) => {
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
backgroundImage: `url(${
cardBackground ? cardBackground : textureImage
})`,
backgroundImage: `url(${cardBackground || textureImage})`,
backgroundSize: "contain",
backgroundRepeat: "round",
boxShadow: "0px 4px 20px -1px rgba(0, 0, 0, 0.00)",
Expand Down Expand Up @@ -274,9 +272,7 @@ const MainLayout = (props) => {
display: "flex",
flexDirection: "column",
justifyContent: "space-between",
backgroundImage: `url(${
cardBackground ? cardBackground : textureImage
})`,
backgroundImage: `url(${cardBackground || textureImage})`,
backgroundRepeat: "no-repeat",
backgroundSize: "cover",
boxShadow: "0px 4px 20px -1px rgba(0, 0, 0, 0.00)",
Expand All @@ -296,7 +292,7 @@ const MainLayout = (props) => {
<img
src={timer}
alt="timer"
sx={{ height: "58px", width: "58px" }}
style={{ height: "58px", width: "58px" }}
/>
</Box>
)}
Expand All @@ -315,6 +311,7 @@ const MainLayout = (props) => {
const showGreen = step + 1 <= currentStep;
return (
<Box
key={index}
index={index}
sx={{
height: "8px",
Expand Down Expand Up @@ -625,9 +622,7 @@ const MainLayout = (props) => {
display: "flex",
flexDirection: "column",
justifyContent: "space-between",
backgroundImage: `url(${
cardBackground ? cardBackground : textureImage
})`,
backgroundImage: `url(${cardBackground || textureImage})`,
backgroundSize: "contain",
backgroundRepeat: "round",
boxShadow: "0px 4px 20px -1px rgba(0, 0, 0, 0.00)",
Expand Down Expand Up @@ -981,4 +976,22 @@ const MainLayout = (props) => {
);
};

MainLayout.propTypes = {
contentType: PropTypes.string.isRequired,
handleBack: PropTypes.func.isRequired,
disableScreen: PropTypes.bool,
isShowCase: PropTypes.bool,
showProgress: PropTypes.bool,
setOpenLangModal: PropTypes.func,
points: PropTypes.number,
handleNext: PropTypes.func.isRequired,
enableNext: PropTypes.bool,
showNext: PropTypes.bool,
showTimer: PropTypes.bool,
nextLessonAndHome: PropTypes.bool,
startShowCase: PropTypes.bool,
setStartShowCase: PropTypes.func,
loading: PropTypes.bool,
};

export default MainLayout;
34 changes: 32 additions & 2 deletions src/components/Mechanism/WordsOrImage.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Box, CardContent, Typography } from "@mui/material";
import { Box, CardContent, Typography, CircularProgress } from "@mui/material";
import { createRef, useState } from "react";
import v11 from "../../assets/audio/V10.mp3";
import VoiceAnalyser from "../../utils/VoiceAnalyser";
import { PlayAudioButton, StopAudioButton } from "../../utils/constants";
import MainLayout from "../Layouts.jsx/MainLayout";
import { CircularProgress } from "../../../node_modules/@mui/material/index";
import PropTypes from "prop-types";

const WordsOrImage = ({
handleNext,
Expand Down Expand Up @@ -267,4 +267,34 @@ const WordsOrImage = ({
);
};

WordsOrImage.propTypes = {
handleNext: PropTypes.func.isRequired,
// background: PropTypes.string, // Assuming it's a string
header: PropTypes.string,
image: PropTypes.string, // Assuming it's a string
setVoiceText: PropTypes.func.isRequired,
setRecordedAudio: PropTypes.func.isRequired,
setVoiceAnimate: PropTypes.func.isRequired,
enableNext: PropTypes.bool,
showTimer: PropTypes.bool,
points: PropTypes.number,
currentStep: PropTypes.number.isRequired,
percentage: PropTypes.number,
fluency: PropTypes.number,
isDiscover: PropTypes.bool,
showProgress: PropTypes.bool,
callUpdateLearner: PropTypes.func.isRequired,
disableScreen: PropTypes.bool,
isShowCase: PropTypes.bool,
handleBack: PropTypes.func.isRequired,
setEnableNext: PropTypes.func.isRequired,
startShowCase: PropTypes.bool,
setStartShowCase: PropTypes.func,
setLivesData: PropTypes.func.isRequired,
loading: PropTypes.bool,
setOpenMessageDialog: PropTypes.func.isRequired,
isNextButtonCalled: PropTypes.bool,
setIsNextButtonCalled: PropTypes.func,
};

export default WordsOrImage;

0 comments on commit d429c98

Please sign in to comment.