Skip to content

Commit 4db2a84

Browse files
authored
Merge pull request #100 from six-goguma/Fix/issue-#99
issue#99 - 코드리뷰 게시물 thumbnail 사진 설정
2 parents 4ddf9ec + 6aee52d commit 4db2a84

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

src/pages/main/components/post-list/PostList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Link } from 'react-router-dom';
22

3+
import { DEFAULT_IMAGE } from '@shared/constants';
34
import { getDynamicPath } from '@shared/utils';
45

56
import { Grid } from '@widgets/grid';
@@ -21,7 +22,7 @@ export const PostList = ({ postData, isPending }: PostListProps) => {
2122
<PostCards
2223
title={post.title}
2324
postId={post.id}
24-
thumbnail={post.thumbnail}
25+
thumbnail={post.thumbnail ?? DEFAULT_IMAGE}
2526
summary={post.summary}
2627
createdAt={post.createdAt}
2728
likeCount={post.likeCount}

src/pages/mypage/components/my-post/MyPostSection.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Link } from 'react-router-dom';
22

33
import { Flex, Text } from '@chakra-ui/react';
44

5+
import { DEFAULT_IMAGE } from '@shared/constants';
56
import { getDynamicPath } from '@shared/utils';
67

78
import { Grid } from '@widgets/grid';
@@ -25,6 +26,7 @@ export const MyPostSection = ({ postUserData, isPending }: MyPostSectionProps) =
2526
</Flex>
2627
);
2728
}
29+
2830
return (
2931
<>
3032
<Tabs />
@@ -36,7 +38,7 @@ export const MyPostSection = ({ postUserData, isPending }: MyPostSectionProps) =
3638
<PostCards
3739
title={post.title}
3840
postId={post.id}
39-
thumbnail={post.thumbnail}
41+
thumbnail={post.thumbnail ?? DEFAULT_IMAGE}
4042
summary={post.summary}
4143
createdAt={post.createdAt}
4244
likeCount={post.likeCount}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const DEFAULT_IMAGE =
2+
'https://algo.knu-soft.site/backend/profile/images/5c8e74a3-11a9-4a07-95ba-29cc3a0300b1_algorithm2.png';

src/shared/constants/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { RouterPath } from './RouterPath';
2+
export * from './DefaultImage';

src/shared/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ export * from './hooks';
44
export * from './lib';
55
export * from './providers';
66
export * from './themes';
7+
export * from './constants';

0 commit comments

Comments
 (0)