-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
158 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import styled from 'styled-components'; | ||
import sadVector from '../../../assets/sadVector.png'; | ||
import Modal from '../../../components/Modal/Modal'; | ||
import media from '../../../styles/media'; | ||
|
||
interface ModalProps { | ||
onClose: () => void; | ||
} | ||
|
||
const UnderAgeModal: React.FC<ModalProps> = ({ onClose }) => { | ||
const [isLargeScreen, setIsLargeScreen] = useState<boolean>(() => | ||
typeof window !== 'undefined' ? window.innerWidth >= 745 : false, | ||
); | ||
|
||
useEffect(() => { | ||
const handleResize = () => { | ||
setIsLargeScreen(window.innerWidth >= 745); | ||
}; | ||
|
||
window.addEventListener('resize', handleResize); | ||
|
||
return () => { | ||
window.removeEventListener('resize', handleResize); | ||
}; | ||
}, []); | ||
|
||
const Content = ( | ||
<Contents> | ||
<Container> | ||
<Img src={sadVector} /> | ||
<Title>만 14세 미만은 이용할 수 없습니다.</Title> | ||
</Container> | ||
</Contents> | ||
); | ||
|
||
return isLargeScreen ? <Modal onClose={onClose}>{Content}</Modal> : Content; | ||
}; | ||
|
||
const Contents = styled.div` | ||
${media.notLarge` | ||
background-color: white; | ||
width: 100vw; | ||
height: 100vh; | ||
z-index: 1000; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
`} | ||
`; | ||
|
||
const Title = styled.div` | ||
font-family: Pretendard; | ||
font-size: 15px; | ||
font-style: normal; | ||
font-weight: 600; | ||
margin-bottom: 168px; | ||
`; | ||
|
||
const Img = styled.img` | ||
width: 67px; | ||
height: 65px; | ||
margin-top: 130px; | ||
margin-bottom: 42.5px; | ||
`; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
`; | ||
|
||
export default UnderAgeModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters