From 17f52d57727461b8b9148047caa58db90f8556e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=95=9C=EC=9E=88=EB=8A=94-=EC=9C=A0=EC=A0=80?= =?UTF-8?q?=EB=84=A4=EC=9E=84?= Date: Tue, 21 Oct 2025 10:43:51 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20profile=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Profile.tsx | 28 ++++++++++++++++++++++++++-- src/types/virtualFreind.ts | 2 +- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/components/Profile.tsx b/src/components/Profile.tsx index d580e7f..e22e8a5 100644 --- a/src/components/Profile.tsx +++ b/src/components/Profile.tsx @@ -92,7 +92,31 @@ const Profile = ({ const getDescription = () => { if (mode === "friend" && info) { - return `${info.virtualFriendAge} · ${info.virtualFriendSex} · ${info.virtualFriendRelationship}`; + const parts = []; + + // 나이 처리 (0이면 추가하지 않음) + if (info.virtualFriendAge && info.virtualFriendAge > 0) { + parts.push(`${info.virtualFriendAge}대`); + } + + // 성별 처리 + if (info.virtualFriendSex === "FEMALE") { + parts.push("여성"); + } else if (info.virtualFriendSex === "MALE") { + parts.push("남성"); + } + + // 관계 추가 + if (info.virtualFriendJob) { + parts.push(info.virtualFriendJob); + } + + // 모든 데이터가 없으면 기본 메시지 반환 + if (parts.length === 0) { + return "이 친구 추가 정보를 선택하지 않았어요"; + } + + return parts.join(" · "); } else if (mode === "topic" && topicData) { return topicData.description; } @@ -122,7 +146,7 @@ const Profile = ({ className="absolute top-[12px] left-[11px] h-12 w-12 rounded-full object-cover" /> -
+

{getTitle()} {getSubtitle() && ( diff --git a/src/types/virtualFreind.ts b/src/types/virtualFreind.ts index 3292655..57d9000 100644 --- a/src/types/virtualFreind.ts +++ b/src/types/virtualFreind.ts @@ -5,5 +5,5 @@ export interface VirtualFriend { virtualFriendName: string; virtualFriendAge: number; virtualFriendSex: string; - virtualFriendRelationship: string; + virtualFriendJob: string; } From 3f79acfb7e783db96e4a8c1d0327444c28ab8108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=95=9C=EC=9E=88=EB=8A=94-=EC=9C=A0=EC=A0=80?= =?UTF-8?q?=EB=84=A4=EC=9E=84?= Date: Tue, 21 Oct 2025 10:46:28 +0900 Subject: [PATCH 2/2] fix: modify type --- src/pages/SelectInfo.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/SelectInfo.tsx b/src/pages/SelectInfo.tsx index 9555f1b..767200d 100644 --- a/src/pages/SelectInfo.tsx +++ b/src/pages/SelectInfo.tsx @@ -30,7 +30,7 @@ type VirtualFriendResponse = { virtualFriendName: string; virtualFriendAge: number; virtualFriendSex: "MALE" | "FEMALE"; - virtualFriendRelationship: string; + virtualFriendJob: string; }; };