мобильная адаптация
This commit is contained in:
parent
8978081198
commit
9d8491dd6d
@ -11,7 +11,7 @@ import {
|
|||||||
Alert,
|
Alert,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
FormControlLabel,
|
FormControlLabel,
|
||||||
useTheme
|
useTheme, useMediaQuery
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import Input from "@kitUI/input";
|
import Input from "@kitUI/input";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@ -29,6 +29,7 @@ import { currencyFormatter } from "@root/utils/currencyFormatter";
|
|||||||
|
|
||||||
export default function Cart() {
|
export default function Cart() {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
const mobile = useMediaQuery(theme.breakpoints.down(400));
|
||||||
let discounts = useDiscountStore(state => state.discounts);
|
let discounts = useDiscountStore(state => state.discounts);
|
||||||
const cartData = useCartStore((store) => store.cartData);
|
const cartData = useCartStore((store) => store.cartData);
|
||||||
const tariffs = useTariffStore(state => state.tariffs);
|
const tariffs = useTariffStore(state => state.tariffs);
|
||||||
@ -84,6 +85,7 @@ export default function Cart() {
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
gap: "20px",
|
gap: "20px",
|
||||||
|
flexDirection: mobile ? "column" : undefined
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
@ -143,7 +145,7 @@ export default function Cart() {
|
|||||||
padding: "3px",
|
padding: "3px",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
ml: "auto",
|
ml: mobile ? 0 : "auto",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
Checkbox,
|
Checkbox,
|
||||||
Typography,
|
Typography,
|
||||||
FormControlLabel,
|
FormControlLabel,
|
||||||
Button,
|
Button, useMediaQuery,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import Logo from "@pages/Logo";
|
import Logo from "@pages/Logo";
|
||||||
import OutlinedInput from "@kitUI/outlinedInput";
|
import OutlinedInput from "@kitUI/outlinedInput";
|
||||||
@ -44,7 +44,7 @@ function validate(values: Values) {
|
|||||||
const SigninForm = () => {
|
const SigninForm = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const isMobile = useMediaQuery(theme.breakpoints.down(600));
|
||||||
const initialValues: Values = {
|
const initialValues: Values = {
|
||||||
email: "",
|
email: "",
|
||||||
password: "",
|
password: "",
|
||||||
@ -99,6 +99,7 @@ const SigninForm = () => {
|
|||||||
"> *": {
|
"> *": {
|
||||||
marginTop: "15px",
|
marginTop: "15px",
|
||||||
},
|
},
|
||||||
|
padding: isMobile ? "0 16px" : undefined
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Logo />
|
<Logo />
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
FormControl,
|
FormControl,
|
||||||
ListItemText,
|
ListItemText,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
Select,
|
Select,
|
||||||
SelectChangeEvent,
|
SelectChangeEvent,
|
||||||
TextField,
|
TextField, useMediaQuery, useTheme,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { MOCK_DATA_USERS } from "@root/api/roles";
|
import { MOCK_DATA_USERS } from "@root/api/roles";
|
||||||
|
|
||||||
@ -24,7 +24,8 @@ const MenuProps = {
|
|||||||
|
|
||||||
export default function CreateForm() {
|
export default function CreateForm() {
|
||||||
const [personName, setPersonName] = useState<string[]>([]);
|
const [personName, setPersonName] = useState<string[]>([]);
|
||||||
|
const theme = useTheme();
|
||||||
|
const mobile = useMediaQuery(theme.breakpoints.down(400));
|
||||||
const handleChange = (event: SelectChangeEvent<typeof personName>) => {
|
const handleChange = (event: SelectChangeEvent<typeof personName>) => {
|
||||||
const {
|
const {
|
||||||
target: { value },
|
target: { value },
|
||||||
@ -39,7 +40,7 @@ export default function CreateForm() {
|
|||||||
fullWidth
|
fullWidth
|
||||||
sx={{
|
sx={{
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
width: "400px",
|
width: mobile ? "320px" : "400px",
|
||||||
"& .MuiInputBase-root": {
|
"& .MuiInputBase-root": {
|
||||||
backgroundColor: "#F2F3F7",
|
backgroundColor: "#F2F3F7",
|
||||||
height: "48px",
|
height: "48px",
|
||||||
|
@ -1,4 +1,14 @@
|
|||||||
import { AccordionDetails, Table, TableBody, TableCell, TableHead, TableRow, Typography } from "@mui/material";
|
import {
|
||||||
|
AccordionDetails,
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableHead,
|
||||||
|
TableRow,
|
||||||
|
Typography,
|
||||||
|
useMediaQuery,
|
||||||
|
useTheme
|
||||||
|
} from "@mui/material";
|
||||||
|
|
||||||
import { CustomWrapper } from "@root/kitUI/CustomWrapper";
|
import { CustomWrapper } from "@root/kitUI/CustomWrapper";
|
||||||
|
|
||||||
@ -9,15 +19,19 @@ import { PrivilegesWrapper } from "./PrivilegiesWrapper";
|
|||||||
import theme from "../../theme";
|
import theme from "../../theme";
|
||||||
|
|
||||||
export const SettingRoles = (): JSX.Element => {
|
export const SettingRoles = (): JSX.Element => {
|
||||||
|
const theme = useTheme();
|
||||||
|
const mobile = useMediaQuery(theme.breakpoints.down(400));
|
||||||
return (
|
return (
|
||||||
<AccordionDetails sx={{ width: "890px" }}>
|
<AccordionDetails sx={{ maxWidth: "890px",
|
||||||
|
width: "100%", }}>
|
||||||
<CustomWrapper
|
<CustomWrapper
|
||||||
text="Роли"
|
text="Роли"
|
||||||
children={
|
children={
|
||||||
<>
|
<>
|
||||||
<Table
|
<Table
|
||||||
sx={{
|
sx={{
|
||||||
width: "890px",
|
maxWidth: "890px",
|
||||||
|
width: "100%",
|
||||||
border: "2px solid",
|
border: "2px solid",
|
||||||
borderColor: "gray",
|
borderColor: "gray",
|
||||||
}}
|
}}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import { GridSelectionModel } from "@mui/x-data-grid";
|
import { GridSelectionModel } from "@mui/x-data-grid";
|
||||||
import { Box, Button } from "@mui/material";
|
import {Box, Button, useMediaQuery, useTheme} from "@mui/material";
|
||||||
|
|
||||||
import { changeDiscount } from "@root/api/discounts";
|
import { changeDiscount } from "@root/api/discounts";
|
||||||
import { findDiscountsById } from "@root/stores/discounts";
|
import { findDiscountsById } from "@root/stores/discounts";
|
||||||
@ -11,6 +11,8 @@ interface Props {
|
|||||||
selectedRows: GridSelectionModel;
|
selectedRows: GridSelectionModel;
|
||||||
}
|
}
|
||||||
export default function DiscountDataGrid({ selectedRows }: Props) {
|
export default function DiscountDataGrid({ selectedRows }: Props) {
|
||||||
|
const theme = useTheme();
|
||||||
|
const mobile = useMediaQuery(theme.breakpoints.down(400));
|
||||||
const changeData = async (isActive: boolean) => {
|
const changeData = async (isActive: boolean) => {
|
||||||
let done = 0;
|
let done = 0;
|
||||||
let fatal = 0;
|
let fatal = 0;
|
||||||
@ -46,7 +48,13 @@ export default function DiscountDataGrid({ selectedRows }: Props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box width="400px" display="flex" justifyContent="space-between">
|
<Box
|
||||||
|
sx={{
|
||||||
|
width: mobile ? "250px" : "400px",
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
flexDirection: mobile ? "column" : undefined,
|
||||||
|
gap: "10px"}}>
|
||||||
<Button onClick={() => changeData(false)}>Активировать</Button>
|
<Button onClick={() => changeData(false)}>Активировать</Button>
|
||||||
<Button onClick={() => changeData(true)}>Деактивировать</Button>
|
<Button onClick={() => changeData(true)}>Деактивировать</Button>
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -187,6 +187,7 @@ export default function CreateTariff() {
|
|||||||
data-cy={`select-option-${privilege.description}`}
|
data-cy={`select-option-${privilege.description}`}
|
||||||
key={privilege.description}
|
key={privilege.description}
|
||||||
value={privilege._id}
|
value={privilege._id}
|
||||||
|
sx={{whiteSpace: "normal", wordBreak: "break-world"}}
|
||||||
>
|
>
|
||||||
{privilege.serviceKey}:{privilege.description}
|
{privilege.serviceKey}:{privilege.description}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
@ -159,7 +159,7 @@ const Users: React.FC = () => {
|
|||||||
{accordionText}
|
{accordionText}
|
||||||
</Typography>
|
</Typography>
|
||||||
</AccordionSummary>
|
</AccordionSummary>
|
||||||
<AccordionDetails>
|
<AccordionDetails sx={{overflowX: "auto"}}>
|
||||||
<Table
|
<Table
|
||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
@ -172,9 +172,9 @@ const Navigation = (props: Props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const Menu: React.FC = () => {
|
const Menu: React.FC = () => {
|
||||||
const tablet = useMediaQuery("(max-width:600px)");
|
const tablet = useMediaQuery("(max-width:900px)");
|
||||||
|
|
||||||
const mobile = useMediaQuery("(max-width:340px)");
|
const mobile = useMediaQuery("(max-width:600px)");
|
||||||
|
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const [open, setOpen] = React.useState(tablet ? false : true);
|
const [open, setOpen] = React.useState(tablet ? false : true);
|
||||||
|
Loading…
Reference in New Issue
Block a user