Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useState } from "react";
import { useDeleteComment } from "@/apis/community";
import Dropdown from "@/components/ui/Dropdown";
import Image from "@/components/ui/FallbackImage";
import { DEFAULT_PROFILE_IMAGE } from "@/constants/profile";
import { IconMoreVertFilled, IconSubComment } from "@/public/svgs";
import type { Comment as CommentType, CommunityUser } from "@/types/community";
import { convertISODateToDateTime } from "@/utils/datetimeUtils";
Expand Down Expand Up @@ -137,9 +138,7 @@ const CommentProfile = ({ user }: { user: CommunityUser }) => {
<div className="h-[25px] w-[25px] rounded-full bg-bg-600">
<Image
className="h-full w-full rounded-full"
src={
user?.profileImageUrl ? convertUploadedImageUrl(user?.profileImageUrl) : "/images/placeholder/profile64.svg"
}
src={user?.profileImageUrl ? convertUploadedImageUrl(user?.profileImageUrl) : DEFAULT_PROFILE_IMAGE}
width={40}
height={40}
alt="alt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useDeleteLike, usePostLike } from "@/apis/community";
import Image from "@/components/ui/FallbackImage";
import LinkifyText from "@/components/ui/LinkifyText";
import { COMMUNITY_MAX_UPLOAD_IMAGES } from "@/constants/community";
import { DEFAULT_PROFILE_IMAGE } from "@/constants/profile";
import { IconCloseFilled, IconPostLikeFilled, IconPostLikeOutline } from "@/public/svgs";
import { IconCommunication } from "@/public/svgs/community";
import type { PostImage as PostImageType, Post as PostType } from "@/types/community";
Expand Down Expand Up @@ -117,7 +118,7 @@ const Content = ({ post, postId }: ContentProps) => {
src={
post.postFindSiteUserResponse.profileImageUrl
? convertUploadedImageUrl(post.postFindSiteUserResponse.profileImageUrl)
: "/images/placeholder/profile64.svg"
: DEFAULT_PROFILE_IMAGE
}
width={40}
height={40}
Expand Down
27 changes: 12 additions & 15 deletions apps/web/src/components/ui/ProfileWithBadge.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Image from "@/components/ui/FallbackImage";
import { IconDefaultProfile, IconGraduation } from "@/public/svgs/mentor";
import { DEFAULT_PROFILE_IMAGE } from "@/constants/profile";
import { IconGraduation } from "@/public/svgs/mentor";

interface ProfileWithBadgeProps {
profileImageUrl?: string | null;
Expand Down Expand Up @@ -28,20 +29,16 @@ const ProfileWithBadge = ({
hasBadge ? "border-2 border-primary-1" : "border border-gray-200"
}`}
>
{profileImageUrl ? (
<Image
unoptimized
src={profileImageUrl}
cdnHostType="upload"
alt="프로필 이미지"
width={width}
height={height}
className="h-full w-full object-cover"
fallbackSrc="/images/placeholder/profile112.png"
/>
) : (
<IconDefaultProfile />
)}
<Image
unoptimized
src={profileImageUrl || DEFAULT_PROFILE_IMAGE}
cdnHostType={profileImageUrl ? "upload" : undefined}
alt="프로필 이미지"
width={width}
height={height}
className="h-full w-full object-cover"
fallbackSrc={DEFAULT_PROFILE_IMAGE}
/>
</div>

{/* 학습 상태 배지 */}
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/constants/profile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const DEFAULT_PROFILE_IMAGE = "/images/placeholder/profile64.svg";
Loading