Skip to content

Commit 35e71de

Browse files
authored
Merge pull request #471 from velopert/feat/postcard
feat: change card writer name
2 parents 2d39368 + b57601f commit 35e71de

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

src/components/common/FlatPostCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ const FlatPostCard = ({ post, hideUser }: PostCardProps) => {
170170
/>
171171
</VLink>
172172
<div className="username">
173-
<VLink to={`${velogUrl}`}>{post.user.username}</VLink>
173+
<VLink to={`${velogUrl}`}>{post.user.profile.display_name}</VLink>
174174
</div>
175175
</div>
176176
)}

src/components/common/PostCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function PostCard({ post, forHome, forPost }: PostCardProps) {
8383
alt={`user thumbnail of ${post.user.username}`}
8484
/>
8585
<span>
86-
by <b>{post.user.username}</b>
86+
by <b>{post.user.profile.display_name}</b>
8787
</span>
8888
</VLink>
8989
<div className="likes">

src/components/post/PostCommentItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const PostCommentItem: React.FC<PostCommentItemProps> = ({
180180
<div className="comment-info">
181181
<div className="username">
182182
{user ? (
183-
<VLink to={velogLink}>{user.username}</VLink>
183+
<VLink to={velogLink}>{user.profile.display_name}</VLink>
184184
) : (
185185
'알 수 없음'
186186
)}

src/containers/post/RelatedPost.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ function RelatedPost({
4848
return cloned;
4949
}, [data, showAds, adBlocked]);
5050

51-
if (!postWithAds) return null;
51+
// if (!postWithAds) return null;
5252

5353
return (
5454
<>
5555
<Background>
5656
<Title>관심 있을 만한 포스트</Title>
5757
<Wrapper>
58-
<PostCardGrid posts={postWithAds} forPost />
58+
<PostCardGrid posts={postWithAds || []} forPost />
5959
</Wrapper>
6060
</Background>
6161
<PullUp />

src/lib/graphql/__data__/post.data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export const postData: { post: SinglePost } = {
5252
id: '500d0300-c630-11e8-a920-d3b6c9399aff',
5353
thumbnail:
5454
'https://images.velog.io/images/dever/profile/497f3750-0cc7-11e9-b291-5fc487ce9c76/JS.png',
55+
display_name: 'dever',
5556
},
5657
},
5758
text: 'velog에서는 redux를 사용하셨나요 아니면 Mobx를 사용하셨나요??',

src/lib/graphql/post.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export interface Comment {
3131
profile: {
3232
id: string;
3333
thumbnail: string | null;
34+
display_name: string;
3435
};
3536
} | null;
3637
text: string | null;
@@ -165,6 +166,7 @@ export const GET_POST_LIST = gql`
165166
profile {
166167
id
167168
thumbnail
169+
display_name
168170
}
169171
}
170172
url_slug
@@ -191,6 +193,7 @@ export const GET_RECENT_POSTS = gql`
191193
profile {
192194
id
193195
thumbnail
196+
display_name
194197
}
195198
}
196199
url_slug
@@ -218,6 +221,7 @@ export const GET_TRENDING_POSTS = gql`
218221
profile {
219222
id
220223
thumbnail
224+
display_name
221225
}
222226
}
223227
url_slug
@@ -275,6 +279,7 @@ export const READ_POST = gql`
275279
profile {
276280
id
277281
thumbnail
282+
display_name
278283
}
279284
}
280285
text
@@ -365,6 +370,7 @@ export const GET_RECOMMENDED_POST = gql`
365370
profile {
366371
id
367372
thumbnail
373+
display_name
368374
}
369375
}
370376
url_slug
@@ -429,6 +435,7 @@ export const RELOAD_COMMENTS = gql`
429435
profile {
430436
id
431437
thumbnail
438+
display_name
432439
}
433440
}
434441
text
@@ -450,6 +457,7 @@ export const GET_COMMENT = gql`
450457
username
451458
profile {
452459
thumbnail
460+
display_name
453461
}
454462
}
455463
text
@@ -473,6 +481,7 @@ export const GET_REPLIES = gql`
473481
profile {
474482
id
475483
thumbnail
484+
display_name
476485
}
477486
}
478487
text
@@ -614,6 +623,7 @@ export const EDIT_POST = gql`
614623
profile {
615624
id
616625
thumbnail
626+
dispay_name
617627
}
618628
}
619629
text
@@ -658,6 +668,7 @@ export const WRITE_COMMENT = gql`
658668
profile {
659669
id
660670
thumbnail
671+
display_name
661672
}
662673
}
663674
text
@@ -722,6 +733,7 @@ export const SEARCH_POSTS = gql`
722733
profile {
723734
id
724735
thumbnail
736+
display_name
725737
}
726738
}
727739
url_slug
@@ -793,6 +805,7 @@ export const GET_READING_LIST = gql`
793805
profile {
794806
id
795807
thumbnail
808+
display_name
796809
}
797810
}
798811
url_slug

0 commit comments

Comments
 (0)