fix: quize result page

This commit is contained in:
IlyaDoronin 2023-10-16 15:57:37 +03:00
parent ba620de334
commit 4507c71ba0
2 changed files with 48 additions and 32 deletions

@ -1,4 +1,4 @@
import { Box, Typography } from "@mui/material";
import { Box, Typography, useTheme, useMediaQuery } from "@mui/material";
type Props = {
text: string;
@ -7,14 +7,20 @@ type Props = {
};
export default function CreationFullCard({ text, text2, image }: Props) {
const theme = useTheme();
const isSmallMonitor = useMediaQuery(theme.breakpoints.down(1500));
return (
<Box
sx={{
flexGrow: 1,
backgroundColor: "white",
p: "20px",
marginTop: "50px",
borderRadius: "12px",
display: "flex",
display: isSmallMonitor ? "block" : "flex",
flexDirection: isSmallMonitor ? "column" : "row",
gap: "20px",
boxShadow: `0px 100px 309px rgba(210, 208, 225, 0.24),
0px 41.7776px 129.093px rgba(210, 208, 225, 0.172525),
0px 22.3363px 69.0192px rgba(210, 208, 225, 0.143066),
@ -23,36 +29,46 @@ export default function CreationFullCard({ text, text2, image }: Props) {
0px 2.76726px 8.55082px rgba(210, 208, 225, 0.0674749)`,
}}
>
<Box sx={{ mr: "104px", position: "relative" }}>
<Typography variant="h5">Результаты квиза в зависимости от ответов</Typography>
<Typography
<Box
sx={{
color: "#4D4D4D",
mt: "20px",
mb: "33px",
width: "95%",
mr: !isSmallMonitor ? "104px" : 0,
marginBottom: "20px",
position: "relative",
}}
>
<Typography variant="h5" sx={{ marginBottom: "20px" }}>
Результаты квиза в зависимости от ответов
</Typography>
<Box
sx={{
display: "flex",
flexDirection: "column",
justifyContent: "space-between",
height: "100%",
maxHeight: isSmallMonitor ? "none" : "220px",
gap: "25px",
}}
>
<Typography sx={{ color: "#4D4D4D", width: "95%" }}>
{text}
</Typography>
<Typography
sx={{
color: "#9A9AAF",
width: "100%",
position: "absolute",
bottom: 0,
}}
>
{text2}
</Typography>
</Box>
</Box>
<img
src={image}
alt="quiz creation"
style={{
display: "block",
width: "520px",
height: "270xp",
width: isSmallMonitor ? "100%" : "auto",
maxHeight: isSmallMonitor ? "none" : "270px",
}}
/>
</Box>

@ -1,5 +1,5 @@
import { Link, useParams } from "react-router-dom";
import { Box, Button, useTheme } from "@mui/material";
import { useParams } from "react-router-dom";
import { Box, Button, Tooltip, useTheme } from "@mui/material";
import CreationFullCard from "./CreationFullCard";
import Info from "../../assets/icons/Info";
@ -21,20 +21,20 @@ export const Result = () => {
text2="Этот шаг - необязательный, квиз будет работать и без автоматических результатов."
image={image}
/>
<Box sx={{ mt: "30px", alignItems: "center" }}>
<Box sx={{ display: "flex", mt: "30px", alignItems: "center" }}>
<Button
variant="contained"
sx={{
mr: "23px",
minWidth: "258px",
}}
sx={{ mr: "15px", minWidth: "258px" }}
onClick={handleNext}
>
Создать результаты
</Button>
<Tooltip title="Посмотреть справку" placement="top">
<Box>
<Info />
</Box>
</Tooltip>
</Box>
</Box>
);
};