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