заменен текст кроп кнопок
This commit is contained in:
parent
deecd2b0b6
commit
6c3469205a
@ -31,7 +31,7 @@ export default function OptionsPicture({
|
|||||||
setOpenBranchingPage,
|
setOpenBranchingPage,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const onClickAddAnAnswer = useAddAnswer();
|
const {onClickAddAnAnswer} = useAddAnswer();
|
||||||
const quizQid = useCurrentQuiz()?.qid;
|
const quizQid = useCurrentQuiz()?.qid;
|
||||||
const [pictureUploding, setPictureUploading] = useState<boolean>(false);
|
const [pictureUploding, setPictureUploading] = useState<boolean>(false);
|
||||||
const [openCropModal, setOpenCropModal] = useState(false);
|
const [openCropModal, setOpenCropModal] = useState(false);
|
||||||
|
@ -42,6 +42,11 @@ export const CropModal: FC<CropModalProps> = ({
|
|||||||
const POS = PriorityOfSteps.filter(POS => mainSteps.find(e => POS === e))
|
const POS = PriorityOfSteps.filter(POS => mainSteps.find(e => POS === e))
|
||||||
return POS[currentStep] as ScreenStepsTypes
|
return POS[currentStep] as ScreenStepsTypes
|
||||||
}, [currentStep])
|
}, [currentStep])
|
||||||
|
const nextStepName: ScreenStepsTypes = useMemo(() => {
|
||||||
|
const mainSteps = Object.keys(workSpaceTypes);
|
||||||
|
const POS = PriorityOfSteps.filter(POS => mainSteps.find(e => POS === e))
|
||||||
|
return POS[currentStep+1] as ScreenStepsTypes
|
||||||
|
}, [currentStep])
|
||||||
|
|
||||||
const editedImagesChange: EditedImagesChangeType = (changed) => {
|
const editedImagesChange: EditedImagesChangeType = (changed) => {
|
||||||
setEditedImages(old => {
|
setEditedImages(old => {
|
||||||
@ -103,6 +108,7 @@ export const CropModal: FC<CropModalProps> = ({
|
|||||||
onDeleteClick={onDeleteClick}
|
onDeleteClick={onDeleteClick}
|
||||||
/>
|
/>
|
||||||
<NavigationPanel
|
<NavigationPanel
|
||||||
|
nextStepName={nextStepName}
|
||||||
currentStep={currentStep}
|
currentStep={currentStep}
|
||||||
setCurrentStep={setCurrentStep}
|
setCurrentStep={setCurrentStep}
|
||||||
totalSteps={Object.keys(workSpaceTypes).length}
|
totalSteps={Object.keys(workSpaceTypes).length}
|
||||||
|
@ -6,8 +6,10 @@ import {
|
|||||||
useTheme,
|
useTheme,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import BackArrowIcon from "@icons/BackArrowIcon";
|
import BackArrowIcon from "@icons/BackArrowIcon";
|
||||||
|
import { ScreenStepsTypes } from "@/model/CropModal/CropModal";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
nextStepName: ScreenStepsTypes;
|
||||||
currentStep: number;
|
currentStep: number;
|
||||||
setCurrentStep: (setp: number) => void;
|
setCurrentStep: (setp: number) => void;
|
||||||
totalSteps: number;
|
totalSteps: number;
|
||||||
@ -16,6 +18,7 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const NavigationPanel: FC<Props> = ({
|
export const NavigationPanel: FC<Props> = ({
|
||||||
|
nextStepName,
|
||||||
currentStep,
|
currentStep,
|
||||||
setCurrentStep,
|
setCurrentStep,
|
||||||
totalSteps,
|
totalSteps,
|
||||||
@ -26,6 +29,9 @@ export const NavigationPanel: FC<Props> = ({
|
|||||||
const isMobile = useMediaQuery(theme.breakpoints.down(786));
|
const isMobile = useMediaQuery(theme.breakpoints.down(786));
|
||||||
const lastStep = currentStep + 1 === totalSteps;
|
const lastStep = currentStep + 1 === totalSteps;
|
||||||
|
|
||||||
|
console.log("nextStepName")
|
||||||
|
console.log(nextStepName)
|
||||||
|
|
||||||
const handlePrevStep = () => {
|
const handlePrevStep = () => {
|
||||||
if (currentStep === 0) return;
|
if (currentStep === 0) return;
|
||||||
setCurrentStep(currentStep - 1);
|
setCurrentStep(currentStep - 1);
|
||||||
@ -99,10 +105,12 @@ export const NavigationPanel: FC<Props> = ({
|
|||||||
border: "1px solid #7E2AEA",
|
border: "1px solid #7E2AEA",
|
||||||
p: "10px 19px",
|
p: "10px 19px",
|
||||||
width: isMobile ? "100%" : undefined,
|
width: isMobile ? "100%" : undefined,
|
||||||
|
lineHeight: "100%"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{lastStep ?
|
{lastStep ?
|
||||||
"Сохранить редактированное" : "Далее"
|
"Сохранить редактированное" : nextStepName === "mobile" ?
|
||||||
|
"Настроить для мобильной версии" : nextStepName === "tablet" ? "Настроить для планшетной версии" : "Далее"
|
||||||
}
|
}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
|
Loading…
Reference in New Issue
Block a user