-
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.
feat: PostDetailContent 및 모집 상세 페이지 구현
- Loading branch information
1 parent
39fabcf
commit a147423
Showing
5 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
src/components/postDetail/PostDetailContent/PostDetailContent.module.scss
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,66 @@ | ||
.main-banner { | ||
width: 100%; | ||
} | ||
|
||
.main-section { | ||
@include responsive(T) { | ||
padding: 0 4rem; | ||
} | ||
|
||
@include responsive(M) { | ||
padding: 0 1.5rem; | ||
} | ||
|
||
width: 100%; | ||
|
||
.container { | ||
@include responsive(T) { | ||
max-width: 100%; | ||
padding-top: 3.2rem; | ||
} | ||
|
||
max-width: 112rem; | ||
margin: 0 auto; | ||
padding: 2.4rem 0 12rem; | ||
|
||
.section-top { | ||
@include column-flexbox(center, start, 1.6rem); | ||
|
||
@include responsive(T) { | ||
padding-bottom: 1.6rem; | ||
} | ||
|
||
width: 100%; | ||
padding-bottom: 3.2rem; | ||
} | ||
|
||
.section-bottom { | ||
@include flexbox(between, start); | ||
|
||
@include responsive(T) { | ||
@include column-flexbox($gap: 0); | ||
} | ||
|
||
width: 100%; | ||
|
||
&.no-flex { | ||
display: block; | ||
} | ||
|
||
.section-left { | ||
@include column-flexbox(start, start, 1.6rem); | ||
|
||
@include responsive(T) { | ||
max-width: 100%; | ||
} | ||
|
||
width: 100%; | ||
max-width: 74.3rem; | ||
|
||
&.no-flex { | ||
max-width: 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,75 @@ | ||
import classNames from 'classnames/bind'; | ||
|
||
import { formatCategoryToGameNameEN, splitDescByDelimiter, splitTitleByDelimiter } from '@/utils'; | ||
|
||
import Banner from '@/components/layout/Banner'; | ||
import DefaultBanner from '@/components/postDetail/DefaultBanner'; | ||
import ImageSlide from '@/components/postDetail/ImageSlide'; | ||
import MapPreview from '@/components/postDetail/MapPreview'; | ||
import PostDescription from '@/components/postDetail/PostDesciption'; | ||
import PostTitle from '@/components/postDetail/PostTitle'; | ||
import ReviewList from '@/components/postDetail/ReviewList'; | ||
import { POST_DETAIL_DATA } from '@/constants/mockData/postDetail'; | ||
import { REVIEW_LIST_DATA } from '@/constants/mockData/reviewList'; | ||
|
||
import styles from './PostDetailContent.module.scss'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
const { | ||
title: unrefinedTitle, | ||
description: unrefinedDesc, | ||
category, | ||
price, | ||
address, | ||
bannerImageUrl, | ||
subImageUrls, | ||
} = POST_DETAIL_DATA; | ||
|
||
const nickname = '주인장'; | ||
const email = '[email protected]'; | ||
|
||
const PostContent = () => { | ||
const isImageSlide = subImageUrls.length > 0; | ||
const imageUrls = isImageSlide | ||
? [bannerImageUrl, ...subImageUrls.map((item: { id: number; imageUrl: string }) => item.imageUrl)] | ||
: [bannerImageUrl]; | ||
|
||
const isOffline = price === 0; | ||
const isOnline = price === 1; | ||
const isStrategy = price === 3; | ||
const isReservationAvailable = isOffline || isOnline; | ||
|
||
const { title } = splitTitleByDelimiter(unrefinedTitle); | ||
const { desc, discordLink } = splitDescByDelimiter(unrefinedDesc); | ||
|
||
return ( | ||
<> | ||
<section className={cx('main-banner')}> | ||
<Banner gameName={formatCategoryToGameNameEN(category)} /> | ||
</section> | ||
<section className={cx('main-section')}> | ||
<div className={cx('container')}> | ||
<section className={cx('section-top')}> | ||
<PostTitle price={price} title={title} /> | ||
{isImageSlide ? ( | ||
<ImageSlide imageList={imageUrls} /> | ||
) : ( | ||
<DefaultBanner url={bannerImageUrl} gameName={formatCategoryToGameNameEN(category)} /> | ||
)} | ||
</section> | ||
<section className={cx('section-bottom', { 'no-flex': !isReservationAvailable })}> | ||
<section className={cx('section-left', { 'no-flex': !isReservationAvailable })}> | ||
{isStrategy ? <PostDescription desc={desc} /> : <PostDescription desc={desc} discordLink={discordLink} />} | ||
{isOffline && <MapPreview address={address} />} | ||
{isReservationAvailable && <ReviewList list={REVIEW_LIST_DATA} nickname={nickname} email={email} />} | ||
</section> | ||
{isReservationAvailable && <section></section>} | ||
</section> | ||
</div> | ||
</section> | ||
</> | ||
); | ||
}; | ||
|
||
export default PostContent; |
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 { IMAGE_LIST } from './imageList'; | ||
|
||
export const POST_DETAIL_DATA = { | ||
id: 7, | ||
userId: 21, | ||
title: '투어¿[성인만 가능]카배 CK 클랜원 모집합니다.¿0¿강남 SBXG 포탈 PC방¿3', | ||
description: | ||
'둠칫 둠칫 두둠칫 우리 클랜에 들어오세요\n둠칫 둠칫 두둠칫 우리 클랜에 들어오세요\n둠칫 둠칫 두둠칫 우리 클랜에 들어오세요¿https://github.com/sprint-team3/GGF', | ||
category: '투어', | ||
price: 1, | ||
address: '서울특별시 강남구 테헤란로 427', | ||
bannerImageUrl: IMAGE_LIST[0], | ||
subImageUrls: [ | ||
{ | ||
id: 1, | ||
imageUrl: IMAGE_LIST[1], | ||
}, | ||
{ | ||
id: 2, | ||
imageUrl: IMAGE_LIST[2], | ||
}, | ||
{ | ||
id: 3, | ||
imageUrl: IMAGE_LIST[3], | ||
}, | ||
], | ||
schedules: [ | ||
{ | ||
id: 1, | ||
date: '2023-12-01', | ||
startTime: '12:00', | ||
endTime: '13:00', | ||
}, | ||
{ | ||
id: 2, | ||
date: '2023-12-05', | ||
startTime: '12:00', | ||
endTime: '13:00', | ||
}, | ||
], | ||
reviewCount: 5, | ||
rating: 4, | ||
createdAt: '2023-12-31T21:28:50.589Z', | ||
updatedAt: '2023-12-31T21:28:50.589Z', | ||
}; |
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,10 @@ | ||
import Layout from '@/components/layout/Layout'; | ||
import PostConent from '@/components/postDetail/PostDetailContent'; | ||
|
||
const PostPage = () => { | ||
return <PostConent />; | ||
}; | ||
|
||
export default PostPage; | ||
|
||
PostPage.FullLayout = Layout; |
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