-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 리뷰 탭 상단 부분 퍼블리싱 * feat: 리뷰 목록 퍼블리싱 * feat: 리뷰 바텀시트 퍼블리싱 * feat: 기본 뷰 퍼블리싱 * feat: 편의시설 선택하기 바텀시트 * feat: 편의시설 선택 * feat: textarea state 추가 * feat: img list state 추가 * feat: 바뀐 디자인 적용 * feat: 편의시설 css margin 조절 * feat: textarea focus border * chore: 임시 커밋 * feat: 리뷰 없을 때 화면 퍼블리싱 * feat: 리뷰 없을 때 화면 조건분기 * feat: 평균 rate * feat: 리뷰 개수 * feat: 필터 버튼 재구현 * feat: 리뷰 가이드 구현 * feat: 리뷰 말줄임표 더보기 구현 * feat: img length 9 개까지만 첨부 버튼 띄우기 * feat: 리뷰 등록 토스트 * fix: rem 값 수정 * feat: 리뷰 필터링 구현 * feat: post 객체 미리 만들기 * feat: default 카테고리 로직 구현 * feat: 리뷰 필터 가이드 body overflow hidden 핸들링 * fix: 리뷰 작성 페이지 초기값 선택 없도록 수정 * fix: 토스트 초기값 수정
- Loading branch information
Showing
35 changed files
with
1,416 additions
and
20 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export interface ReviewResponse { | ||
writer: string; | ||
rate: number; | ||
description: string; | ||
convenience: string[]; | ||
imgUrl: string[]; | ||
} |
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,123 @@ | ||
import { css } from '@emotion/react'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
import { ReviewResponse } from '@/types/api/review'; | ||
import { isGuideShown } from '@/utils/storageHideGuide'; | ||
import { | ||
createInitialFilterState, | ||
getFilterList, | ||
} from '@/views/Search/constants/category'; | ||
import { category } from '@/views/Search/types/category'; | ||
|
||
import { STORAGE_KEY } from '../constants/localStorageKey'; | ||
import CategoryBottomSheet from './review/CategoryBottomSheet'; | ||
import Guide from './review/Guide'; | ||
import NoReview from './review/NoReview'; | ||
import ReviewCard from './review/ReviewCard'; | ||
import SelectedCategory from './review/SelectedCategory'; | ||
import TotalReview from './review/TotalReview'; | ||
import TotalScore from './review/TotalScore'; | ||
|
||
const REVIEW_DATA: ReviewResponse[] = [ | ||
{ | ||
writer: '왕이샹', | ||
rate: 5, | ||
description: | ||
'앱에서 보았던 것과 같이 작품마다 점자표지판으로 설명이 있어 시각장애인도 불편하지 않게 관람이 가능했어요. 오디오 가이드 대여 서비스도 제공하니 필요하신 분들은 꼭 대여해서 쓰세요!!앱에서 보았던 것과 같이 작품마다 점자표지판으로 설명이 있어 시각장애인도 불편하지 않게 관람이 가능했어요. 오디오 가이드 대여 서비스도 제공하니 필요하신 분들은 꼭 대여해서 쓰세요!!', | ||
convenience: ['주차장', '경사로'], | ||
imgUrl: ['~~~', '~~~~'], | ||
}, | ||
{ | ||
writer: '왕이샹', | ||
rate: 3, | ||
description: | ||
'앱에서 보았던 것과 같이 작품마다 점자표지판으로 설명이 있어 시각장애인도 불편하지 않게 관람이 가능했어요. 오디오 가이드 대여 서비스도 제공하니 필요하신 분들은 꼭 대여해서 쓰세요!!', | ||
convenience: ['주차장', '경사로'], | ||
imgUrl: ['~~~', '~~~~'], | ||
}, | ||
{ | ||
writer: '왕이샹', | ||
rate: 2, | ||
description: | ||
'앱에서 보았던 것과 같이 작품마다 점자표지판으로 설명이 있어 시각장애인도 불편하지 않게 관람이 가능했어요. 오디오 가이드 대여 서비스도 제공하니 필요하신 분들은 꼭 대여해서 쓰세요!!', | ||
convenience: ['주차장', '경사로'], | ||
imgUrl: ['~~~', '~~~~'], | ||
}, | ||
]; | ||
|
||
const Review = () => { | ||
const [isBottomSheetOpen, setIsBottomSheetOpen] = useState(false); | ||
const [showGuide, setShowGuide] = useState(() => | ||
isGuideShown(STORAGE_KEY.hideReviewFilterGuide), | ||
); | ||
|
||
const [filterState, setFilterState] = useState(() => | ||
createInitialFilterState('physical'), | ||
); | ||
|
||
const openBottomSheet = () => { | ||
setIsBottomSheetOpen(true); | ||
}; | ||
const closeBottomSheet = () => { | ||
setIsBottomSheetOpen(false); | ||
}; | ||
|
||
const handleSetShowGuide = (value: boolean) => { | ||
setShowGuide(value); | ||
document.body.style.overflow = ''; | ||
}; | ||
|
||
const handleFilterState = (category: category, facility: string) => { | ||
const categoryFacilities = filterState[category]; | ||
|
||
setFilterState((prev) => ({ | ||
...prev, | ||
[category]: { | ||
...categoryFacilities, | ||
[facility]: !categoryFacilities[facility], | ||
}, | ||
})); | ||
}; | ||
|
||
const selectedFilterList = getFilterList(filterState); | ||
|
||
if (REVIEW_DATA.length === 0) return <NoReview />; | ||
|
||
useEffect(() => { | ||
if (showGuide) document.body.style.overflow = 'hidden'; | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<TotalScore reviewData={REVIEW_DATA} /> | ||
<TotalReview reviewCount={REVIEW_DATA.length} /> | ||
<SelectedCategory | ||
filterState={filterState} | ||
handleFilterState={handleFilterState} | ||
openBottomSheet={openBottomSheet} | ||
/> | ||
<ul css={reviewCardContainerCss}> | ||
{REVIEW_DATA.filter(({ convenience }) => | ||
convenience.some((c) => selectedFilterList.includes(c)), | ||
).map((item, idx) => { | ||
return <ReviewCard key={idx + item.writer + item.rate} {...item} />; | ||
})} | ||
</ul> | ||
|
||
{showGuide && <Guide handleSetShowGuide={handleSetShowGuide} />} | ||
{isBottomSheetOpen && ( | ||
<CategoryBottomSheet | ||
closeBottomSheet={closeBottomSheet} | ||
filterState={filterState} | ||
handleFilterState={handleFilterState} | ||
/> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default Review; | ||
|
||
const reviewCardContainerCss = css` | ||
padding: 2.3rem 2rem 0; | ||
`; |
Oops, something went wrong.