diff --git a/src/components/Tutorials/index.jsx b/src/components/Tutorials/index.jsx index 0ac1daa8..e1fcbbff 100644 --- a/src/components/Tutorials/index.jsx +++ b/src/components/Tutorials/index.jsx @@ -26,10 +26,14 @@ import { Collapse, Button } from "@mui/material"; import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import { makeStyles } from "@mui/styles"; + const useStyles = makeStyles(theme => ({ flexRow: { display: "flex", - flexDirection: "row" + flexDirection: "row", + [theme.breakpoints.down('sm')]: { + flexDirection: "column" + }, }, collapseContainer: { minWidth: "100%", @@ -199,6 +203,7 @@ const ViewTutorial = () => { )} + { /> + - { @@ -223,9 +229,11 @@ const ViewTutorial = () => { > + )} @@ -249,7 +257,7 @@ const ViewTutorial = () => { - + ({ display: "flex", justifyContent: "space-between", [theme.breakpoints.down("sm")]: { - flexDirection: "column", + flexDirection: "", alignItems: "center", - gap: "30px" + gap: "30px", } }, rightButtonsGroup: { @@ -24,8 +24,12 @@ const useStyles = makeStyles(theme => ({ "&:hover": { borderWidth: "2px" }, - minWidth: "fit-content" + minWidth: "fit-content", + [theme.breakpoints.down("sm")]: { + marginLeft: "-15px" + } }, + completeButton: { minWidth: "fit-content" } @@ -39,7 +43,7 @@ const ControlButtons = ({ setStepData }) => { const classes = useStyles(); - if (!hide && stepsData) { + if (stepsData) { return ( diff --git a/src/components/Tutorials/subComps/EditControls.jsx b/src/components/Tutorials/subComps/EditControls.jsx index f3e9083c..76fb2a0f 100644 --- a/src/components/Tutorials/subComps/EditControls.jsx +++ b/src/components/Tutorials/subComps/EditControls.jsx @@ -116,9 +116,10 @@ const EditControls = ({ return ( <> +
+
+ setMode("edit")} id="editorMode" data-testId="editorMode" + sx={{ + ml: isDesktop ? 0 : 2 + }} > Editor mode @@ -185,9 +196,12 @@ const EditControls = ({ {mode === "edit" && ( @@ -197,10 +211,13 @@ const EditControls = ({ onClick={handlePublishTutorial} type="dashed" disabled={publishLoad} + sx={{ + ml: isDesktop ? 0 : 4 + }} > {isPublished ? "Unpublish" : "Publish"} - + )} diff --git a/src/components/Tutorials/subComps/RemoveStepModal.jsx b/src/components/Tutorials/subComps/RemoveStepModal.jsx index 56201862..3b8c8251 100644 --- a/src/components/Tutorials/subComps/RemoveStepModal.jsx +++ b/src/components/Tutorials/subComps/RemoveStepModal.jsx @@ -5,7 +5,9 @@ import { useFirebase, useFirestore } from "react-redux-firebase"; import { useDispatch } from "react-redux"; import { removeStep } from "../../../store/actions"; import Snackbar from "@mui/material/Snackbar"; +import { useMediaQuery } from "react-responsive"; import Typography from "@mui/material/Typography"; +import { Box } from "@mui/material"; const RemoveStepModal = ({ owner, @@ -20,6 +22,10 @@ const RemoveStepModal = ({ const dispatch = useDispatch(); const [visible, setVisible] = useState(false); + const isDesktop = useMediaQuery({ + query: "(min-device-width: 767px)" + }); + useEffect(() => { setVisible(viewModal); }, [viewModal]); @@ -64,30 +70,38 @@ const RemoveStepModal = ({ aria-labelledby="simple-modal-title" aria-describedby="simple-modal-description" style={{ - border: "2px solid #000", - background: "whitesmoke", - boxShadow: "2rem gray", display: "flex", alignItems: "center", - justifyContent: "center", - height: "10rem", - width: "20rem", - position: "absolute", - top: "40%", - left: "40%" + justifyContent: "center" }} > -
- This action is can not be undone! + +
+ This action is can not be undone!
- -
+
); }; diff --git a/src/components/Tutorials/subComps/StepsPanel.jsx b/src/components/Tutorials/subComps/StepsPanel.jsx index c52177ba..5083ca81 100644 --- a/src/components/Tutorials/subComps/StepsPanel.jsx +++ b/src/components/Tutorials/subComps/StepsPanel.jsx @@ -45,7 +45,7 @@ const StepsPanel = ({ {!hideButton && - false && ( //remove false to show + false && ( //remove false to show