|
| 1 | +import styled from "@emotion/styled"; |
| 2 | +import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; |
| 3 | +import { AccordionDetails, AccordionSummary, Accordion as MuiAccordion, Stack, Typography } from "@mui/material"; |
| 4 | +import * as React from "react"; |
| 5 | +import PyCon2025HostLogoBig from "../../assets/pyconkr2025_hostlogo_big.png"; |
| 6 | +import PyCon2025HostLogoSmall from "../../assets/pyconkr2025_hostlogo_small.png"; |
| 7 | + |
| 8 | +const AccordionExpandedStyle: React.CSSProperties = { |
| 9 | + backgroundColor: "white", |
| 10 | + overflow: "hidden", |
| 11 | +}; |
| 12 | + |
| 13 | +export const MobilePageAccordion: React.FC = () => { |
| 14 | + const [expanded, setExpanded] = React.useState<boolean>(false); |
| 15 | + |
| 16 | + return ( |
| 17 | + <AccordionWrapper> |
| 18 | + <StyledAccordion expanded={expanded} onChange={() => setExpanded((prev) => !prev)}> |
| 19 | + <AccordionSummary expandIcon={<ExpandMoreIcon />}> |
| 20 | + {expanded ? null : ( |
| 21 | + <Stack direction={"row"} sx={{ gap: "1rem" }}> |
| 22 | + <Typography>{"AUG 15 - 17"}</Typography> |
| 23 | + <img src={PyCon2025HostLogoSmall} /> |
| 24 | + </Stack> |
| 25 | + )} |
| 26 | + </AccordionSummary> |
| 27 | + <StyledAccordionDetails> |
| 28 | + {expanded ? ( |
| 29 | + <Stack alignItems="center" justifyContent="center" sx={{ ...AccordionExpandedStyle }}> |
| 30 | + <img |
| 31 | + src={PyCon2025HostLogoBig} |
| 32 | + alt="PyCon 2025 Host Logo" |
| 33 | + style={{ backgroundColor: "white", objectFit: "cover", borderRadius: "50%" }} |
| 34 | + /> |
| 35 | + </Stack> |
| 36 | + ) : null} |
| 37 | + </StyledAccordionDetails> |
| 38 | + </StyledAccordion> |
| 39 | + </AccordionWrapper> |
| 40 | + ); |
| 41 | +}; |
| 42 | + |
| 43 | +const AccordionWrapper = styled.div` |
| 44 | + display: flex; |
| 45 | + flex-direction: column; |
| 46 | + border-top: 1px solid ${({ theme }) => theme.palette.primary.dark}; |
| 47 | + border-bottom: 1px solid ${({ theme }) => theme.palette.primary.dark}; |
| 48 | +`; |
| 49 | + |
| 50 | +const Divider = styled.div` |
| 51 | + height: 1px; |
| 52 | + background-color: ${({ theme }) => theme.palette.primary.light}; |
| 53 | + margin: 0; |
| 54 | +`; |
| 55 | + |
| 56 | +const StyledAccordion = styled(MuiAccordion)` |
| 57 | + box-shadow: none; |
| 58 | + border-radius: 0; |
| 59 | +
|
| 60 | + &:before { |
| 61 | + display: none; |
| 62 | + } |
| 63 | +
|
| 64 | + &.MuiAccordion-root { |
| 65 | + margin: 0; |
| 66 | +
|
| 67 | + &:first-of-type { |
| 68 | + border-top: none; |
| 69 | + } |
| 70 | +
|
| 71 | + &:last-of-type { |
| 72 | + border-bottom: none; |
| 73 | + } |
| 74 | + } |
| 75 | +
|
| 76 | + .MuiAccordionSummary-root { |
| 77 | + padding: 10px 35px; |
| 78 | + min-height: 60px; |
| 79 | + max-height: 60px; |
| 80 | +
|
| 81 | + .MuiAccordionSummary-content { |
| 82 | + display: flex; |
| 83 | + align-items: center; |
| 84 | + margin: 0; |
| 85 | + } |
| 86 | +
|
| 87 | + &.Mui-expanded { |
| 88 | + min-height: 60px; |
| 89 | + max-height: 60px; |
| 90 | + } |
| 91 | + } |
| 92 | +`; |
| 93 | + |
| 94 | +const Number = styled.span` |
| 95 | + font-size: 18px; |
| 96 | + font-weight: 400; |
| 97 | +`; |
| 98 | + |
| 99 | +const Question = styled.span` |
| 100 | + font-size: 18px; |
| 101 | + font-weight: 400; |
| 102 | + margin-left: 60px; |
| 103 | +`; |
| 104 | + |
| 105 | +const StyledAccordionDetails = styled(AccordionDetails)` |
| 106 | + background-color: white; |
| 107 | + color: ${({ theme }) => theme.palette.primary.dark}; |
| 108 | + font-size: 14px; |
| 109 | + font-weight: 400; |
| 110 | + width: 100%; |
| 111 | + height: 100%; |
| 112 | + padding: 20px 0 20px calc(35px + 18px + 60px); // top right bottom left |
| 113 | +`; |
0 commit comments