2023-08-23 13:24:47 +00:00
|
|
|
|
import {
|
|
|
|
|
IconButton,
|
|
|
|
|
Box,
|
|
|
|
|
Typography,
|
|
|
|
|
useMediaQuery,
|
|
|
|
|
useTheme,
|
|
|
|
|
} from "@mui/material";
|
2023-07-25 22:31:04 +00:00
|
|
|
|
import SectionWrapper from "../../components/SectionWrapper";
|
|
|
|
|
import AccordionWrapper from "./AccordionWrapper";
|
|
|
|
|
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
2023-08-16 14:03:45 +00:00
|
|
|
|
import { useHistoryTracker } from "@root/utils/hooks/useHistoryTracker";
|
2023-08-18 16:39:29 +00:00
|
|
|
|
import { useCart } from "@root/utils/hooks/useCart";
|
|
|
|
|
import SaveWrapper from "./SaveWrapper";
|
2023-07-25 22:31:04 +00:00
|
|
|
|
|
|
|
|
|
export default function Faq() {
|
|
|
|
|
const theme = useTheme();
|
|
|
|
|
const upMd = useMediaQuery(theme.breakpoints.up("md"));
|
2023-08-23 13:24:47 +00:00
|
|
|
|
const isMobile = useMediaQuery(theme.breakpoints.down(550));
|
2023-08-18 16:39:29 +00:00
|
|
|
|
const cart = useCart();
|
2023-07-25 22:31:04 +00:00
|
|
|
|
|
2023-08-16 14:03:45 +00:00
|
|
|
|
const handleCustomBackNavigation = useHistoryTracker();
|
|
|
|
|
|
2023-08-18 16:39:29 +00:00
|
|
|
|
console.log(cart);
|
|
|
|
|
|
2023-07-25 22:31:04 +00:00
|
|
|
|
return (
|
|
|
|
|
<SectionWrapper
|
|
|
|
|
maxWidth="lg"
|
|
|
|
|
sx={{
|
|
|
|
|
mt: upMd ? "25px" : "20px",
|
|
|
|
|
mb: upMd ? "70px" : "37px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
mt: "20px",
|
|
|
|
|
mb: upMd ? "40px" : "20px",
|
|
|
|
|
display: "flex",
|
2023-08-23 13:24:47 +00:00
|
|
|
|
alignItems: "center",
|
2023-07-25 22:31:04 +00:00
|
|
|
|
gap: "10px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{!upMd && (
|
2023-08-23 13:24:47 +00:00
|
|
|
|
<IconButton
|
|
|
|
|
onClick={handleCustomBackNavigation}
|
|
|
|
|
sx={{ p: 0, height: "28px", width: "28px", color: "black" }}
|
|
|
|
|
>
|
2023-07-25 22:31:04 +00:00
|
|
|
|
<ArrowBackIcon />
|
|
|
|
|
</IconButton>
|
|
|
|
|
)}
|
2023-08-23 13:24:47 +00:00
|
|
|
|
<Typography
|
|
|
|
|
sx={{
|
|
|
|
|
fontSize: isMobile ? "24px" : "36px",
|
|
|
|
|
fontWeight: "500",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
Сохраненные тарифы
|
|
|
|
|
</Typography>
|
2023-07-25 22:31:04 +00:00
|
|
|
|
</Box>
|
|
|
|
|
<Box mt={upMd ? "27px" : "10px"}>
|
2023-08-18 16:39:29 +00:00
|
|
|
|
{cart.services.map(({ serviceKey, tariffs }) =>
|
|
|
|
|
serviceKey === "custom"
|
2023-08-23 13:24:47 +00:00
|
|
|
|
? tariffs.map(({ privileges, name }) => (
|
|
|
|
|
<SaveWrapper name={name} content={privileges} />
|
|
|
|
|
))
|
2023-08-18 16:39:29 +00:00
|
|
|
|
: null
|
|
|
|
|
)}
|
2023-07-25 22:31:04 +00:00
|
|
|
|
</Box>
|
|
|
|
|
</SectionWrapper>
|
|
|
|
|
);
|
|
|
|
|
}
|