Fixed a couple of SonarQube issues.

This commit is contained in:
Nikhil Mohite
2022-09-27 14:28:31 +05:30
committed by GitHub
parent add5404f5e
commit 1b11a6cd4b
5 changed files with 152 additions and 104 deletions

View File

@@ -155,14 +155,19 @@ const dialogStyle = makeStyles((theme) => ({
}
}));
function checkIsResizable(props) {
return props.isresizeable == 'true' ? true : false;
}
function setEnableResizing(props, resizeable) {
return props.isfullscreen == 'true' ? false : resizeable;
}
function PaperComponent({minHeight, minWidth, ...props}) {
let classes = dialogStyle();
let [dialogPosition, setDialogPosition] = useState(null);
let resizeable = props.isresizeable == 'true' ? true : false;
const setEnableResizing = () => {
return props.isfullscreen == 'true' ? false : resizeable;
};
let resizeable = checkIsResizable(props);
const setConditionalPosition = () => {
return props.isfullscreen == 'true' ? { x: 0, y: 0 } : dialogPosition && { x: dialogPosition.x, y: dialogPosition.y };
@@ -187,7 +192,7 @@ function PaperComponent({minHeight, minWidth, ...props}) {
// {...(props.width && { minWidth: MIN_WIDTH })}
// {...(props.height && { minHeight: MIN_HEIGHT })}
bounds="window"
enableResizing={setEnableResizing()}
enableResizing={setEnableResizing(props, resizeable)}
position={setConditionalPosition()}
onDragStop={(e, position) => {
if (props.isfullscreen !== 'true') {