Skip to content

Commit 542bcc2

Browse files
authored
Merge pull request #582 from solid-connection/fix/community-detail-profile-image
fix: 커뮤니티 상세 기본 프로필 이미지 통일
2 parents 10c8135 + aff10b4 commit 542bcc2

2 files changed

Lines changed: 4 additions & 26 deletions

File tree

‎apps/web/src/app/community/[boardCode]/[postId]/CommentSection.tsx‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ import { useMemo, useState } from "react";
55
import { useDeleteComment } from "@/apis/community";
66
import useBlockCommunityUser from "@/app/community/_hooks/useBlockCommunityUser";
77
import Dropdown from "@/components/ui/Dropdown";
8-
import Image from "@/components/ui/FallbackImage";
9-
import { DEFAULT_PROFILE_IMAGE } from "@/constants/profile";
8+
import ProfileWithBadge from "@/components/ui/ProfileWithBadge";
109
import useReportedPostsStore from "@/lib/zustand/useReportedPostsStore";
1110
import { IconMoreVertFilled, IconSubComment } from "@/public/svgs";
1211
import type { Comment as CommentType, CommunityUser } from "@/types/community";
13-
import { normalizeImageUrlToUploadCdn } from "@/utils/cdnUrl";
1412
import { convertISODateToDateTime } from "@/utils/datetimeUtils";
1513
import CommentInput from "./CommentInput";
1614

@@ -152,15 +150,7 @@ const Comment = ({
152150
const CommentProfile = ({ user }: { user: CommunityUser }) => {
153151
return (
154152
<div className="flex items-center gap-2">
155-
<div className="h-[25px] w-[25px] rounded-full bg-bg-600">
156-
<Image
157-
className="h-full w-full rounded-full"
158-
src={user?.profileImageUrl ? normalizeImageUrlToUploadCdn(user?.profileImageUrl) : DEFAULT_PROFILE_IMAGE}
159-
width={40}
160-
height={40}
161-
alt="alt"
162-
/>
163-
</div>
153+
<ProfileWithBadge profileImageUrl={user?.profileImageUrl} width={25} height={25} />
164154
<div className="overflow-hidden text-black typo-medium-2">{user?.nickname}</div>
165155
</div>
166156
);

‎apps/web/src/app/community/[boardCode]/[postId]/Content.tsx‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { useEffect, useState } from "react";
33
import { useDeleteLike, usePostLike } from "@/apis/community";
44
import Image from "@/components/ui/FallbackImage";
55
import LinkifyText from "@/components/ui/LinkifyText";
6+
import ProfileWithBadge from "@/components/ui/ProfileWithBadge";
67
import { COMMUNITY_MAX_UPLOAD_IMAGES } from "@/constants/community";
7-
import { DEFAULT_PROFILE_IMAGE } from "@/constants/profile";
88
import { showIconToast } from "@/lib/toast/showIconToast";
99
import { IconCloseFilled, IconPostLikeFilled, IconPostLikeOutline } from "@/public/svgs";
1010
import { IconCommunication } from "@/public/svgs/community";
@@ -115,19 +115,7 @@ const Content = ({ post, postId }: ContentProps) => {
115115

116116
<div className="flex h-16 items-center justify-between border-y border-gray-c-100 px-5 py-3">
117117
<div className="flex gap-2.5">
118-
<div className="h-10 w-10 rounded-full bg-bg-600">
119-
<Image
120-
className="h-full w-full rounded-full object-cover"
121-
src={
122-
post.postFindSiteUserResponse.profileImageUrl
123-
? normalizeImageUrlToUploadCdn(post.postFindSiteUserResponse.profileImageUrl)
124-
: DEFAULT_PROFILE_IMAGE
125-
}
126-
width={40}
127-
height={40}
128-
alt=""
129-
/>
130-
</div>
118+
<ProfileWithBadge profileImageUrl={post.postFindSiteUserResponse.profileImageUrl} width={40} height={40} />
131119
<div className="flex flex-col">
132120
<div className="overflow-hidden text-ellipsis font-serif text-black typo-medium-2">
133121
{post.postFindSiteUserResponse.nickname || ""}

0 commit comments

Comments
 (0)