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