Skip to content

Commit 828541f

Browse files
committed
fix the css
1 parent 251f09f commit 828541f

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

components/Atoms/Common/ModalBox/index.jsx

+12
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,15 @@ export const ModalBox = styled(motion.div)`
1919
margin: ${props => props.margin || 'auto'};
2020
`;
2121

22+
export const ResponsiveModal = styled('div')`
23+
display: flex;
24+
width: 100%;
25+
justify-content: center;
26+
align-items: center;
27+
28+
padding: ${props => props.padding || ''};
29+
30+
@media only screen and (min-width: 768px) {
31+
padding: ${props => props.paddingMd || ''};
32+
}
33+
`;

components/Organisms/Post/NewPostModal/index.jsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import CloseRoundedIcon from '@mui/icons-material/CloseRounded';
22
import {FlexBox } from '../../../../styles/globals';
3-
import {ModalBox} from '../../../Atoms/Common/ModalBox';
3+
import {ModalBox, ResponsiveModal} from '../../../Atoms/Common/ModalBox';
44
import {useRouter} from 'next/router';
55
import {Text} from '../../../Atoms/Common/Text';
66
import {Spacer} from '../../../Atoms/Common/Spacer';
@@ -24,10 +24,11 @@ export function NewPostModal(props) {
2424
}
2525

2626
return (
27-
<FlexBox>
28-
<ModalBox bgColor="#ffffff" minWidth="50%" padding = "25px 50px 50px 50px" align = "stretch" borderRadius = "20px"
29-
initial= {{y:500}}
30-
animate = {{y:-300, opacity:1}}
27+
<FlexBox style={{ width: "100vw", height: "100vh", position: "absolute", top: 0, zIndex: 99 }}>
28+
<ResponsiveModal padding="0 10% 0 10%" paddingMd="0 30% 0 30%">
29+
<ModalBox flex="1" maxWidth="100%" bgColor="#ffffff" margin="0" position="unset" minWidth="50%" padding = "25px 50px 50px 50px" align = "stretch" borderRadius = "20px"
30+
initial= {{y:1000}}
31+
animate = {{y:0, opacity:1}}
3132
transiton={{duration: 100, delay:500}}
3233
exit={{y:1000, opacity: 0}}>
3334
<FlexBox justify = 'flex-end' dir = 'column' align = 'flex-end' flex = '1' padding = '0 0 15px 0' >
@@ -58,6 +59,7 @@ export function NewPostModal(props) {
5859

5960
</FlexBox>
6061
</ModalBox>
62+
</ResponsiveModal>
6163
<ModalBackdrop onClick = {props.onClick}/>
6264
</FlexBox>
6365
);

0 commit comments

Comments
 (0)