diff --git a/src/pages/Setting/CardPrivilegie.tsx b/src/pages/Setting/CardPrivilegie.tsx index 5cf5dd9..9fe3aad 100644 --- a/src/pages/Setting/CardPrivilegie.tsx +++ b/src/pages/Setting/CardPrivilegie.tsx @@ -1,6 +1,6 @@ import { KeyboardEvent, useRef, useState } from "react"; import { enqueueSnackbar } from "notistack"; -import { Box, IconButton, TextField, Tooltip, Typography } from "@mui/material"; +import {Box, IconButton, TextField, Tooltip, Typography, useMediaQuery, useTheme} from "@mui/material"; import ModeEditOutlineOutlinedIcon from "@mui/icons-material/ModeEditOutlineOutlined"; import { PrivilegeWithAmount } from "@frontend/kitui"; import { putPrivilege } from "@root/api/privilegies"; @@ -16,6 +16,8 @@ export const СardPrivilege = ({ privilege }: CardPrivilege) => { const [inputOpen, setInputOpen] = useState(false); const [inputValue, setInputValue] = useState(""); const priceRef = useRef(null); + const theme = useTheme(); + const mobile = useMediaQuery(theme.breakpoints.down(600)); const translationType = { count: "за единицу", @@ -24,6 +26,7 @@ export const СardPrivilege = ({ privilege }: CardPrivilege) => { }; const putPrivileges = async () => { + const [_, putedPrivilegeError] = await putPrivilege({ name: privilege.name, privilegeId: privilege.privilegeId, @@ -79,7 +82,7 @@ export const СardPrivilege = ({ privilege }: CardPrivilege) => { }} > - + { - + {inputOpen ? ( { onChange={(event) => setInputValue(event.target.value)} sx={{ alignItems: "center", - width: "400px", + maxWidth: "400px", + width: "100%", + marginLeft: "5px", "& .MuiInputBase-root": { backgroundColor: "#F2F3F7", height: "48px", diff --git a/src/pages/Setting/FormCreateRoles.tsx b/src/pages/Setting/FormCreateRoles.tsx index b70cbe8..900a556 100644 --- a/src/pages/Setting/FormCreateRoles.tsx +++ b/src/pages/Setting/FormCreateRoles.tsx @@ -25,7 +25,7 @@ const MenuProps = { export default function CreateForm() { const [personName, setPersonName] = useState([]); const theme = useTheme(); - const mobile = useMediaQuery(theme.breakpoints.down(400)); + const mobile = useMediaQuery(theme.breakpoints.down(600)); const handleChange = (event: SelectChangeEvent) => { const { target: { value }, @@ -40,7 +40,8 @@ export default function CreateForm() { fullWidth sx={{ alignItems: "center", - width: mobile ? "320px" : "400px", + maxWidth: "400px", + width: "100%", "& .MuiInputBase-root": { backgroundColor: "#F2F3F7", height: "48px", @@ -55,8 +56,8 @@ export default function CreateForm() { }, }} /> - - + +