From 5b364eda977963cff43ba2b6b29cb20a33d1d52f Mon Sep 17 00:00:00 2001 From: ArtChaos189 Date: Tue, 9 Jan 2024 14:34:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B0=D0=B4=D0=B0=D0=BF=D1=82=D0=B8=D0=B2=20?= =?UTF-8?q?=D0=BA=D0=B0=D1=80=D1=82=D0=BE=D1=87=D0=B5=D0=BA=20=D0=BE=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=81=D0=BD=D0=B8=D0=BA=D0=B0=20,=20=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=BC=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Landing/DesktopQuizCard.tsx | 89 +++++ src/pages/Landing/HowToUse.tsx | 478 ++++++++++++++------------ src/pages/Landing/MobileQuizCard.tsx | 131 +++++++ 3 files changed, 477 insertions(+), 221 deletions(-) create mode 100644 src/pages/Landing/DesktopQuizCard.tsx create mode 100644 src/pages/Landing/MobileQuizCard.tsx 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} + + + + + + + + )} + + ); +};