Merge branch 'adaptiv-install' into dev
This commit is contained in:
commit
4c7d3b0351
@ -105,12 +105,12 @@ export const DesignFilling = ({
|
|||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
padding: "25px",
|
padding: isMobile
|
||||||
height: isMobile
|
|
||||||
? mobileSidebar
|
? mobileSidebar
|
||||||
? `calc(100vh - ${heightBar}px)`
|
? `calc(${heightBar}px - 92px) 16px 70px 16px`
|
||||||
: "calc(100vh - 127px)"
|
: "67px 16px 70px 16px"
|
||||||
: "calc(100vh - 80px)",
|
: "25px",
|
||||||
|
height: isMobile ? "100vh" : "calc(100vh - 80px)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography variant="h5" sx={{ marginBottom: "40px", color: "#333647" }}>
|
<Typography variant="h5" sx={{ marginBottom: "40px", color: "#333647" }}>
|
||||||
@ -122,7 +122,7 @@ export const DesignFilling = ({
|
|||||||
maxWidth: "796px",
|
maxWidth: "796px",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
borderRadius: "12px",
|
borderRadius: "12px",
|
||||||
height: "calc(100vh - 280px)",
|
height: "calc(100vh - 300px)",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -3,10 +3,8 @@ import { Box, useMediaQuery, useTheme, Skeleton } from "@mui/material";
|
|||||||
import { setQuizes, setCurrentStep } from "@root/quizes/actions";
|
import { setQuizes, setCurrentStep } from "@root/quizes/actions";
|
||||||
import { useCurrentQuiz } from "@root/quizes/hooks";
|
import { useCurrentQuiz } from "@root/quizes/hooks";
|
||||||
import { useQuizStore } from "@root/quizes/store";
|
import { useQuizStore } from "@root/quizes/store";
|
||||||
import Sidebar from "@ui_kit/Sidebar/Sidebar";
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { SidebarMobile } from "../../ui_kit/Sidebar/SidebarMobile";
|
|
||||||
import { cleanQuestions, setQuestions } from "@root/questions/actions";
|
import { cleanQuestions, setQuestions } from "@root/questions/actions";
|
||||||
import {
|
import {
|
||||||
updateModalInfoWhyCantCreate,
|
updateModalInfoWhyCantCreate,
|
||||||
@ -17,7 +15,6 @@ import { questionApi } from "@api/question";
|
|||||||
import { useUiTools } from "@root/uiTools/store";
|
import { useUiTools } from "@root/uiTools/store";
|
||||||
|
|
||||||
import { ConfirmLeaveModal } from "../startPage/ConfirmLeaveModal";
|
import { ConfirmLeaveModal } from "../startPage/ConfirmLeaveModal";
|
||||||
import { Header } from "@ui_kit/Header/Header";
|
|
||||||
import { DesignFilling } from "./DesignFilling";
|
import { DesignFilling } from "./DesignFilling";
|
||||||
import { createPortal } from "react-dom";
|
import { createPortal } from "react-dom";
|
||||||
import QuizPreview from "@ui_kit/QuizPreview/QuizPreview";
|
import QuizPreview from "@ui_kit/QuizPreview/QuizPreview";
|
||||||
|
@ -301,7 +301,7 @@ export default function InstallQuiz() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography variant="h5" sx={{ paddingRight: "30px" }}>
|
<Typography variant="h5" sx={{ paddingRight: "30px" }}>
|
||||||
Установка квизов на сайте
|
Установка quiz на сайте
|
||||||
</Typography>
|
</Typography>
|
||||||
<ButtonBase
|
<ButtonBase
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@ -399,9 +399,9 @@ export default function InstallQuiz() {
|
|||||||
gap: "20px",
|
gap: "20px",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography>1. Код вставки опросника</Typography>
|
<Typography>1. Код вставки quiz</Typography>
|
||||||
<Typography sx={{ color: theme.palette.grey2.main }}>
|
<Typography sx={{ color: theme.palette.grey2.main }}>
|
||||||
Установите код в то место, где должен быть опросник
|
Установите код в то место, где должен быть quiz
|
||||||
</Typography>
|
</Typography>
|
||||||
<TextField
|
<TextField
|
||||||
id="outlined-multiline-static"
|
id="outlined-multiline-static"
|
||||||
|
@ -63,10 +63,37 @@ export const CardAnswer = ({
|
|||||||
const { editQuizId } = useQuizStore();
|
const { editQuizId } = useQuizStore();
|
||||||
const { questions } = useQuestionsStore();
|
const { questions } = useQuestionsStore();
|
||||||
|
|
||||||
|
const openResults = async () => {
|
||||||
|
setIsOpen(!isOpen);
|
||||||
|
if (!isOpen) {
|
||||||
|
try {
|
||||||
|
let resAnswer = await resultApi.getAnswerList(Number(idResult));
|
||||||
|
|
||||||
|
let resAnswerOnly = resAnswer.filter((res) => res.Result !== true);
|
||||||
|
let resQuiz = resAnswer.filter((res) => res.Result === true);
|
||||||
|
setResultQuiz(resQuiz);
|
||||||
|
setResultsAnswer(resAnswerOnly);
|
||||||
|
let idResults = resQuiz[0].question_id;
|
||||||
|
let questionsResult = questions.filter(
|
||||||
|
(q) => q.backendId === idResults,
|
||||||
|
);
|
||||||
|
setQuestionsResultState(questionsResult);
|
||||||
|
console.log("тут хранятся ответы", resAnswerOnly);
|
||||||
|
} catch (nativeError) {
|
||||||
|
const error = nativeError as AxiosError;
|
||||||
|
|
||||||
|
if (error.response?.statusText === "Payment Required") {
|
||||||
|
openPrePaymentModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
obsolescenceResult(idResult, editQuizId);
|
obsolescenceResult(idResult, editQuizId);
|
||||||
|
openResults();
|
||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
borderRadius: "12px",
|
borderRadius: "12px",
|
||||||
@ -129,39 +156,7 @@ export const CardAnswer = ({
|
|||||||
>
|
>
|
||||||
{idResult}
|
{idResult}
|
||||||
</Box>
|
</Box>
|
||||||
<IconButton
|
<IconButton onClick={openResults}>
|
||||||
onClick={async () => {
|
|
||||||
setIsOpen(!isOpen);
|
|
||||||
if (!isOpen) {
|
|
||||||
try {
|
|
||||||
let resAnswer = await resultApi.getAnswerList(
|
|
||||||
Number(idResult),
|
|
||||||
);
|
|
||||||
|
|
||||||
let resAnswerOnly = resAnswer.filter(
|
|
||||||
(res) => res.Result !== true,
|
|
||||||
);
|
|
||||||
let resQuiz = resAnswer.filter(
|
|
||||||
(res) => res.Result === true,
|
|
||||||
);
|
|
||||||
setResultQuiz(resQuiz);
|
|
||||||
setResultsAnswer(resAnswerOnly);
|
|
||||||
let idResults = resQuiz[0].question_id;
|
|
||||||
let questionsResult = questions.filter(
|
|
||||||
(q) => q.backendId === idResults,
|
|
||||||
);
|
|
||||||
setQuestionsResultState(questionsResult);
|
|
||||||
console.log("тут хранятся ответы", resAnswerOnly);
|
|
||||||
} catch (nativeError) {
|
|
||||||
const error = nativeError as AxiosError;
|
|
||||||
|
|
||||||
if (error.response?.statusText === "Payment Required") {
|
|
||||||
openPrePaymentModal();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ArrowDownIcon
|
<ArrowDownIcon
|
||||||
style={{
|
style={{
|
||||||
transform: isOpen ? "rotate(180deg)" : "rotate(360deg)",
|
transform: isOpen ? "rotate(180deg)" : "rotate(360deg)",
|
||||||
|
@ -41,6 +41,7 @@ function TariffPage() {
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const token = useToken();
|
const token = useToken();
|
||||||
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
||||||
|
const isMobile = useMediaQuery(theme.breakpoints.down(600));
|
||||||
const userId = useUserStore((state) => state.userId);
|
const userId = useUserStore((state) => state.userId);
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -175,7 +176,7 @@ function TariffPage() {
|
|||||||
display: "flex",
|
display: "flex",
|
||||||
height: "80px",
|
height: "80px",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
gap: isTablet ? "20px" : "60px",
|
gap: isMobile ? "7px" : isTablet ? "20px" : "60px",
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
bgcolor: "white",
|
bgcolor: "white",
|
||||||
@ -189,7 +190,7 @@ function TariffPage() {
|
|||||||
<ArrowLeft color="black" />
|
<ArrowLeft color="black" />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Box sx={{ display: "flex", ml: "auto" }}>
|
<Box sx={{ display: "flex", ml: "auto" }}>
|
||||||
<Box sx={{ whiteSpace: "nowrap" }}>
|
<Box sx={{ whiteSpace: "nowrap" }} onClick={() => console.log(cash)}>
|
||||||
<Typography
|
<Typography
|
||||||
sx={{
|
sx={{
|
||||||
fontSize: "12px",
|
fontSize: "12px",
|
||||||
@ -199,7 +200,11 @@ function TariffPage() {
|
|||||||
>
|
>
|
||||||
Мой баланс
|
Мой баланс
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body2" color={"#7e2aea"}>
|
<Typography
|
||||||
|
variant="body2"
|
||||||
|
color={"#7e2aea"}
|
||||||
|
fontSize={isMobile ? (cash.length > 9 ? "13px" : "16px") : "16px"}
|
||||||
|
>
|
||||||
{cash}
|
{cash}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -6,6 +6,8 @@ import {
|
|||||||
Theme,
|
Theme,
|
||||||
Button,
|
Button,
|
||||||
Badge,
|
Badge,
|
||||||
|
useTheme,
|
||||||
|
useMediaQuery,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { MouseEventHandler, ReactNode } from "react";
|
import { MouseEventHandler, ReactNode } from "react";
|
||||||
|
|
||||||
@ -33,7 +35,8 @@ export default function TariffCard({
|
|||||||
discount,
|
discount,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
text = Array.isArray(text) ? text : [text];
|
text = Array.isArray(text) ? text : [text];
|
||||||
|
const theme = useTheme();
|
||||||
|
const isMobile = useMediaQuery(theme.breakpoints.down(600));
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@ -68,6 +71,7 @@ export default function TariffCard({
|
|||||||
flexWrap: "wrap",
|
flexWrap: "wrap",
|
||||||
columnGap: "10px",
|
columnGap: "10px",
|
||||||
rowGap: 0,
|
rowGap: 0,
|
||||||
|
flexDirection: isMobile ? "column-reverse" : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{price}
|
{price}
|
||||||
|
@ -95,6 +95,7 @@ export default function Main({ sidebar, header, footer, Page }: Props) {
|
|||||||
|
|
||||||
const [widthMain, setWidthMain] = useState(null);
|
const [widthMain, setWidthMain] = useState(null);
|
||||||
const [heightSidebar, setHeightSidebar] = useState(null);
|
const [heightSidebar, setHeightSidebar] = useState(null);
|
||||||
|
const [scrollDown, setScrollDown] = useState<boolean | null>(null);
|
||||||
const mainBlock = useRef(0);
|
const mainBlock = useRef(0);
|
||||||
const heightHeader = heightSidebar + 51 + 36;
|
const heightHeader = heightSidebar + 51 + 36;
|
||||||
const observer = useRef(
|
const observer = useRef(
|
||||||
@ -111,7 +112,7 @@ export default function Main({ sidebar, header, footer, Page }: Props) {
|
|||||||
if (!quizConfig) return <></>;
|
if (!quizConfig) return <></>;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header setMobileSidebar={setMobileSidebar} />
|
<Header setMobileSidebar={setMobileSidebar} scrollDown={scrollDown} />
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@ -125,6 +126,7 @@ export default function Main({ sidebar, header, footer, Page }: Props) {
|
|||||||
open={mobileSidebar}
|
open={mobileSidebar}
|
||||||
changePage={changePage}
|
changePage={changePage}
|
||||||
setHeightSitebar={setHeightSidebar}
|
setHeightSitebar={setHeightSidebar}
|
||||||
|
scrollDown={scrollDown}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Sidebar changePage={changePage} />
|
<Sidebar changePage={changePage} />
|
||||||
@ -137,9 +139,10 @@ export default function Main({ sidebar, header, footer, Page }: Props) {
|
|||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: isMobile
|
height: isMobile
|
||||||
? mobileSidebar
|
? // ? mobileSidebar
|
||||||
? `calc(100vh - ${heightHeader}px)`
|
// ? `calc(100vh - ${heightHeader}px)`
|
||||||
: "calc(100vh - 51px)"
|
// "calc(100vh - 51px)"
|
||||||
|
"100vh"
|
||||||
: "calc(100vh - 80px)",
|
: "calc(100vh - 80px)",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
@ -162,6 +165,8 @@ export default function Main({ sidebar, header, footer, Page }: Props) {
|
|||||||
widthMain={widthMain}
|
widthMain={widthMain}
|
||||||
mobileSidebar={mobileSidebar}
|
mobileSidebar={mobileSidebar}
|
||||||
heightSidebar={heightSidebar}
|
heightSidebar={heightSidebar}
|
||||||
|
scrollDown={scrollDown}
|
||||||
|
setScrollDown={setScrollDown}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
@ -182,6 +187,8 @@ export default function Main({ sidebar, header, footer, Page }: Props) {
|
|||||||
background: "#FFF",
|
background: "#FFF",
|
||||||
borderTop: "#f2f3f7 2px solid",
|
borderTop: "#f2f3f7 2px solid",
|
||||||
zIndex: 1,
|
zIndex: 1,
|
||||||
|
position: isMobile ? "fixed" : undefined,
|
||||||
|
bottom: isMobile ? 0 : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isConditionMet &&
|
{isConditionMet &&
|
||||||
|
@ -17,7 +17,7 @@ import { useQuizStore } from "@root/quizes/store";
|
|||||||
import Sidebar from "@ui_kit/Sidebar/Sidebar";
|
import Sidebar from "@ui_kit/Sidebar/Sidebar";
|
||||||
import Stepper from "@ui_kit/Stepper";
|
import Stepper from "@ui_kit/Stepper";
|
||||||
import SwitchStepPages from "@ui_kit/switchStepPages";
|
import SwitchStepPages from "@ui_kit/switchStepPages";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import { useDebouncedCallback } from "use-debounce";
|
import { useDebouncedCallback } from "use-debounce";
|
||||||
import { SidebarMobile } from "../../ui_kit/Sidebar/SidebarMobile";
|
import { SidebarMobile } from "../../ui_kit/Sidebar/SidebarMobile";
|
||||||
@ -48,6 +48,8 @@ interface Props {
|
|||||||
widthMain: number;
|
widthMain: number;
|
||||||
mobileSidebar: boolean;
|
mobileSidebar: boolean;
|
||||||
heightSidebar: number;
|
heightSidebar: number;
|
||||||
|
scrollDown: boolean;
|
||||||
|
setScrollDown: (a: boolean) => void;
|
||||||
}
|
}
|
||||||
export default function EditPage({
|
export default function EditPage({
|
||||||
openBranchingPage,
|
openBranchingPage,
|
||||||
@ -55,6 +57,8 @@ export default function EditPage({
|
|||||||
widthMain,
|
widthMain,
|
||||||
mobileSidebar,
|
mobileSidebar,
|
||||||
heightSidebar,
|
heightSidebar,
|
||||||
|
scrollDown,
|
||||||
|
setScrollDown,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const quiz = useCurrentQuiz();
|
const quiz = useCurrentQuiz();
|
||||||
const { editQuizId } = useQuizStore();
|
const { editQuizId } = useQuizStore();
|
||||||
@ -67,8 +71,9 @@ export default function EditPage({
|
|||||||
const isMobile = useMediaQuery(theme.breakpoints.down(650));
|
const isMobile = useMediaQuery(theme.breakpoints.down(650));
|
||||||
const quizConfig = quiz?.config;
|
const quizConfig = quiz?.config;
|
||||||
// const [openBranchingPage, setOpenBranchingPage] = useState<boolean>(false);
|
// const [openBranchingPage, setOpenBranchingPage] = useState<boolean>(false);
|
||||||
|
const mainBlock = useRef(0);
|
||||||
|
|
||||||
const heightBar = heightSidebar + 51 + 88 + 23;
|
const heightBar = heightSidebar + 51 + 88;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (editQuizId === null) navigate("/list");
|
if (editQuizId === null) navigate("/list");
|
||||||
}, [navigate, editQuizId]);
|
}, [navigate, editQuizId]);
|
||||||
@ -108,6 +113,17 @@ export default function EditPage({
|
|||||||
setCurrentStep(nextStep);
|
setCurrentStep(nextStep);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let lastScroll = mainBlock.current.scrollTop;
|
||||||
|
const onScroll = (e) => {
|
||||||
|
if ((mainBlock.current.scrollTop > lastScroll && !scrollDown) || null) {
|
||||||
|
setScrollDown(true);
|
||||||
|
}
|
||||||
|
if (mainBlock.current.scrollTop < lastScroll && scrollDown) {
|
||||||
|
setScrollDown(false);
|
||||||
|
}
|
||||||
|
lastScroll = mainBlock.current.scrollTop;
|
||||||
|
};
|
||||||
|
|
||||||
if (!quizConfig) return <></>;
|
if (!quizConfig) return <></>;
|
||||||
|
|
||||||
const isConditionMet =
|
const isConditionMet =
|
||||||
@ -129,19 +145,26 @@ export default function EditPage({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box
|
<Box
|
||||||
|
onScroll={onScroll}
|
||||||
|
ref={mainBlock}
|
||||||
sx={{
|
sx={{
|
||||||
padding: isMobile ? "16px 16px 20px 16px" : "25px 25px 20px 25px",
|
padding: isMobile
|
||||||
|
? mobileSidebar
|
||||||
|
? `${heightBar}px 16px 70px 16px`
|
||||||
|
: "67px 16px 70px 16px"
|
||||||
|
: "25px 25px 20px 25px",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
height: isMobile
|
height: isMobile
|
||||||
? mobileSidebar
|
? "100vh"
|
||||||
? `calc(100vh - ${heightBar}px)`
|
|
||||||
: `calc(100vh - 125px)`
|
|
||||||
: isConditionMet
|
: isConditionMet
|
||||||
? isBranchingLogic
|
? isBranchingLogic
|
||||||
? `calc(100vh - 166px)`
|
? `calc(100vh - 166px)`
|
||||||
: `calc(100vh - 186px)`
|
: `calc(100vh - 186px)`
|
||||||
: `calc(100vh - 166px)`,
|
: `calc(100vh - 166px)`,
|
||||||
boxSizing: "border-box",
|
boxSizing: "border-box",
|
||||||
|
transition: "transform 0.3s",
|
||||||
|
transform:
|
||||||
|
scrollDown && isMobile ? "translateY(-51px)" : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* Выбор текущей страницы редактирования чего-либо - находится здесь */}
|
{/* Выбор текущей страницы редактирования чего-либо - находится здесь */}
|
||||||
|
@ -817,7 +817,7 @@ export default function StartPageSettings() {
|
|||||||
quiz.config.info.site = e.target.value;
|
quiz.config.info.site = e.target.value;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
maxLength={100}
|
maxLength={2000}
|
||||||
/>
|
/>
|
||||||
<Typography
|
<Typography
|
||||||
sx={{
|
sx={{
|
||||||
|
@ -30,9 +30,10 @@ import { cleanAuthTicketData } from "@root/ticket";
|
|||||||
|
|
||||||
type HeaderProps = {
|
type HeaderProps = {
|
||||||
setMobileSidebar: (callback: (visible: boolean) => boolean) => void;
|
setMobileSidebar: (callback: (visible: boolean) => boolean) => void;
|
||||||
|
scrollDown: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Header = ({ setMobileSidebar }: HeaderProps) => {
|
export const Header = ({ setMobileSidebar, scrollDown }: HeaderProps) => {
|
||||||
const quiz = useCurrentQuiz();
|
const quiz = useCurrentQuiz();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -65,6 +66,10 @@ export const Header = ({ setMobileSidebar }: HeaderProps) => {
|
|||||||
bgcolor: isMobile ? "#333647" : "white",
|
bgcolor: isMobile ? "#333647" : "white",
|
||||||
borderBottom: "1px solid #E3E3E3",
|
borderBottom: "1px solid #E3E3E3",
|
||||||
zIndex: theme.zIndex.drawer + 1,
|
zIndex: theme.zIndex.drawer + 1,
|
||||||
|
transition: "transform 0.3s",
|
||||||
|
transform: scrollDown && isMobile ? "translateY(-51px)" : undefined,
|
||||||
|
position: isMobile ? "fixed" : undefined,
|
||||||
|
top: isMobile ? 0 : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Link to="/" style={{ display: "flex" }}>
|
<Link to="/" style={{ display: "flex" }}>
|
||||||
|
@ -48,12 +48,14 @@ interface Iprops {
|
|||||||
open: boolean;
|
open: boolean;
|
||||||
changePage: (step: number) => void;
|
changePage: (step: number) => void;
|
||||||
setHeightSitebar: any;
|
setHeightSitebar: any;
|
||||||
|
scrollDown: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SidebarMobile: FC<Iprops> = ({
|
export const SidebarMobile: FC<Iprops> = ({
|
||||||
open,
|
open,
|
||||||
changePage,
|
changePage,
|
||||||
setHeightSitebar,
|
setHeightSitebar,
|
||||||
|
scrollDown,
|
||||||
}) => {
|
}) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const isWrappSidebar = useMediaQuery(theme.breakpoints.down(400));
|
const isWrappSidebar = useMediaQuery(theme.breakpoints.down(400));
|
||||||
@ -118,7 +120,9 @@ export const SidebarMobile: FC<Iprops> = ({
|
|||||||
<Box
|
<Box
|
||||||
ref={heightSidebar}
|
ref={heightSidebar}
|
||||||
sx={{
|
sx={{
|
||||||
display: open ? "block" : "none",
|
display: open ? "flex" : "none",
|
||||||
|
flexDirection: "column",
|
||||||
|
width: "100%",
|
||||||
minHeight: "134px",
|
minHeight: "134px",
|
||||||
padding: "20px 16px 16px 16px",
|
padding: "20px 16px 16px 16px",
|
||||||
background: "#333647",
|
background: "#333647",
|
||||||
@ -126,6 +130,11 @@ export const SidebarMobile: FC<Iprops> = ({
|
|||||||
borderBottomLeftRadius: "8px",
|
borderBottomLeftRadius: "8px",
|
||||||
borderBottomRightRadius: "8px",
|
borderBottomRightRadius: "8px",
|
||||||
transitionDuration: "200ms",
|
transitionDuration: "200ms",
|
||||||
|
position: "fixed",
|
||||||
|
top: "51px",
|
||||||
|
zIndex: theme.zIndex.drawer + 1,
|
||||||
|
transition: "transform 0.3s",
|
||||||
|
transform: scrollDown ? "translateY(-200px)" : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box sx={{ display: "flex", alignItems: "center", position: "relative" }}>
|
<Box sx={{ display: "flex", alignItems: "center", position: "relative" }}>
|
||||||
|
Loading…
Reference in New Issue
Block a user