2023-08-24 13:10:47 +00:00
|
|
|
|
import { Box, Button, IconButton, Typography, useMediaQuery, useTheme } from "@mui/material";
|
2022-11-25 18:52:46 +00:00
|
|
|
|
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
2023-03-19 12:30:40 +00:00
|
|
|
|
import WalletIcon from "@components/icons/WalletIcon";
|
|
|
|
|
import SectionWrapper from "@components/SectionWrapper";
|
2023-08-22 10:28:22 +00:00
|
|
|
|
import { cardShadow } from "@root/utils/theme";
|
2023-07-07 13:53:08 +00:00
|
|
|
|
import { currencyFormatter } from "@root/utils/currencyFormatter";
|
|
|
|
|
import { useUserStore } from "@root/stores/user";
|
2023-08-24 13:10:47 +00:00
|
|
|
|
import { Link } from "react-router-dom";
|
2022-11-22 13:21:49 +00:00
|
|
|
|
|
2023-08-16 14:03:45 +00:00
|
|
|
|
import { useHistoryTracker } from "@root/utils/hooks/useHistoryTracker";
|
|
|
|
|
|
2022-11-22 13:21:49 +00:00
|
|
|
|
export default function Wallet() {
|
2023-09-01 08:27:14 +00:00
|
|
|
|
const handleCustomBackNavigation = useHistoryTracker();
|
|
|
|
|
const theme = useTheme();
|
|
|
|
|
const upMd = useMediaQuery(theme.breakpoints.up("md"));
|
2023-09-04 20:01:24 +00:00
|
|
|
|
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
|
|
|
|
const isMobile = useMediaQuery(theme.breakpoints.down(600));
|
2023-09-01 08:27:14 +00:00
|
|
|
|
const cash = useUserStore((state) => state.userAccount?.wallet.cash) ?? 0;
|
2023-08-16 14:03:45 +00:00
|
|
|
|
|
|
|
|
|
const footnotes = (
|
|
|
|
|
<Box
|
|
|
|
|
component="ol"
|
|
|
|
|
sx={{
|
2023-08-22 10:28:22 +00:00
|
|
|
|
color: theme.palette.gray.main,
|
2023-08-16 14:03:45 +00:00
|
|
|
|
pt: "10px",
|
|
|
|
|
pl: "25px",
|
2023-09-01 08:27:14 +00:00
|
|
|
|
|
2023-08-16 14:03:45 +00:00
|
|
|
|
mt: 0,
|
|
|
|
|
mb: upMd ? "3px" : "73px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Typography
|
|
|
|
|
component="li"
|
|
|
|
|
sx={{
|
|
|
|
|
fontSize: "16px",
|
|
|
|
|
lineHeight: "20px",
|
|
|
|
|
fontWeight: 400,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
Текст для сносок: текст-заполнитель — это текст, который имеет текст-заполнитель — это текст, который имеет
|
|
|
|
|
</Typography>
|
|
|
|
|
<Typography
|
|
|
|
|
component="li"
|
|
|
|
|
sx={{
|
|
|
|
|
fontSize: "16px",
|
|
|
|
|
lineHeight: "20px",
|
|
|
|
|
fontWeight: 400,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
Текст для сносок: тель — это текст, который имеет текст-заполнитель — это текст, который имеет
|
|
|
|
|
</Typography>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
2022-11-22 13:21:49 +00:00
|
|
|
|
|
2023-09-01 08:27:14 +00:00
|
|
|
|
return (
|
|
|
|
|
<SectionWrapper
|
|
|
|
|
maxWidth="lg"
|
|
|
|
|
sx={{
|
|
|
|
|
mt: "25px",
|
|
|
|
|
mb: "70px",
|
2023-09-04 20:01:24 +00:00
|
|
|
|
px: isTablet ? (isMobile ? "18px" : "40px") : "20px",
|
2023-09-01 08:27:14 +00:00
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
mt: "20px",
|
|
|
|
|
mb: "40px",
|
|
|
|
|
display: "flex",
|
|
|
|
|
gap: "10px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{!upMd && (
|
|
|
|
|
<IconButton onClick={handleCustomBackNavigation} sx={{ p: 0, height: "28px", width: "28px", color: "black" }}>
|
|
|
|
|
<ArrowBackIcon />
|
|
|
|
|
</IconButton>
|
|
|
|
|
)}
|
|
|
|
|
<Typography variant="h4">Мой кошелёк</Typography>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
backgroundColor: "white",
|
|
|
|
|
display: "flex",
|
|
|
|
|
flexDirection: upMd ? "row" : "column",
|
|
|
|
|
gap: "9%",
|
|
|
|
|
borderRadius: "12px",
|
|
|
|
|
mb: "40px",
|
|
|
|
|
boxShadow: cardShadow,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
width: upMd ? "59.5%" : undefined,
|
|
|
|
|
p: "20px",
|
|
|
|
|
pb: upMd ? undefined : "10px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Typography sx={{ color: theme.palette.gray.dark, mb: "30px" }}>Баланс 10.04.2022</Typography>
|
|
|
|
|
<Box
|
2023-03-19 12:30:40 +00:00
|
|
|
|
sx={{
|
2023-09-01 08:27:14 +00:00
|
|
|
|
display: "flex",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
gap: "22px",
|
|
|
|
|
pb: "40px",
|
|
|
|
|
borderBottom: `1px solid ${theme.palette.gray.main}`,
|
2023-03-19 12:30:40 +00:00
|
|
|
|
}}
|
2023-09-01 08:27:14 +00:00
|
|
|
|
>
|
|
|
|
|
<WalletIcon bgcolor="#FEDFD0" color={theme.palette.orange.main} />
|
|
|
|
|
<Typography variant="h5">{currencyFormatter.format(cash / 100)}</Typography>
|
|
|
|
|
</Box>
|
|
|
|
|
{upMd && footnotes}
|
|
|
|
|
</Box>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
flexDirection: "column",
|
|
|
|
|
alignItems: "start",
|
|
|
|
|
color: theme.palette.gray.dark,
|
|
|
|
|
width: upMd ? "31.5%" : undefined,
|
|
|
|
|
p: "20px",
|
|
|
|
|
pl: upMd ? "33px" : undefined,
|
|
|
|
|
borderLeft: upMd ? `1px solid ${theme.palette.gray.main}` : undefined,
|
|
|
|
|
}}
|
2023-08-16 14:03:45 +00:00
|
|
|
|
>
|
2023-09-01 08:27:14 +00:00
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
flexDirection: "column",
|
|
|
|
|
gap: "22px",
|
|
|
|
|
maxWidth: "85%",
|
|
|
|
|
mb: "32px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
2023-09-04 20:01:24 +00:00
|
|
|
|
<Typography>Текст-заполнитель — {isMobile ? <br /> : null} это текст, который имеет</Typography>
|
|
|
|
|
<Typography>Текст-заполнитель — {isMobile ? <br /> : null} это текст, который имеет</Typography>
|
2023-09-01 08:27:14 +00:00
|
|
|
|
</Box>
|
|
|
|
|
<Button variant="pena-contained-dark" component={Link} to="/payment" sx={{ mt: "auto" }}>
|
|
|
|
|
Пополнить
|
|
|
|
|
</Button>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
{!upMd && footnotes}
|
|
|
|
|
</SectionWrapper>
|
|
|
|
|
);
|
2023-03-19 12:30:40 +00:00
|
|
|
|
}
|