diff --git a/src/constants/mockData/reviewList.ts b/src/constants/mockData/reviewList.ts new file mode 100644 index 00000000..626e4335 --- /dev/null +++ b/src/constants/mockData/reviewList.ts @@ -0,0 +1,86 @@ +import { USER_DATA } from './headerMockData'; + +export const REVIEW_LIST_DATA = { + averageRating: 4, + totalCount: 6, + reviews: [ + { + id: 1, + user: { + profileImageUrl: USER_DATA.profileImageUrl, + nickname: USER_DATA.nickname, + id: USER_DATA.id, + }, + activityId: 1, + rating: 1, + content: '너무 재밌게 게임했습니다. 다음에 또 하고 싶어요. 최곱니다!!!', + createdAt: '2024-03-22T15:24:25.173Z', + updatedAt: '2024-03-23T15:24:25.173Z', + }, + { + id: 2, + user: { + profileImageUrl: USER_DATA.profileImageUrl, + nickname: USER_DATA.nickname, + id: USER_DATA.id, + }, + activityId: 1, + rating: 5, + content: '너무 재밌게 게임했습니다. 다음에 또 하고 싶어요. 최곱니다!!!', + createdAt: '2024-03-23T15:24:25.173Z', + updatedAt: '2024-03-23T15:24:25.173Z', + }, + { + id: 3, + user: { + profileImageUrl: USER_DATA.profileImageUrl, + nickname: USER_DATA.nickname, + id: USER_DATA.id, + }, + activityId: 1, + rating: 3, + content: '너무 재밌게 게임했습니다. 다음에 또 하고 싶어요. 최곱니다!!!', + createdAt: '2024-03-24T15:24:25.173Z', + updatedAt: '2024-03-23T15:24:25.173Z', + }, + { + id: 4, + user: { + profileImageUrl: USER_DATA.profileImageUrl, + nickname: USER_DATA.nickname, + id: USER_DATA.id, + }, + activityId: 1, + rating: 2, + content: '너무 재밌게 게임했습니다. 다음에 또 하고 싶어요. 최곱니다!!!', + createdAt: '2024-03-25T15:24:25.173Z', + updatedAt: '2024-03-23T15:24:25.173Z', + }, + { + id: 5, + user: { + profileImageUrl: USER_DATA.profileImageUrl, + nickname: USER_DATA.nickname, + id: USER_DATA.id, + }, + activityId: 1, + rating: 2, + content: '너무 재밌게 게임했습니다. 다음에 또 하고 싶어요. 최곱니다!!!', + createdAt: '2024-03-25T15:24:25.173Z', + updatedAt: '2024-03-23T15:24:25.173Z', + }, + { + id: 6, + user: { + profileImageUrl: USER_DATA.profileImageUrl, + nickname: USER_DATA.nickname, + id: USER_DATA.id, + }, + activityId: 1, + rating: 2, + content: '너무 재밌게 게임했습니다. 다음에 또 하고 싶어요. 최곱니다!!!', + createdAt: '2024-03-25T15:24:25.173Z', + updatedAt: '2024-03-23T15:24:25.173Z', + }, + ], +}; diff --git a/src/constants/sortOptions.ts b/src/constants/sortOptions.ts index f8a0e73b..83193e05 100644 --- a/src/constants/sortOptions.ts +++ b/src/constants/sortOptions.ts @@ -4,3 +4,8 @@ export const SORT_OPTIONS = [ { title: '최신순', value: 'desc' as Order }, { title: '오래된순', value: 'asc' as Order }, ]; + +export const REVIEW_SORT_OPTIONS = [ + { title: '평점 높은순', value: 'desc' as Order }, + { title: '평점 낮은순', value: 'asc' as Order }, +]; diff --git a/src/types/myActivities.ts b/src/types/myActivities.ts index 05baa811..bc3a8c8c 100644 --- a/src/types/myActivities.ts +++ b/src/types/myActivities.ts @@ -39,3 +39,23 @@ export type ActivityResponse = { createdAt: string; updatedAt: string; }; + +export type ReviewResponse = { + averageRating: number; + totalCount: number; + reviews: Review[]; +}; + +export type Review = { + id: number; + user: { + profileImageUrl: string; + nickname: string; + id: number; + }; + activityId: number; + rating: number; + content: string; + createdAt: string; + updatedAt: string; +};