меню в хедере скроллится, меню исправлено
This commit is contained in:
parent
fbb6025512
commit
65db81af2d
@ -211,7 +211,7 @@ export default function GenderAndAgeSelector({ handleAdd }: GenderAndAgeSelector
|
|||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
onClick={addItem}
|
onClick={addItem}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
disabled={!isFormValid}
|
disabled={!isFormValid}
|
||||||
sx={{
|
sx={{
|
||||||
|
@ -31,6 +31,7 @@ export default function MenuItem({
|
|||||||
px: 0,
|
px: 0,
|
||||||
pt: "5px",
|
pt: "5px",
|
||||||
pb: "3px",
|
pb: "3px",
|
||||||
|
whiteSpace: "break-spaces"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ListItemButton
|
<ListItemButton
|
||||||
|
@ -4,7 +4,7 @@ import PencilCircleIcon from "@icons/PencilCircleIcon";
|
|||||||
import PuzzlePieceIcon from "@icons/PuzzlePieceIcon";
|
import PuzzlePieceIcon from "@icons/PuzzlePieceIcon";
|
||||||
import TagIcon from "@icons/TagIcon";
|
import TagIcon from "@icons/TagIcon";
|
||||||
import { quizSetupSteps } from "@model/quizSettings";
|
import { quizSetupSteps } from "@model/quizSettings";
|
||||||
import { Box, IconButton, List, Typography, useTheme } from "@mui/material";
|
import { Box, IconButton, List, Typography, useMediaQuery, useTheme } from "@mui/material";
|
||||||
import { useQuizStore } from "@root/quizes/store";
|
import { useQuizStore } from "@root/quizes/store";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import MenuItem from "../MenuItem";
|
import MenuItem from "../MenuItem";
|
||||||
@ -32,6 +32,7 @@ export default function Sidebar({ changePage, disableCollapse }: SidebarProps) {
|
|||||||
const currentStep = useQuizStore((state) => state.currentStep);
|
const currentStep = useQuizStore((state) => state.currentStep);
|
||||||
const quiz = useCurrentQuiz();
|
const quiz = useCurrentQuiz();
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
|
const isMobile = useMediaQuery(theme.breakpoints.down(650));
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const changeMenuItem = (index: number) => {
|
const changeMenuItem = (index: number) => {
|
||||||
@ -48,17 +49,18 @@ export default function Sidebar({ changePage, disableCollapse }: SidebarProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
|
id="Sidebar"
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor: theme.palette.lightPurple.main,
|
backgroundColor: theme.palette.lightPurple.main,
|
||||||
minWidth: isMenuCollapsed ? "80px" : "230px",
|
minWidth: isMenuCollapsed ? "80px" : "230px",
|
||||||
width: isMenuCollapsed ? "80px" : "230px",
|
width: isMenuCollapsed ? "80px" : "230px",
|
||||||
height: "calc(100vh - 80px)",
|
height: isMobile ? "100%" : "calc(100vh - 80px)",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
py: "19px",
|
py: "19px",
|
||||||
transitionProperty: "width, min-width",
|
transitionProperty: "width, min-width",
|
||||||
transitionDuration: "200ms",
|
transitionDuration: "200ms",
|
||||||
overflow: "hidden",
|
overflow: "auto",
|
||||||
whiteSpace: "nowrap",
|
whiteSpace: "nowrap",
|
||||||
boxSizing: "border-box",
|
boxSizing: "border-box",
|
||||||
zIndex: 1,
|
zIndex: 1,
|
||||||
@ -72,6 +74,7 @@ export default function Sidebar({ changePage, disableCollapse }: SidebarProps) {
|
|||||||
mb: isMenuCollapsed ? "5px" : undefined,
|
mb: isMenuCollapsed ? "5px" : undefined,
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: isMenuCollapsed ? "center" : undefined,
|
justifyContent: isMenuCollapsed ? "center" : undefined,
|
||||||
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{!isMenuCollapsed && (
|
{!isMenuCollapsed && (
|
||||||
@ -100,7 +103,7 @@ export default function Sidebar({ changePage, disableCollapse }: SidebarProps) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<List disablePadding>
|
<List disablePadding id="momobibilele">
|
||||||
{quizSetupSteps.map((menuItem, index) => {
|
{quizSetupSteps.map((menuItem, index) => {
|
||||||
const Icon = menuItem.sidebarIcon;
|
const Icon = menuItem.sidebarIcon;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ export const SidebarModal = ({
|
|||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
sx={{
|
sx={{
|
||||||
outline: "none",
|
outline: "none",
|
||||||
overflow: "hidden",
|
overflow: "auto",
|
||||||
maxWidth: "230px",
|
maxWidth: "230px",
|
||||||
maxHeight: "400px",
|
maxHeight: "400px",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
Loading…
Reference in New Issue
Block a user