удаление безтипового вопроса, ссылочка в нижнем баре
This commit is contained in:
parent
5483b71b7d
commit
ece889116d
@ -193,7 +193,8 @@ export default function InstallQuiz() {
|
|||||||
<TextField
|
<TextField
|
||||||
disabled
|
disabled
|
||||||
id={"inputLinkone"}
|
id={"inputLinkone"}
|
||||||
value="https://pena.com/"
|
value="https://hbpn.link/"
|
||||||
|
// value="https://pena.com/"
|
||||||
sx={{
|
sx={{
|
||||||
"& .css-1d3z3hw-MuiOutlinedInput-notchedOutline": {
|
"& .css-1d3z3hw-MuiOutlinedInput-notchedOutline": {
|
||||||
border: "none",
|
border: "none",
|
||||||
|
@ -302,7 +302,8 @@ export default function QuestionsPageCard({ question, draggableProps, isDragging
|
|||||||
margin: "0 5px 0 10px",
|
margin: "0 5px 0 10px",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if(question.content.rule.parentId.length !== 0) {
|
if (question.type === null) deleteQuestion(question.id)
|
||||||
|
if(question?.content?.rule.parentId.length !== 0) {
|
||||||
setOpenDelete(true)
|
setOpenDelete(true)
|
||||||
} else {
|
} else {
|
||||||
deleteQuestionWithTimeout(question.id, deleteFn);
|
deleteQuestionWithTimeout(question.id, deleteFn);
|
||||||
|
@ -154,9 +154,7 @@ const Inputs = () => {
|
|||||||
if (FC.used) someUsed.push(<CustomInput title={FC.innerText || data.defaultText} desc={FC.text || data.defaultTitle} Icon={data.icon} />)
|
if (FC.used) someUsed.push(<CustomInput title={FC.innerText || data.defaultText} desc={FC.text || data.defaultTitle} Icon={data.icon} />)
|
||||||
return <CustomInput title={FC.innerText || data.defaultText} desc={FC.text || data.defaultTitle} Icon={data.icon} />
|
return <CustomInput title={FC.innerText || data.defaultText} desc={FC.text || data.defaultTitle} Icon={data.icon} />
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(someUsed)
|
|
||||||
console.log(Icons)
|
|
||||||
if (someUsed.length) {
|
if (someUsed.length) {
|
||||||
return <>{someUsed}</>
|
return <>{someUsed}</>
|
||||||
} else {
|
} else {
|
||||||
|
@ -148,6 +148,8 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh
|
|||||||
};
|
};
|
||||||
|
|
||||||
const followNextStep = () => {
|
const followNextStep = () => {
|
||||||
|
|
||||||
|
|
||||||
if (linear) {
|
if (linear) {
|
||||||
const questionIndex = questions.findIndex(({ id }) => id === question.id);
|
const questionIndex = questions.findIndex(({ id }) => id === question.id);
|
||||||
const nextQuestion = questions[questionIndex + 1];
|
const nextQuestion = questions[questionIndex + 1];
|
||||||
@ -171,6 +173,7 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh
|
|||||||
if (nextQuestionId) {
|
if (nextQuestionId) {
|
||||||
const nextQuestion = getQuestionByContentId(nextQuestionId);
|
const nextQuestion = getQuestionByContentId(nextQuestionId);
|
||||||
|
|
||||||
|
console.log(nextQuestion);
|
||||||
if (nextQuestion?.type && nextQuestion.type !== "result") {
|
if (nextQuestion?.type && nextQuestion.type !== "result") {
|
||||||
setCurrentQuestion(nextQuestion);
|
setCurrentQuestion(nextQuestion);
|
||||||
return;
|
return;
|
||||||
@ -182,7 +185,7 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh
|
|||||||
if (nextQuestion?.type && nextQuestion.type !== "result") {
|
if (nextQuestion?.type && nextQuestion.type !== "result") {
|
||||||
setCurrentQuestion(nextQuestion);
|
setCurrentQuestion(nextQuestion);
|
||||||
} else {
|
} else {
|
||||||
showResult();
|
showResult(nextQuestion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -43,8 +43,7 @@ const QUESTIONS_MAP: any = {
|
|||||||
|
|
||||||
export const Question = ({ questions }: QuestionProps) => {
|
export const Question = ({ questions }: QuestionProps) => {
|
||||||
const quiz = useCurrentQuiz();
|
const quiz = useCurrentQuiz();
|
||||||
const [currentQuestion, setCurrentQuestion] =
|
const [currentQuestion, setCurrentQuestion] = useState<AnyTypedQuizQuestion>();
|
||||||
useState<AnyTypedQuizQuestion>();
|
|
||||||
const [showContactForm, setShowContactForm] = useState<boolean>(false);
|
const [showContactForm, setShowContactForm] = useState<boolean>(false);
|
||||||
const [showResultForm, setShowResultForm] = useState<boolean>(false);
|
const [showResultForm, setShowResultForm] = useState<boolean>(false);
|
||||||
|
|
||||||
@ -62,8 +61,7 @@ export const Question = ({ questions }: QuestionProps) => {
|
|||||||
|
|
||||||
if (!currentQuestion) return <>не смог отобразить вопрос</>;
|
if (!currentQuestion) return <>не смог отобразить вопрос</>;
|
||||||
|
|
||||||
const QuestionComponent =
|
const QuestionComponent = QUESTIONS_MAP[currentQuestion.type as Exclude<QuestionType, "nonselected">];
|
||||||
QUESTIONS_MAP[currentQuestion.type as Exclude<QuestionType, "nonselected">];
|
|
||||||
|
|
||||||
console.log("showResultForm " , showResultForm)
|
console.log("showResultForm " , showResultForm)
|
||||||
return (
|
return (
|
||||||
|
@ -351,6 +351,14 @@ export default function EditPage() {
|
|||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
>{quiz?.status === "start" ? "Стоп" : "Старт"}</Button>
|
>{quiz?.status === "start" ? "Стоп" : "Старт"}</Button>
|
||||||
|
|
||||||
|
{quiz?.status === "start" && <Box
|
||||||
|
component={Link}
|
||||||
|
sx={{
|
||||||
|
color: "#7e2aea",
|
||||||
|
fontSize: "14px"
|
||||||
|
}}
|
||||||
|
target="_blank" to={"https://hbpn.link/" + quiz.qid}>https://hbpn.link/{quiz.qid}</Box> }
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
|
Loading…
Reference in New Issue
Block a user