fix: pages min height
This commit is contained in:
parent
a093912070
commit
394c47a938
@ -160,6 +160,7 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
|
|||||||
width: isWide && !isMobile ? "100%" : isMobile ? undefined : "530px",
|
width: isWide && !isMobile ? "100%" : isMobile ? undefined : "530px",
|
||||||
borderRadius: "4px",
|
borderRadius: "4px",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
|
minHeight: "100vh",
|
||||||
display: isWide && !isMobile ? "flex" : undefined,
|
display: isWide && !isMobile ? "flex" : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -2,7 +2,6 @@ import { useQuizData } from "@contexts/QuizDataContext";
|
|||||||
import { Box, Typography, useTheme } from "@mui/material";
|
import { Box, Typography, useTheme } from "@mui/material";
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
|
|
||||||
|
|
||||||
type FooterProps = {
|
type FooterProps = {
|
||||||
stepNumber: number | null;
|
stepNumber: number | null;
|
||||||
nextButton: ReactNode;
|
nextButton: ReactNode;
|
||||||
@ -12,7 +11,7 @@ type FooterProps = {
|
|||||||
export const Footer = ({ stepNumber, nextButton, prevButton }: FooterProps) => {
|
export const Footer = ({ stepNumber, nextButton, prevButton }: FooterProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { questions } = useQuizData();
|
const { questions } = useQuizData();
|
||||||
console.log(questions)
|
console.log(questions);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@ -20,7 +19,7 @@ export const Footer = ({ stepNumber, nextButton, prevButton }: FooterProps) => {
|
|||||||
position: "relative",
|
position: "relative",
|
||||||
padding: "15px 0",
|
padding: "15px 0",
|
||||||
borderTop: `1px solid ${theme.palette.grey[400]}`,
|
borderTop: `1px solid ${theme.palette.grey[400]}`,
|
||||||
height: '75px',
|
height: "75px",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -40,7 +39,7 @@ export const Footer = ({ stepNumber, nextButton, prevButton }: FooterProps) => {
|
|||||||
{/*):(*/}
|
{/*):(*/}
|
||||||
{/* <NameplateLogoFQDark style={{ fontSize: "34px", width:"200px", height:"auto" }} />*/}
|
{/* <NameplateLogoFQDark style={{ fontSize: "34px", width:"200px", height:"auto" }} />*/}
|
||||||
{/*)}*/}
|
{/*)}*/}
|
||||||
{stepNumber !== null &&
|
{stepNumber !== null && (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@ -68,10 +67,10 @@ export const Footer = ({ stepNumber, nextButton, prevButton }: FooterProps) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Typography>Из</Typography>
|
<Typography>Из</Typography>
|
||||||
<Typography sx={{ fontWeight: "bold" }}>
|
<Typography sx={{ fontWeight: "bold" }}>
|
||||||
{questions.filter(q => q.type !== "result").length}
|
{questions.filter((q) => q.type !== "result").length}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
}
|
)}
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
@ -37,33 +37,45 @@ export const Question = ({
|
|||||||
}: Props) => {
|
}: Props) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { settings } = useQuizData();
|
const { settings } = useQuizData();
|
||||||
console.log(currentQuestionStepNumber)
|
console.log(currentQuestionStepNumber);
|
||||||
return (
|
return (
|
||||||
<Box sx={{
|
<Box
|
||||||
|
sx={{
|
||||||
backgroundColor: theme.palette.background.default,
|
backgroundColor: theme.palette.background.default,
|
||||||
height: "100%",
|
height: "100%",
|
||||||
}}>
|
}}
|
||||||
<Box sx={{
|
>
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
height: "calc(100% - 75px)",
|
height: "calc(100% - 75px)",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
minHeight: "calc(100vh - 75px)",
|
||||||
maxWidth: "1440px",
|
maxWidth: "1440px",
|
||||||
padding: "40px 25px 20px",
|
padding: "40px 25px 20px",
|
||||||
margin: "0 auto",
|
margin: "0 auto",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
justifyContent: "space-between"
|
justifyContent: "space-between",
|
||||||
}}>
|
}}
|
||||||
<QuestionByType key={currentQuestion.id} question={currentQuestion} stepNumber={currentQuestionStepNumber} />
|
>
|
||||||
|
<QuestionByType
|
||||||
|
key={currentQuestion.id}
|
||||||
|
question={currentQuestion}
|
||||||
|
stepNumber={currentQuestionStepNumber}
|
||||||
|
/>
|
||||||
{quizThemes[settings.cfg.theme].isLight ? (
|
{quizThemes[settings.cfg.theme].isLight ? (
|
||||||
<Link target={"_blank"} href={"https://quiz.pena.digital"}>
|
<Link target={"_blank"} href={"https://quiz.pena.digital"}>
|
||||||
<NameplateLogoFQ style={{ fontSize: "34px", width: "200px", height: "auto" }} />
|
<NameplateLogoFQ
|
||||||
|
style={{ fontSize: "34px", width: "200px", height: "auto" }}
|
||||||
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<Link target={"_blank"} href={"https://quiz.pena.digital"}>
|
<Link target={"_blank"} href={"https://quiz.pena.digital"}>
|
||||||
<NameplateLogoFQDark style={{ fontSize: "34px", width: "200px", height: "auto" }} />
|
<NameplateLogoFQDark
|
||||||
|
style={{ fontSize: "34px", width: "200px", height: "auto" }}
|
||||||
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Footer
|
<Footer
|
||||||
@ -75,22 +87,37 @@ export const Question = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
function QuestionByType({ question, stepNumber }: {
|
function QuestionByType({
|
||||||
|
question,
|
||||||
|
stepNumber,
|
||||||
|
}: {
|
||||||
question: RealTypedQuizQuestion;
|
question: RealTypedQuizQuestion;
|
||||||
stepNumber: number | null;
|
stepNumber: number | null;
|
||||||
}) {
|
}) {
|
||||||
switch (question.type) {
|
switch (question.type) {
|
||||||
case "variant": return <Variant currentQuestion={question} />;
|
case "variant":
|
||||||
case "images": return <Images currentQuestion={question} />;
|
return <Variant currentQuestion={question} />;
|
||||||
case "varimg": return <Varimg currentQuestion={question} />;
|
case "images":
|
||||||
case "emoji": return <Emoji currentQuestion={question} />;
|
return <Images currentQuestion={question} />;
|
||||||
case "text": return <Text currentQuestion={question} stepNumber={stepNumber}/>;
|
case "varimg":
|
||||||
case "select": return <Select currentQuestion={question} />;
|
return <Varimg currentQuestion={question} />;
|
||||||
case "date": return <Date currentQuestion={question} />;
|
case "emoji":
|
||||||
case "number": return <Number currentQuestion={question} />;
|
return <Emoji currentQuestion={question} />;
|
||||||
case "file": return <File currentQuestion={question} />;
|
case "text":
|
||||||
case "page": return <Page currentQuestion={question} />;
|
return <Text currentQuestion={question} stepNumber={stepNumber} />;
|
||||||
case "rating": return <Rating currentQuestion={question} />;
|
case "select":
|
||||||
default: notReachable(question);
|
return <Select currentQuestion={question} />;
|
||||||
|
case "date":
|
||||||
|
return <Date currentQuestion={question} />;
|
||||||
|
case "number":
|
||||||
|
return <Number currentQuestion={question} />;
|
||||||
|
case "file":
|
||||||
|
return <File currentQuestion={question} />;
|
||||||
|
case "page":
|
||||||
|
return <Page currentQuestion={question} />;
|
||||||
|
case "rating":
|
||||||
|
return <Rating currentQuestion={question} />;
|
||||||
|
default:
|
||||||
|
notReachable(question);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ export const ResultForm = ({ resultQuestion }: ResultFormProps) => {
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
|
minHeight: "100vh",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
pt: "28px",
|
pt: "28px",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
|
Loading…
Reference in New Issue
Block a user