текст заглушка и размеры картинки в варианты и картинка в превью
This commit is contained in:
parent
6316a95340
commit
772796d1bd
@ -42,7 +42,7 @@ export default function QuestionsPage({
|
|||||||
const { openedModalSettingsId } = useUiTools();
|
const { openedModalSettingsId } = useUiTools();
|
||||||
const isMobile = useMediaQuery(theme.breakpoints.down(660));
|
const isMobile = useMediaQuery(theme.breakpoints.down(660));
|
||||||
const quiz = useCurrentQuiz();
|
const quiz = useCurrentQuiz();
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate();
|
||||||
const { questions } = useQuestionsStore();
|
const { questions } = useQuestionsStore();
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
updateEditSomeQuestion();
|
updateEditSomeQuestion();
|
||||||
@ -51,8 +51,6 @@ export default function QuestionsPage({
|
|||||||
const ref = useRef();
|
const ref = useRef();
|
||||||
if (!quiz) return null;
|
if (!quiz) return null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
@ -18,7 +18,11 @@ import { ResultCard, checkEmptyData } from "./cards/ResultCard";
|
|||||||
import { EmailSettingsCard } from "./cards/EmailSettingsCard";
|
import { EmailSettingsCard } from "./cards/EmailSettingsCard";
|
||||||
import { useCurrentQuiz } from "@root/quizes/hooks";
|
import { useCurrentQuiz } from "@root/quizes/hooks";
|
||||||
import { useQuestionsStore } from "@root/questions/store";
|
import { useQuestionsStore } from "@root/questions/store";
|
||||||
import { createResult, deleteQuestion, setQuestions } from "@root/questions/actions";
|
import {
|
||||||
|
createResult,
|
||||||
|
deleteQuestion,
|
||||||
|
setQuestions,
|
||||||
|
} from "@root/questions/actions";
|
||||||
import { QuizQuestionResult } from "@model/questionTypes/result";
|
import { QuizQuestionResult } from "@model/questionTypes/result";
|
||||||
|
|
||||||
import IconPlus from "@icons/IconPlus";
|
import IconPlus from "@icons/IconPlus";
|
||||||
@ -31,7 +35,7 @@ import { questionApi } from "@api/question";
|
|||||||
export const ResultSettings = () => {
|
export const ResultSettings = () => {
|
||||||
const { questions } = useQuestionsStore();
|
const { questions } = useQuestionsStore();
|
||||||
const quiz = useCurrentQuiz();
|
const quiz = useCurrentQuiz();
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate();
|
||||||
const results = useQuestionsStore().questions.filter(
|
const results = useQuestionsStore().questions.filter(
|
||||||
(q): q is QuizQuestionResult => q.type === "result",
|
(q): q is QuizQuestionResult => q.type === "result",
|
||||||
);
|
);
|
||||||
@ -59,7 +63,6 @@ export const ResultSettings = () => {
|
|||||||
[results],
|
[results],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const cnsl = results.filter((q) => q.content.usage);
|
const cnsl = results.filter((q) => q.content.usage);
|
||||||
|
|
||||||
const shouldBlock = true; // Replace this
|
const shouldBlock = true; // Replace this
|
||||||
|
|||||||
@ -221,7 +221,7 @@ export const Footer = ({
|
|||||||
const questionIndex = questions.findIndex(({ id }) => id === question.id);
|
const questionIndex = questions.findIndex(({ id }) => id === question.id);
|
||||||
|
|
||||||
const previousQuestion = questions[questionIndex - 1];
|
const previousQuestion = questions[questionIndex - 1];
|
||||||
followPreviousStep
|
followPreviousStep;
|
||||||
if (previousQuestion) {
|
if (previousQuestion) {
|
||||||
setCurrentQuestion(previousQuestion);
|
setCurrentQuestion(previousQuestion);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,7 +122,7 @@ export const Number = ({ currentQuestion }: NumberProps) => {
|
|||||||
onChange={({ target }) => {
|
onChange={({ target }) => {
|
||||||
updateAnswer(
|
updateAnswer(
|
||||||
currentQuestion.content.id,
|
currentQuestion.content.id,
|
||||||
window.Number(target.value.replace (/\D/, '')) > max
|
window.Number(target.value.replace(/\D/, "")) > max
|
||||||
? String(max)
|
? String(max)
|
||||||
: window.Number(target.value) < min
|
: window.Number(target.value) < min
|
||||||
? String(min)
|
? String(min)
|
||||||
@ -155,7 +155,7 @@ export const Number = ({ currentQuestion }: NumberProps) => {
|
|||||||
placeholder="0"
|
placeholder="0"
|
||||||
value={minRange}
|
value={minRange}
|
||||||
onChange={({ target }) => {
|
onChange={({ target }) => {
|
||||||
setMinRange(target.value.replace (/\D/, ''));
|
setMinRange(target.value.replace(/\D/, ""));
|
||||||
|
|
||||||
if (window.Number(target.value) >= window.Number(maxRange)) {
|
if (window.Number(target.value) >= window.Number(maxRange)) {
|
||||||
updateMinRangeDebounced(`${maxRange}—${maxRange}`, true);
|
updateMinRangeDebounced(`${maxRange}—${maxRange}`, true);
|
||||||
@ -181,7 +181,7 @@ export const Number = ({ currentQuestion }: NumberProps) => {
|
|||||||
placeholder="0"
|
placeholder="0"
|
||||||
value={maxRange}
|
value={maxRange}
|
||||||
onChange={({ target }) => {
|
onChange={({ target }) => {
|
||||||
setMaxRange(target.value.replace (/\D/, ''));
|
setMaxRange(target.value.replace(/\D/, ""));
|
||||||
|
|
||||||
if (window.Number(target.value) <= window.Number(minRange)) {
|
if (window.Number(target.value) <= window.Number(minRange)) {
|
||||||
updateMaxRangeDebounced(`${minRange}—${minRange}`, true);
|
updateMaxRangeDebounced(`${minRange}—${minRange}`, true);
|
||||||
|
|||||||
@ -138,8 +138,8 @@ export default function Varimg({ question, widthPreview }: Props) {
|
|||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
border: "1px solid #E3E3E3",
|
border: "1px solid #E3E3E3",
|
||||||
maxWidth: "400px",
|
width: widthPreview < 650 ? "300px" : "400px",
|
||||||
height: "400px",
|
height: widthPreview < 650 ? "300px" : "400px",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
@ -165,8 +165,8 @@ export default function Varimg({ question, widthPreview }: Props) {
|
|||||||
<Typography p={2}>
|
<Typography p={2}>
|
||||||
{selectedVariantIndex === -1
|
{selectedVariantIndex === -1
|
||||||
? widthPreview < 650
|
? widthPreview < 650
|
||||||
? "Выберите вариант ниже"
|
? question?.content.replText || "Выберите вариант ниже"
|
||||||
: "Выберите вариант"
|
: question?.content.replText || "Выберите вариант"
|
||||||
: "Картинка отсутствует"}
|
: "Картинка отсутствует"}
|
||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user