|
| 1 | +import Image from "next/image" |
| 2 | + |
| 3 | +import { Box, Stack } from "@mui/material" |
| 4 | + |
| 5 | +import PrivateAccountMobileImage from "@/assets/images/cloak/cloak-private-mobile.webp" |
| 6 | +import PrivateAccountImage from "@/assets/images/cloak/cloak-private.webp" |
| 7 | +import BalanceSvg from "@/assets/svgs/cloak/balance.svg" |
| 8 | +import DepositSvg from "@/assets/svgs/cloak/deposit.svg" |
| 9 | +import HistorySvg from "@/assets/svgs/cloak/history.svg" |
| 10 | +import { CLOAK_PRIVATE_DESCS } from "@/constants" |
| 11 | + |
| 12 | +import SectionWrapper from "../SectionWrapper" |
| 13 | +import PrivateCard from "./PrivateCard" |
| 14 | + |
| 15 | +const iconMap = { |
| 16 | + history: HistorySvg, |
| 17 | + balance: BalanceSvg, |
| 18 | + deposit: DepositSvg, |
| 19 | +} |
| 20 | + |
| 21 | +const PrivateAccount = () => { |
| 22 | + const [leftCard, ...rightCards] = CLOAK_PRIVATE_DESCS |
| 23 | + |
| 24 | + return ( |
| 25 | + <SectionWrapper title="Private Account Management" backgroundColor="text.primary" color="background.default"> |
| 26 | + <Box |
| 27 | + sx={{ |
| 28 | + pt: [0, 0, "1.8rem"], |
| 29 | + display: "grid", |
| 30 | + width: ["100%", "max-content", "100%"], |
| 31 | + mx: "auto", |
| 32 | + gridTemplateColumns: ["1fr", "1fr", "repeat(2, max-content)", "max-content max-content max-content"], |
| 33 | + gridTemplateAreas: [ |
| 34 | + ` |
| 35 | + "leftCard" |
| 36 | + "image" |
| 37 | + "rightCards" |
| 38 | + `, |
| 39 | + ` |
| 40 | + "leftCard" |
| 41 | + "image" |
| 42 | + "rightCards" |
| 43 | + `, |
| 44 | + ` |
| 45 | + "leftCard image" |
| 46 | + "rightCards image" |
| 47 | + `, |
| 48 | + ` |
| 49 | + "leftCard image rightCards" |
| 50 | + `, |
| 51 | + ], |
| 52 | + alignItems: "center", |
| 53 | + justifyContent: "center", |
| 54 | + gap: ["2rem", "2rem", "3.4rem", "4px"], |
| 55 | + }} |
| 56 | + > |
| 57 | + <PrivateCard |
| 58 | + sx={{ |
| 59 | + alignSelf: "center", |
| 60 | + height: ["unset", "unset", "unset", "21.6rem"], |
| 61 | + gridArea: "leftCard", |
| 62 | + }} |
| 63 | + key={leftCard.key} |
| 64 | + Icon={iconMap[leftCard.key]} |
| 65 | + title={leftCard.title} |
| 66 | + content={leftCard.content} |
| 67 | + ></PrivateCard> |
| 68 | + |
| 69 | + <Image src={PrivateAccountImage} alt="Private Account" className="!hidden lg:!block max-h-[500px] w-auto" /> |
| 70 | + <Image |
| 71 | + src={PrivateAccountMobileImage} |
| 72 | + alt="Private Account" |
| 73 | + style={{ gridArea: "image" }} |
| 74 | + className="block lg:!hidden w-full max-w-[400px]" |
| 75 | + /> |
| 76 | + |
| 77 | + <Stack sx={{ gap: ["2rem", "3.4rem"], alignSelf: "center", gridArea: "rightCards" }}> |
| 78 | + {rightCards.map(({ key, title, content }) => ( |
| 79 | + <PrivateCard |
| 80 | + key={key} |
| 81 | + sx={{ |
| 82 | + height: ["unset", "unset", "unset", "16.8rem"], |
| 83 | + }} |
| 84 | + Icon={iconMap[key]} |
| 85 | + title={title} |
| 86 | + content={content} |
| 87 | + ></PrivateCard> |
| 88 | + ))} |
| 89 | + </Stack> |
| 90 | + </Box> |
| 91 | + </SectionWrapper> |
| 92 | + ) |
| 93 | +} |
| 94 | +export default PrivateAccount |
0 commit comments