-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feat/#370] 상세 페이지에서 상세 이미지 뷰 추가
- Loading branch information
Showing
8 changed files
with
1,797 additions
and
1,469 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
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: 1.6rem; | ||
height: ${({ $showAllImages, $toggleAvailable }) => | ||
$showAllImages ? "auto" : $toggleAvailable && "70rem"}; | ||
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: 0.8rem; | ||
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: 0.6rem; | ||
`; | ||
|
||
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
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.