Merge branch 'dev' into 'staging'
Dev See merge request frontend/squiz!375
This commit is contained in:
commit
6db1e0c2bc
@ -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);
|
||||||
|
@ -53,8 +53,8 @@ export default function AvailablePrivilege() {
|
|||||||
}
|
}
|
||||||
const quizUnlimDays = getCramps(quizUnlimTime, userPrivileges?.quizUnlimTime?.created_at || "");
|
const quizUnlimDays = getCramps(quizUnlimTime, userPrivileges?.quizUnlimTime?.created_at || "");
|
||||||
const squizBadgeDays = getCramps(squizHideBadge, userPrivileges?.squizHideBadge?.created_at || "");
|
const squizBadgeDays = getCramps(squizHideBadge, userPrivileges?.squizHideBadge?.created_at || "");
|
||||||
|
console.log(userPrivileges)
|
||||||
const currentDate = moment();
|
console.log(quizUnlimTime)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
|
@ -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>
|
||||||
|
@ -5,6 +5,7 @@ import { isAxiosError } from "axios";
|
|||||||
import { makeRequest } from "@api/makeRequest";
|
import { makeRequest } from "@api/makeRequest";
|
||||||
|
|
||||||
import type { UserAccount } from "@frontend/kitui";
|
import type { UserAccount } from "@frontend/kitui";
|
||||||
|
import { setUserAccount } from "@/stores/user";
|
||||||
|
|
||||||
export const useUserAccountFetcher = <T = UserAccount>({
|
export const useUserAccountFetcher = <T = UserAccount>({
|
||||||
onError,
|
onError,
|
||||||
@ -36,7 +37,7 @@ export const useUserAccountFetcher = <T = UserAccount>({
|
|||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
devlog("User account", result);
|
devlog("User account", result);
|
||||||
onNewUserAccountRef.current(result);
|
if (result) onNewUserAccountRef.current(result);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
devlog("Error fetching user account", error);
|
devlog("Error fetching user account", error);
|
||||||
@ -44,7 +45,9 @@ export const useUserAccountFetcher = <T = UserAccount>({
|
|||||||
createUserAccount(controller.signal, url.replace("get", "create"))
|
createUserAccount(controller.signal, url.replace("get", "create"))
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
devlog("Created user account", result);
|
devlog("Created user account", result);
|
||||||
onNewUserAccountRef.current(result as T);
|
console.log("это пойдёт в стор: ")
|
||||||
|
console.log(result)
|
||||||
|
if (result) onNewUserAccountRef.current(result.created_account as T);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
if (error.response?.status === 409) return;
|
if (error.response?.status === 409) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user