заменен текст кроп кнопок

This commit is contained in:
Nastya 2024-11-21 17:03:46 +03:00
parent deecd2b0b6
commit 6c3469205a
3 changed files with 16 additions and 2 deletions

@ -31,7 +31,7 @@ export default function OptionsPicture({
setOpenBranchingPage,
}: Props) {
const theme = useTheme();
const onClickAddAnAnswer = useAddAnswer();
const {onClickAddAnAnswer} = useAddAnswer();
const quizQid = useCurrentQuiz()?.qid;
const [pictureUploding, setPictureUploading] = useState<boolean>(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))
return POS[currentStep] as ScreenStepsTypes
}, [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) => {
setEditedImages(old => {
@ -103,6 +108,7 @@ export const CropModal: FC<CropModalProps> = ({
onDeleteClick={onDeleteClick}
/>
<NavigationPanel
nextStepName={nextStepName}
currentStep={currentStep}
setCurrentStep={setCurrentStep}
totalSteps={Object.keys(workSpaceTypes).length}

@ -6,8 +6,10 @@ import {
useTheme,
} from "@mui/material";
import BackArrowIcon from "@icons/BackArrowIcon";
import { ScreenStepsTypes } from "@/model/CropModal/CropModal";
interface Props {
nextStepName: ScreenStepsTypes;
currentStep: number;
setCurrentStep: (setp: number) => void;
totalSteps: number;
@ -16,6 +18,7 @@ interface Props {
}
export const NavigationPanel: FC<Props> = ({
nextStepName,
currentStep,
setCurrentStep,
totalSteps,
@ -26,6 +29,9 @@ export const NavigationPanel: FC<Props> = ({
const isMobile = useMediaQuery(theme.breakpoints.down(786));
const lastStep = currentStep + 1 === totalSteps;
console.log("nextStepName")
console.log(nextStepName)
const handlePrevStep = () => {
if (currentStep === 0) return;
setCurrentStep(currentStep - 1);
@ -99,10 +105,12 @@ export const NavigationPanel: FC<Props> = ({
border: "1px solid #7E2AEA",
p: "10px 19px",
width: isMobile ? "100%" : undefined,
lineHeight: "100%"
}}
>
{lastStep ?
"Сохранить редактированное" : "Далее"
"Сохранить редактированное" : nextStepName === "mobile" ?
"Настроить для мобильной версии" : nextStepName === "tablet" ? "Настроить для планшетной версии" : "Далее"
}
</Button>
</Box>