Skip to content

Commit 03dafdd

Browse files
authored
Merge pull request #94 from Soohyuniii/fix/rename-친구-저장하기-화면의-제목
fix: select info 제목이 mode에 따라 달라지도록 수정
2 parents fd18bad + 585507d commit 03dafdd

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/pages/SelectInfo.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ const SelectInfo = () => {
1111
const isNameRequired = mode === "virtualFriend";
1212
const headerTitle =
1313
mode === "fastFriend" ? "상대방 정보선택" : "친구 저장하기";
14+
const selectInfoTitle =
15+
mode === "fastFriend"
16+
? `상대방의 MBTI를 선택하면\n대화를 시뮬레이션 해볼 수 있어요`
17+
: `친구의 MBTI를\n선택해주세요`;
1418

1519
const [selectedMBTI, setSelectedMBTI] = useState<{
1620
[key: string]: string | null;
@@ -91,7 +95,7 @@ const SelectInfo = () => {
9195
setter(state === value ? null : value);
9296
};
9397

94-
const handleStartChat = async() => {
98+
const handleStartChat = async () => {
9599
const isMBTIComplete = Object.values(selectedMBTI).every(
96100
(val) => val !== null
97101
);
@@ -134,13 +138,11 @@ const SelectInfo = () => {
134138
mode === "virtualFriend" ? "api/virtual-friend" : "api/fast-friend";
135139

136140
try {
137-
const response = await instance.post(`/${apiUrl}`,selectedData);
138-
console.log("Success!!",response.data)
139-
141+
const response = await instance.post(`/${apiUrl}`, selectedData);
142+
console.log("Success!!", response.data);
140143
} catch (error) {
141144
console.error("Select Info Error", error);
142145
}
143-
144146
};
145147

146148
return (
@@ -150,9 +152,8 @@ const SelectInfo = () => {
150152
<div className="mx-auto w-[320px]">
151153
{/* MBTI 선택 */}
152154
<div className="mb-[40px] pt-[48px]">
153-
<p className="text-[20px] leading-[30px] font-bold tracking-[-0.01em]">
154-
상대방의 MBTI를 선택하면 <br />
155-
대화를 시뮬레이션 해볼 수 있어요
155+
<p className="text-[20px] leading-[30px] font-bold tracking-[-0.01em] whitespace-pre-line">
156+
{selectInfoTitle}
156157
</p>
157158

158159
<div className="grid grid-cols-4 gap-[24px_13px] pt-[24px]">

0 commit comments

Comments
 (0)