-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from teamViNO/feature-028
feature-028: 추천 영상 모달 구현
- Loading branch information
Showing
13 changed files
with
289 additions
and
33 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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, { useState, useEffect } from 'react'; | ||
import { useRecoilState } from 'recoil'; | ||
import { recommendationModalState } from '@/stores/modal'; | ||
import useOutsideClick from '@/hooks/useOutsideClick'; | ||
|
||
import emptyvideoImg from '@/assets/empty-video.png'; | ||
import CloseIcon from '@/assets/icons/close.svg?react'; | ||
import cardimageImg from '@/assets/card-image.png'; | ||
|
||
import { RecommendationModalContainer } from '@/styles/modals/RecommendationModal.style'; | ||
import { getNicknameAPI } from '@/apis/user'; | ||
|
||
const RecommendationModal: React.FC = () => { | ||
const [nickname, setNickname] = useState(''); | ||
const [modalOpen, setModalOpen] = useRecoilState(recommendationModalState); | ||
|
||
const closeModal = () => { | ||
setModalOpen(false); | ||
} | ||
|
||
const [modalRef] = useOutsideClick<HTMLDivElement>(closeModal); | ||
|
||
useEffect(() => { | ||
async function fetchNickname() { | ||
const response = await getNicknameAPI(); | ||
setNickname(response.data.result.nickname); | ||
} | ||
|
||
fetchNickname(); | ||
}, []); | ||
|
||
|
||
return ( | ||
<RecommendationModalContainer | ||
isOpen={modalOpen}> | ||
<div className='modal-container' ref={modalRef}> | ||
<div className='modal-inform'> | ||
<div className='close-btn' onClick={closeModal}> | ||
<CloseIcon width={28} height={28}/> | ||
</div> | ||
<div className='inform-wrapper'> | ||
<div className='inform'> | ||
<img src={emptyvideoImg} alt="emptyvideoImg" width={56} height={56} /> | ||
<div className='inform-text'> | ||
기다리는 동안 이런 영상은 어때요? | ||
</div> | ||
<div className='inform-subtext'> | ||
{nickname}님을 위해 미리 정리 된 영상을 소개해드릴게요 | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className='modal-card'> | ||
<img src={cardimageImg} alt='card-image' width={290}/> | ||
<div className='card-text'> | ||
<h2 className='card-title'> | ||
우리는 카카오워크로 일해요 | ||
</h2> | ||
<div className='hashtag'> | ||
<span className='card-hashtag'> | ||
# 디자인 | ||
</span> | ||
<span className='card-hashtag'> | ||
# 진로 | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</RecommendationModalContainer> | ||
); | ||
}; | ||
|
||
export default RecommendationModal; |
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,108 @@ | ||
import styled from 'styled-components'; | ||
import theme from '../theme'; | ||
|
||
export const RecommendationModalContainer = styled.div<{ isOpen: boolean }>` | ||
position: fixed; | ||
z-index: 100; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: rgba(0, 0, 0, 0.5); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
.modal-container { | ||
padding: 40px 61px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
width: 700px; | ||
height: 463.13px; | ||
position: relative; | ||
background: white; | ||
border-radius: 20px; | ||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); | ||
} | ||
.close-btn { | ||
width: 600px; | ||
display: flex; | ||
justify-content: flex-end; | ||
cursor: pointer; | ||
} | ||
.inform-wrapper { | ||
width: 600px; | ||
height: 144px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
.inform { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.inform-text { | ||
margin-top: 12px; | ||
margin-bottom: 12px; | ||
color: ${theme.color.gray500}; | ||
font-size: 24px; | ||
line-height: 1.6em; | ||
} | ||
.inform-subtext { | ||
color: ${theme.color.gray300}; | ||
font-size: 16px; | ||
line-height: 1.6em; | ||
} | ||
.modal-card { | ||
width: 578px; | ||
height: 163.13px; | ||
margin-top: 48px; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: flex-start; | ||
cursor: pointer; | ||
} | ||
.modal-card img { | ||
border: none; | ||
border-top-left-radius: 20px; | ||
border-bottom-left-radius: 20px; | ||
width: 290px; | ||
height: auto; | ||
} | ||
.card-text { | ||
width: 288px; | ||
padding: 24px 20px; | ||
} | ||
.card-title { | ||
width: 248px; | ||
height: 78px; | ||
font-size: 16px; | ||
font-weight: bold; | ||
text-align: left; | ||
} | ||
.hashtag { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
} | ||
.card-hashtag { | ||
color: ${theme.color.gray400}; | ||
padding: 6px 10px; | ||
border-radius: 8px; | ||
background-color: ${theme.color.gray100}; | ||
margin-right: 8px; | ||
} | ||
` |
Oops, something went wrong.