-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] 상세페이지 신청하기 섹션 구현 #52
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e199d39
feat: 상세페이지 신청하기 섹션 구현 (#51)
mungjin01 d913592
feat: 신청하기 버튼 통해 신청자 수 증가 (#51)
mungjin01 dde2d68
fix: 리뷰 수정 (#51)
mungjin01 1e6fae2
fix: 모달창 스크롤 문제 해결 (#51)
mungjin01 94f656d
feat: 상세페이지 라우터 수정 (#51)
mungjin01 cb8bf2c
fix : 데이터 수정 (#51)
mungjin01 c554b48
Merge branches 'feature/#51/detail' and 'develop' of https://github.c…
mungjin01 b7ccc98
chore: 리뷰 수정 (#51)
mungjin01 b701501
feat: 이미지 섹션에 이미지 추가 (#51)
mungjin01 8f5b229
Revert "feat: 이미지 섹션에 이미지 추가 (#51)"
mungjin01 a67d2df
feat: 상세페이지 api 연동 (#51)
mungjin01 1d3148a
chore: 상세페이지 api 위치 일부 수정 (#51)
mungjin01 aa5fd39
fix: 확대할 때 이미지 줄어드는 오류 해결 (#51)
mungjin01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const BubbleSection = () => { | ||
return <div>여긴 버블버블</div>; | ||
}; |
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,171 @@ | ||
import { useState } from 'react'; | ||
|
||
import { styled } from 'styled-components'; | ||
|
||
import { PlainButton } from '@/components/common/Button/PlainButton'; | ||
import { PlainChip } from '@/components/common/Chip/PlainChip'; | ||
import { ExperienceDetailModal } from '@/components/common/Modal/ExperienceDetailModal'; | ||
import { DetailData } from '@/pages/ExperienceDetailPage'; | ||
|
||
const DetailSection = ({ data }: { data: DetailData }) => { | ||
const [isModalOpen, setModalOpen] = useState(false); | ||
const [participants, setParticipants] = useState(data.participants); | ||
const [isButtonDisabled, setButtonDisabled] = useState(false); | ||
|
||
const handleOpenModal = () => { | ||
setModalOpen(true); | ||
}; | ||
|
||
const handleCloseModal = () => { | ||
setModalOpen(false); | ||
}; | ||
|
||
const handleIncreaseParticipants = () => { | ||
setParticipants((prevParticipants) => prevParticipants + 1); | ||
setButtonDisabled(true); | ||
setModalOpen(false); | ||
}; | ||
AAminha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
return ( | ||
<StyledContainer> | ||
<ImageContainer> | ||
<img src={data.imageURL} alt="Detail" /> | ||
</ImageContainer> | ||
<DetailContainer> | ||
<TextContainer> | ||
<PlainChip primary={true}>{participants}명 참여 중!</PlainChip> | ||
<TitleContainer>{data.title}</TitleContainer> | ||
<SubTitleContainer>{data.subtitle}</SubTitleContainer> | ||
</TextContainer> | ||
<ProfileContainer> | ||
<ProfileImageContainer> | ||
<img src={data.profileImageURL} alt="profile" /> | ||
</ProfileImageContainer> | ||
<ProfileTextContainer> | ||
<ProfileTitleContainer>{data.providerName}</ProfileTitleContainer> | ||
<ProfileSubTitleContainer> | ||
{data.providerJob} | {data.providerTitle} | {data.providerKeyword} | ||
</ProfileSubTitleContainer> | ||
</ProfileTextContainer> | ||
</ProfileContainer> | ||
<PlainButton | ||
variant="gray" | ||
height="48px" | ||
onClick={handleOpenModal} | ||
disabled={isButtonDisabled} | ||
> | ||
신청하기 | ||
</PlainButton> | ||
</DetailContainer> | ||
<ExperienceDetailModal | ||
isOpen={isModalOpen} | ||
onClose={handleCloseModal} | ||
onConfirm={handleIncreaseParticipants} | ||
/> | ||
</StyledContainer> | ||
); | ||
}; | ||
|
||
export default DetailSection; | ||
const StyledContainer = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
gap: 32px; | ||
display: inline-flex; | ||
`; | ||
|
||
const ImageContainer = styled.div` | ||
width: 597px; | ||
height: 373px; | ||
position: relative; | ||
border-radius: 8px; | ||
overflow: hidden; | ||
flex-shrink: 0; | ||
img { | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
border-radius: 8px; | ||
} | ||
`; | ||
|
||
const DetailContainer = styled.div` | ||
flex: 1 1 0; | ||
align-self: stretch; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
gap: 16px; | ||
display: inline-flex; | ||
`; | ||
|
||
const TextContainer = styled.div` | ||
align-self: stretch; | ||
flex: 1 1 0; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
gap: 10px; | ||
display: flex; | ||
`; | ||
|
||
const TitleContainer = styled.div` | ||
align-self: stretch; | ||
color: ${({ theme }) => `${theme.color.gray700}`}; | ||
${({ theme }) => theme.font.desktop.title1}; | ||
`; | ||
|
||
const SubTitleContainer = styled.div` | ||
align-self: stretch; | ||
color: ${({ theme }) => `${theme.color.gray500}`}; | ||
${({ theme }) => theme.font.desktop.body2m}; | ||
`; | ||
|
||
const ProfileContainer = styled.div` | ||
align-self: stretch; | ||
padding: 16px; | ||
background-color: ${({ theme }) => `${theme.color.white}`}; | ||
border-radius: 8px; | ||
overflow: hidden; | ||
border: 2px solid ${({ theme }) => `${theme.color.gray150}`}; | ||
justify-content: flex-start; | ||
align-items: center; | ||
gap: 16px; | ||
display: inline-flex; | ||
flex-shrink: 0; | ||
`; | ||
|
||
const ProfileImageContainer = styled.div` | ||
width: 56px; | ||
height: 56px; | ||
background: linear-gradient(0deg, #f4efff 0%, #f4efff 100%); | ||
border-radius: 8px; | ||
overflow: hidden; | ||
img { | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
} | ||
`; | ||
|
||
const ProfileTextContainer = styled.div` | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: flex-start; | ||
gap: 4px; | ||
display: inline-flex; | ||
`; | ||
|
||
const ProfileTitleContainer = styled.div` | ||
color: ${({ theme }) => `${theme.color.gray700}`}; | ||
${({ theme }) => theme.font.desktop.body1m}; | ||
`; | ||
|
||
const ProfileSubTitleContainer = styled.div` | ||
color: ${({ theme }) => `${theme.color.gray700}`}; | ||
${({ theme }) => theme.font.desktop.body2m}; | ||
`; |
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,50 @@ | ||
import { styled } from 'styled-components'; | ||
|
||
import { Dummy1 } from '@/pages/ExperienceDetailPage'; | ||
|
||
export const ImageSection = () => { | ||
return ( | ||
<StyledContainer> | ||
<TitleContainer>프로그램 소개</TitleContainer> | ||
<ImageBorderContainer> | ||
<ImageContainer> | ||
<img src={Dummy1.imageURL} alt="Detail" /> | ||
</ImageContainer> | ||
</ImageBorderContainer> | ||
</StyledContainer> | ||
); | ||
}; | ||
|
||
const StyledContainer = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
gap: 24px; | ||
display: inline-flex; | ||
`; | ||
|
||
const TitleContainer = styled.div` | ||
text-align: center; | ||
color: ${({ theme }) => `${theme.color.gray900}`}; | ||
${({ theme }) => theme.font.desktop.title1}; | ||
`; | ||
|
||
const ImageBorderContainer = styled.div` | ||
align-self: stretch; | ||
padding: 32px; | ||
background-color: ${({ theme }) => `${theme.color.white}`}; | ||
border-radius: 8px; | ||
overflow: hidden; | ||
border: 2px solid ${({ theme }) => `${theme.color.gray150}`}; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
gap: 20px; | ||
display: flex; | ||
`; | ||
|
||
const ImageContainer = styled.div` | ||
//연동하면서 수정 예정 | ||
`; |
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,103 @@ | ||
import { useEffect } from 'react'; | ||
|
||
import styled from 'styled-components'; | ||
|
||
import { PlainButton } from '@/components/common/Button/PlainButton'; | ||
|
||
interface ModalProps { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
onConfirm: () => void; | ||
} | ||
|
||
export const ExperienceDetailModal = ({ isOpen, onClose, onConfirm }: ModalProps) => { | ||
useEffect(() => { | ||
if (isOpen) { | ||
document.body.setAttribute('style', 'overflow: hidden'); | ||
} else { | ||
document.body.setAttribute('style', 'overflow: auto'); | ||
} | ||
return () => { | ||
document.body.setAttribute('style', 'overflow: auto'); | ||
}; | ||
}, [isOpen]); | ||
if (!isOpen) return null; | ||
|
||
return ( | ||
<ModalOverlay> | ||
<ModalContent> | ||
<TitleContainer>프로그램 신청</TitleContainer> | ||
<ContentContainer> | ||
해당 프로그램을 <Highlight>신청</Highlight>하시겠습니까? | ||
</ContentContainer> | ||
<ButtonContainer> | ||
<StyledButton height="48px" onClick={onClose}> | ||
취소하기 | ||
</StyledButton> | ||
<PlainButton variant="gray" height="48px" onClick={onConfirm}> | ||
신청하기 | ||
</PlainButton> | ||
</ButtonContainer> | ||
</ModalContent> | ||
</ModalOverlay> | ||
); | ||
}; | ||
|
||
const ModalOverlay = styled.div` | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: rgba(17.85, 17.85, 17.85, 0.36); | ||
backdrop-filter: blur(10px); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
const ModalContent = styled.div` | ||
width: 618px; | ||
height: 338px; | ||
background: white; | ||
padding: 24px; | ||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.25); | ||
border-radius: 16px; | ||
overflow: hidden; | ||
backdrop-filter: blur(8px); | ||
flex-direction: column; | ||
justify-content: space-between; | ||
align-items: center; | ||
display: inline-flex; | ||
`; | ||
|
||
const TitleContainer = styled.div` | ||
align-self: stretch; | ||
text-align: center; | ||
color: ${({ theme }) => `${theme.color.gray800}`}; | ||
${({ theme }) => theme.font.desktop.body1b}; | ||
`; | ||
|
||
const ContentContainer = styled.div` | ||
color: ${({ theme }) => `${theme.color.gray700}`}; | ||
${({ theme }) => theme.font.desktop.title2}; | ||
`; | ||
|
||
const ButtonContainer = styled.div` | ||
align-self: stretch; | ||
justify-content: flex-start; | ||
gap: 8px; | ||
display: inline-flex; | ||
`; | ||
|
||
const StyledButton = styled(PlainButton)` | ||
background: ${({ theme }) => `${theme.color.gray200}`}; | ||
&:hover { | ||
background: ${({ theme }) => `${theme.color.gray200}`}; | ||
} | ||
color: inherit; | ||
`; | ||
|
||
const Highlight = styled.span` | ||
color: ${({ theme }) => theme.color.primary500}; | ||
`; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 API 연동할 때 post 성공하면 실행되는 걸로 하면 될 것 같아요