Skip to content

Commit ce521e4

Browse files
authored
Merge pull request #313 from MBTips/dev
Phase 2 Prod 배포 6차
2 parents 5093b48 + 330cf98 commit ce521e4

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

src/components/Profile.tsx

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,31 @@ const Profile = ({
9292

9393
const getDescription = () => {
9494
if (mode === "friend" && info) {
95-
return `${info.virtualFriendAge} · ${info.virtualFriendSex} · ${info.virtualFriendRelationship}`;
95+
const parts = [];
96+
97+
// 나이 처리 (0이면 추가하지 않음)
98+
if (info.virtualFriendAge && info.virtualFriendAge > 0) {
99+
parts.push(`${info.virtualFriendAge}대`);
100+
}
101+
102+
// 성별 처리
103+
if (info.virtualFriendSex === "FEMALE") {
104+
parts.push("여성");
105+
} else if (info.virtualFriendSex === "MALE") {
106+
parts.push("남성");
107+
}
108+
109+
// 관계 추가
110+
if (info.virtualFriendJob) {
111+
parts.push(info.virtualFriendJob);
112+
}
113+
114+
// 모든 데이터가 없으면 기본 메시지 반환
115+
if (parts.length === 0) {
116+
return "이 친구 추가 정보를 선택하지 않았어요";
117+
}
118+
119+
return parts.join(" · ");
96120
} else if (mode === "topic" && topicData) {
97121
return topicData.description;
98122
}
@@ -122,7 +146,7 @@ const Profile = ({
122146
className="absolute top-[12px] left-[11px] h-12 w-12 rounded-full object-cover"
123147
/>
124148

125-
<div className="px-4 pt-[69px]">
149+
<div className="px-4 pt-[60px]">
126150
<h2 className="flex items-center space-x-1 text-base">
127151
<span className="font-bold">{getTitle()}</span>
128152
{getSubtitle() && (

src/pages/SelectInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type VirtualFriendResponse = {
3030
virtualFriendName: string;
3131
virtualFriendAge: number;
3232
virtualFriendSex: "MALE" | "FEMALE";
33-
virtualFriendRelationship: string;
33+
virtualFriendJob: string;
3434
};
3535
};
3636

src/types/virtualFreind.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export interface VirtualFriend {
55
virtualFriendName: string;
66
virtualFriendAge: number;
77
virtualFriendSex: string;
8-
virtualFriendRelationship: string;
8+
virtualFriendJob: string;
99
}

0 commit comments

Comments
 (0)