-
Notifications
You must be signed in to change notification settings - Fork 3
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/#370] 상세 페이지에서 상세 이미지 뷰 추가 #373
Merged
+1,797
−1,469
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
205acd0
fix: API 타입 재생성
pepperdad c1049c2
feat: 상세 이미지 보여주는 컴포넌트 추가
pepperdad 7526186
feat: performanceImageList props로 전달
pepperdad a0e0a4a
chore: px -> rem으로 단위 변경
pepperdad 8262cef
Merge branch 'develop' of https://github.com/TEAM-BEAT/BEAT-Client in…
pepperdad 1e11c94
feat: 등록하기 페이지에서 상세 이미지 미리볼 수 있도록 추가
pepperdad 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
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
47 changes: 47 additions & 0 deletions
47
src/pages/gig/components/detailImage/DetailImage.styled.ts
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,47 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Wrapper = styled.div` | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
export const ImageWrapper = styled.div<{ $showAllImages: boolean; $toggleAvailable: boolean }>` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
height: ${({ $showAllImages, $toggleAvailable }) => | ||
$showAllImages ? "auto" : $toggleAvailable && "700px"}; | ||
overflow: ${({ $showAllImages }) => | ||
$showAllImages ? "visible" : "hidden"}; /* 이미지의 하단 부분을 잘라내도록 설정 */ | ||
`; | ||
|
||
export const Image = styled.img` | ||
width: 100%; | ||
height: auto; | ||
`; | ||
|
||
export const ShowMoreButton = styled.button` | ||
display: flex; | ||
justify-content: space-between; | ||
margin-top: 8px; | ||
padding: 1.6rem 9.1rem; | ||
|
||
color: ${({ theme }) => theme.colors.white}; | ||
${({ theme }) => theme.fonts["body1-normal-semi"]}; | ||
|
||
background-color: ${({ theme }) => theme.colors.gray_900}; | ||
cursor: pointer; | ||
border: 1px solid ${({ theme }) => theme.colors.gray_700}; | ||
border-radius: 6px; | ||
`; | ||
|
||
export const Overlay = styled.div` | ||
position: absolute; | ||
bottom: 6.3rem; | ||
|
||
width: 100%; | ||
height: 10rem; | ||
|
||
background: linear-gradient(180deg, rgb(27 27 27 / 0%) 0%, #1b1b1b 100%); | ||
`; |
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,45 @@ | ||
import { useState } from "react"; | ||
import { IconArrowDown, IconArrowUp } from "@assets/svgs"; | ||
import * as S from "./DetailImage.styled"; | ||
|
||
const DetailImage = ({ performanceImageList }) => { | ||
const toggleAvailable = performanceImageList?.length > 2; | ||
const [showAllImages, setShowAllImages] = useState(false); | ||
|
||
const handleDetailImageToggle = () => { | ||
setShowAllImages((prev) => !prev); | ||
}; | ||
|
||
if (!performanceImageList || performanceImageList.length === 0) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<S.Wrapper> | ||
<S.ImageWrapper $showAllImages={showAllImages} $toggleAvailable={toggleAvailable}> | ||
{performanceImageList.map((image) => ( | ||
<S.Image key={image.performanceImageId} src={image.performanceImage} /> | ||
))} | ||
</S.ImageWrapper> | ||
|
||
{toggleAvailable && ( | ||
<> | ||
{!showAllImages && <S.Overlay />} | ||
<S.ShowMoreButton onClick={handleDetailImageToggle}> | ||
{showAllImages ? ( | ||
<> | ||
<span>상세 이미지 접기</span> <IconArrowUp width={"24px"} /> | ||
</> | ||
) : ( | ||
<> | ||
<span>상세 이미지 더보기</span> <IconArrowDown width={"24px"} /> | ||
</> | ||
)} | ||
</S.ShowMoreButton> | ||
</> | ||
)} | ||
</S.Wrapper> | ||
); | ||
}; | ||
|
||
export default DetailImage; |
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
Oops, something went wrong.
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.
p5) 여기 작업할 때 px을 사용하신 기준이 궁금합니다!
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.
gap
과 같이 작은 숫자로 표현되는 건,,, 0.8rem 이렇게 쓰는 것보다 px로 쓰는 게 익숙해서 그런 것 같아요!수정하겠습니다~!