tariffs save fix

This commit is contained in:
ArtChaos189 2023-08-21 18:58:48 +03:00 committed by Nastya
parent 15838c02a2
commit df06262ea8
4 changed files with 103 additions and 105 deletions

@ -68,19 +68,12 @@ export default function TotalPrice({
flexDirection: "column",
}}
>
<Typography
sx={{
mb: "18px",
fontSize: isMobile ? "24px" : "36px",
fontWeight: "500",
}}
>
<Typography variant="h4" mb={upMd ? "18px" : "30px"}>
Итоговая цена
</Typography>
<Typography color={theme.palette.gray.dark}>
<Typography color={theme.palette.gray.main}>
Текст-заполнитель это текст, который имеет Текст-заполнитель это текст, который имеет Текст-заполнитель
это текст, который имеет Текст-заполнитель это текст, который имеет Текст-заполнитель
</Typography>
</Box>
<Box

@ -60,11 +60,7 @@ export default function Faq() {
</Box>
<Box mt={upMd ? "27px" : "10px"}>
{cart.services.map(({ serviceKey, tariffs }) =>
serviceKey === "custom"
? tariffs.map(({ privileges, name }) => (
<SaveWrapper name={name} content={privileges} />
))
: null
serviceKey === "custom" ? <SaveWrapper content={tariffs} /> : null
)}
</Box>
</SectionWrapper>

@ -1,4 +1,5 @@
import { Box, Typography, Tooltip, SxProps, Theme, Button } from "@mui/material";
import { Box, Typography, Tooltip, SxProps, Theme, useTheme } from "@mui/material";
import CustomButton from "@components/CustomButton";
import { MouseEventHandler, ReactNode } from "react";
import { cardShadow } from "@root/utils/theme";
@ -16,6 +17,8 @@ interface Props {
}
export default function TariffCard({ icon, headerText, text, sx, price, buttonProps }: Props) {
const theme = useTheme();
text = Array.isArray(text) ? text : [text];
return (
@ -91,14 +94,18 @@ export default function TariffCard({ icon, headerText, text, sx, price, buttonPr
</Box>
</Tooltip>
{buttonProps && (
<Button
<CustomButton
onClick={buttonProps.onClick}
variant="pena-outlined-purple"
variant="outlined"
sx={{
color: theme.palette.brightPurple.main,
borderColor: theme.palette.brightPurple.main,
mt: "10px",
...buttonProps.sx,
}}
>{buttonProps.text}</Button>
>
{buttonProps.text}
</CustomButton>
)}
</Box>
);

@ -44,6 +44,8 @@ export default function TariffPage() {
console.log(currentTariffs);
console.log(currentTariffs);
useAllTariffsFetcher({
onSuccess: updateTariffs,
onError: (error) => {