fix: ButtonsOptionsForm
This commit is contained in:
parent
7b052ddd96
commit
b3b4947a6c
@ -1,5 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Box, IconButton, useTheme } from "@mui/material";
|
import { Box, IconButton, useTheme, useMediaQuery } from "@mui/material";
|
||||||
import MiniButtonSetting from "@ui_kit/MiniButtonSetting";
|
import MiniButtonSetting from "@ui_kit/MiniButtonSetting";
|
||||||
import SettingIcon from "@icons/questionsPage/settingIcon";
|
import SettingIcon from "@icons/questionsPage/settingIcon";
|
||||||
import Branching from "@icons/questionsPage/branching";
|
import Branching from "@icons/questionsPage/branching";
|
||||||
@ -15,20 +15,39 @@ interface Props {
|
|||||||
|
|
||||||
export default function ButtonsOptionsForm({ SSHC, switchState }: Props) {
|
export default function ButtonsOptionsForm({ SSHC, switchState }: Props) {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
const isTablet = useMediaQuery(theme.breakpoints.down(800));
|
||||||
|
|
||||||
const buttonSetting: { icon: JSX.Element; title: string; value: string }[] = [
|
const buttonSetting: { icon: JSX.Element; title: string; value: string }[] = [
|
||||||
{
|
{
|
||||||
icon: <SettingIcon color={switchState === "setting" ? "#ffffff" : theme.palette.grey3.main} />,
|
icon: (
|
||||||
|
<SettingIcon
|
||||||
|
color={
|
||||||
|
switchState === "setting" ? "#ffffff" : theme.palette.grey3.main
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
title: "Настройки",
|
title: "Настройки",
|
||||||
value: "setting",
|
value: "setting",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: <Branching color={switchState === "branching" ? "#ffffff" : theme.palette.grey3.main} />,
|
icon: (
|
||||||
|
<Branching
|
||||||
|
color={
|
||||||
|
switchState === "branching" ? "#ffffff" : theme.palette.grey3.main
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
title: "Ветвление",
|
title: "Ветвление",
|
||||||
value: "branching",
|
value: "branching",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: <StarIconPoints color={switchState === "points" ? "#ffffff" : theme.palette.grey3.main} />,
|
icon: (
|
||||||
|
<StarIconPoints
|
||||||
|
color={
|
||||||
|
switchState === "points" ? "#ffffff" : theme.palette.grey3.main
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
title: "Баллы",
|
title: "Баллы",
|
||||||
value: "points",
|
value: "points",
|
||||||
},
|
},
|
||||||
@ -47,6 +66,7 @@ export default function ButtonsOptionsForm({ SSHC, switchState }: Props) {
|
|||||||
sx={{
|
sx={{
|
||||||
padding: "20px",
|
padding: "20px",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
flexWrap: "wrap",
|
||||||
gap: "10px",
|
gap: "10px",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -57,18 +77,23 @@ export default function ButtonsOptionsForm({ SSHC, switchState }: Props) {
|
|||||||
SSHC(value);
|
SSHC(value);
|
||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor: switchState === value ? theme.palette.brightPurple.main : "transparent",
|
backgroundColor:
|
||||||
color: switchState === value ? "#ffffff" : theme.palette.grey3.main,
|
switchState === value
|
||||||
|
? theme.palette.brightPurple.main
|
||||||
|
: "transparent",
|
||||||
|
color:
|
||||||
|
switchState === value ? "#ffffff" : theme.palette.grey3.main,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
{title}
|
{!isTablet && title}
|
||||||
</MiniButtonSetting>
|
</MiniButtonSetting>
|
||||||
))}
|
))}
|
||||||
</Box>
|
</Box>
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
padding: "20px",
|
padding: "20px",
|
||||||
|
display: "flex",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<IconButton sx={{ borderRadius: "6px", padding: "2px" }}>
|
<IconButton sx={{ borderRadius: "6px", padding: "2px" }}>
|
||||||
|
|||||||
@ -31,10 +31,12 @@ export const DescriptionForm = () => {
|
|||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
overflow: "hidden",
|
||||||
maxWidth: "796px",
|
maxWidth: "796px",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
bgcolor: "#FFFFFF",
|
bgcolor: "#FFFFFF",
|
||||||
borderRadius: "12px",
|
borderRadius: "12px",
|
||||||
|
boxShadow: "0px 10px 30px #e7e7e7",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box sx={{ p: "0 20px", pt: "30px" }}>
|
<Box sx={{ p: "0 20px", pt: "30px" }}>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Box, Typography, useTheme } from "@mui/material";
|
import { Box, Typography, useTheme, useMediaQuery } from "@mui/material";
|
||||||
|
|
||||||
import AddImage from "@icons/questionsPage/addImage";
|
import AddImage from "@icons/questionsPage/addImage";
|
||||||
import AddVideofile from "@icons/questionsPage/addVideofile";
|
import AddVideofile from "@icons/questionsPage/addVideofile";
|
||||||
@ -7,11 +7,20 @@ import { CropModal } from "@ui_kit/Modal/CropModal";
|
|||||||
|
|
||||||
export default function ImageAndVideoButtons() {
|
export default function ImageAndVideoButtons() {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
const isMobile = useMediaQuery(theme.breakpoints.down(400));
|
||||||
|
|
||||||
const [opened, setOpened] = useState<boolean>(false);
|
const [opened, setOpened] = useState<boolean>(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: "flex", alignItems: "center", gap: "12px", mt: "20px", mb: "20px" }}>
|
<Box
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: "12px",
|
||||||
|
mt: "20px",
|
||||||
|
mb: "20px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<AddImage onClick={() => setOpened(true)} />
|
<AddImage onClick={() => setOpened(true)} />
|
||||||
<CropModal opened={opened} onClose={() => setOpened(false)} />
|
<CropModal opened={opened} onClose={() => setOpened(false)} />
|
||||||
<Typography
|
<Typography
|
||||||
@ -22,7 +31,7 @@ export default function ImageAndVideoButtons() {
|
|||||||
color: theme.palette.grey2.main,
|
color: theme.palette.grey2.main,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Изображение
|
{!isMobile && "Изображение"}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography> или</Typography>
|
<Typography> или</Typography>
|
||||||
<AddVideofile />
|
<AddVideofile />
|
||||||
@ -34,7 +43,7 @@ export default function ImageAndVideoButtons() {
|
|||||||
color: theme.palette.grey2.main,
|
color: theme.palette.grey2.main,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Видео
|
{!isMobile && "Видео"}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user