Skip to content

Commit 9ca4163

Browse files
committed
feat: 모바일 메인페이지 전용 아코디언 개발
1 parent 81923d5 commit 9ca4163

File tree

4 files changed

+116
-2
lines changed

4 files changed

+116
-2
lines changed

apps/pyconkr/src/components/layout/Footer/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { Button, useMediaQuery, useTheme } from "@mui/material";
55
import * as React from "react";
66

77
import FlickrIcon from "@apps/pyconkr/assets/thirdparty/flickr.svg?react";
8+
import { MobilePageAccordion } from "../../../../../../packages/common/src/components/mdx_components/mobile_accordion";
89

910
import { useAppContext } from "../../../contexts/app_context";
10-
import MobileFooter from "./Mobile/MobileFooter";
1111

1212
interface IconItem {
1313
icon: React.FC<{ width?: number; height?: number }>;
@@ -90,7 +90,8 @@ export default function Footer() {
9090
console.log("isMobile " + isMobile);
9191

9292
if (isMobile) {
93-
return <MobileFooter />;
93+
return <MobilePageAccordion />;
94+
// return <MobileFooter />;
9495
} else {
9596
return (
9697
<FooterContainer>
17.8 KB
Loading
4.16 KB
Loading
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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

Comments
 (0)