Skip to content

Commit

Permalink
feat: type과 review mock data 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
grapefruit13 committed Mar 24, 2024
1 parent a61d032 commit 6becf18
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
86 changes: 86 additions & 0 deletions src/constants/mockData/reviewList.ts
Original file line number Diff line number Diff line change
@@ -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',
},
],
};
5 changes: 5 additions & 0 deletions src/constants/sortOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
];
20 changes: 20 additions & 0 deletions src/types/myActivities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

0 comments on commit 6becf18

Please sign in to comment.