diff --git a/src/pages/Landing/DesktopQuizCard.tsx b/src/pages/Landing/DesktopQuizCard.tsx new file mode 100644 index 00000000..1cee68bc --- /dev/null +++ b/src/pages/Landing/DesktopQuizCard.tsx @@ -0,0 +1,89 @@ +import { Box, Fade, Typography } from "@mui/material"; +import { FC } from "react"; + +interface Iprops { + isOpen: boolean; + header: string; + image: string; + text: string; +} + +export const DesktopQuizCard: FC = ({ + isOpen, + header, + image, + text, +}) => { + return ( + + + + + {header} + + + + {text} + + + + + + + + + ); +}; diff --git a/src/pages/Landing/HowToUse.tsx b/src/pages/Landing/HowToUse.tsx index 627d31b5..4fd99ec1 100644 --- a/src/pages/Landing/HowToUse.tsx +++ b/src/pages/Landing/HowToUse.tsx @@ -1,6 +1,6 @@ import React, { useState } from "react"; import Box from "@mui/material/Box"; -import { Typography, useMediaQuery, useTheme } from "@mui/material"; +import { Fade, Typography, Zoom, useMediaQuery, useTheme } from "@mui/material"; import SectionStyled from "./SectionStyled"; import Link from "@mui/material/Link"; import { styled } from "@mui/material/styles"; @@ -20,6 +20,8 @@ import { PieСhartIcon } from "@icons/PieСhartIcon"; import { SegmentationIcon } from "@icons/SegmentationIcon"; import { TestingIcon } from "@icons/TestingIcon"; import { EcommerceIcon } from "@icons/EcommerceIcon"; +import { DesktopQuizCard } from "./DesktopQuizCard"; +import { MobileQuizCard } from "./MobileQuizCard"; // const BoxUse = styled('div')(({ theme }) => ({ // [theme.breakpoints.down('md')]: { @@ -163,12 +165,16 @@ export default function Component() { const [task, setTask] = useState< "research" | "segmentation" | "testing" | "eсommerce" >("research"); + const [open, setOpen] = useState(false); return ( - - - - - - - - + {!isTablet && ( + + + + + + + )} + + {isTablet ? ( - - {businessTasks[task].header} - - - - {businessTasks[task].text} - - - - - + } + /> + + + } + /> + + } + /> + + } /> - + ) : ( + <> + + + + + + + + + )} ); diff --git a/src/pages/Landing/MobileQuizCard.tsx b/src/pages/Landing/MobileQuizCard.tsx new file mode 100644 index 00000000..d72f0cfe --- /dev/null +++ b/src/pages/Landing/MobileQuizCard.tsx @@ -0,0 +1,131 @@ +import { + Box, + Slide, + Typography, + useMediaQuery, + useTheme, + Zoom, +} from "@mui/material"; +import { FC, ReactNode, useRef, useState } from "react"; + +interface Iprops { + header: string; + image: string; + text: string; + textIcon: string; + icon: ReactNode; +} + +export const MobileQuizCard: FC = ({ + header, + image, + text, + icon, + textIcon, +}) => { + const [isOpen, setIsOpen] = useState(false); + const containerRef = useRef(null); + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down(600)); + + const handleChange = () => { + setIsOpen((prev) => !prev); + }; + + return ( + + + + {icon} + + {textIcon} + + {isOpen && ( + + + + {header} + + + + {text} + + + + + + + + )} + + ); +};