Skip to content

Commit e8ca7de

Browse files
authored
Merge pull request #110 from MBTips/dev
4차 배포 Test (Dev -> Main)
2 parents b358ec4 + 7076804 commit e8ca7de

File tree

3 files changed

+42
-41
lines changed

3 files changed

+42
-41
lines changed

src/pages/Content.tsx

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import instance from "@/api/axios";
12
import Header from "@/components/Header";
23
import React from "react";
34
import { useParams } from "react-router-dom";
@@ -9,18 +10,18 @@ const contentData = [
910
image: {
1011
sm: "/image/home_banner1_sm.png",
1112
md: "/image/home_banner1_md.png",
12-
lg: "/image/home_banner1_lg.png",
13+
lg: "/image/home_banner1_lg.png"
1314
},
1415
subTitle: "",
15-
content: "",
16+
content: ""
1617
},
1718
{
1819
id: 1,
1920
title: "썸탈 때 대화주제 추천 MBTI별 대백과",
2021
image: {
2122
sm: "/image/home_banner2_sm.png",
2223
md: "/image/home_banner2_md.png",
23-
lg: "/image/home_banner2_lg.png",
24+
lg: "/image/home_banner2_lg.png"
2425
},
2526
subTitle: "썸탈 때 대화주제 추천(MBTI별)",
2627
content: `썸 탈 때 이런 주제를 활용해보세요! MBTI 별로 추천드려요. 조금 더 자세한 대화주제 추천을 원한다면? 대화를 시작해보세요~
@@ -87,15 +88,15 @@ const contentData = [
8788
8889
ENTJ (결단력 있는 지휘관):
8990
- "회사에서 좋은 리더란 어떤 리더일까?"
90-
- 설명: 전략적 사고나 리더십에 대한 이야기를 나누는 것을 좋아해요!`,
91+
- 설명: 전략적 사고나 리더십에 대한 이야기를 나누는 것을 좋아해요!`
9192
},
9293
{
9394
id: 2,
9495
title: "MBTI별 피해야 할 대화스타일 및 주제",
9596
image: {
9697
sm: "/image/home_banner3_sm.png",
9798
md: "/image/home_banner3_md.png",
98-
lg: "/image/home_banner3_lg.png",
99+
lg: "/image/home_banner3_lg.png"
99100
},
100101
subTitle: "MBTI 별 피해야할 대화스타일 & 주제",
101102
content: `MBTI 별로 피해야 하는 대화 스타일, 주제를 알아보아요!
@@ -162,66 +163,73 @@ const contentData = [
162163
163164
ENTJ (결단력 있는 지휘관):
164165
- 비효율적이거나 비논리적인 대화.
165-
- 예시 : 목표 달성을 방해하는 비효율적인 논의나, 감정적인 요소를 과도하게 강조하는 것.`,
166-
},
166+
- 예시 : 목표 달성을 방해하는 비효율적인 논의나, 감정적인 요소를 과도하게 강조하는 것.`
167+
}
167168
];
168169

169170
const Content = () => {
170171
const { id } = useParams<{ id: string }>();
171172
const content = contentData[Number(id)];
172173

173174
if (!content) {
174-
return <div className="text-center mt-10">Content not found</div>;
175+
return <div className="mt-10 text-center">Content not found</div>;
175176
}
176177

177-
178-
const handleStartChat = () => {
179-
alert("API 호출");
180-
}
178+
const handleStartChat = async () => {
179+
try {
180+
const response = await instance.post("api/fast-friend");
181+
console.log("Success!!", response.data);
182+
} catch (error) {
183+
console.error("Select Info Error", error);
184+
}
185+
};
181186

182187
const renderContentWithLineBreaks = (text: string) => {
183-
return text.split("\n").map((line, index) => (
184-
<React.Fragment key={index}>
185-
{line.trim() ? <p>{line}</p> : <br />}
186-
</React.Fragment>
187-
));
188+
return text
189+
.split("\n")
190+
.map((line, index) => (
191+
<React.Fragment key={index}>
192+
{line.trim() ? <p>{line}</p> : <br />}
193+
</React.Fragment>
194+
));
188195
};
189196

190197
return (
191198
<div className="flex w-[360px] flex-col bg-white md:w-[375px] lg:w-[500px]">
192199
<Header title="상대방 정보선택" />
193200

194-
<div className="px-5 py-5 flex flex-col gap-[36px]">
195-
201+
<div className="flex flex-col gap-[36px] px-5 py-5">
196202
{/* 상단 배너 */}
197-
<div className="relative bg-gray-100 rounded-[16px] overflow-hidden">
203+
<div className="relative overflow-hidden rounded-[16px] bg-gray-100">
198204
<picture>
199205
<source media="(min-width: 500px)" srcSet={content.image.lg} />
200206
<source media="(min-width: 375px)" srcSet={content.image.md} />
201207
<img
202208
src={content.image.sm}
203209
alt={content.title}
204-
className="w-full h-[156px] object-cover"
210+
className="h-[156px] w-full object-cover"
205211
/>
206212
</picture>
207213
</div>
208214

209215
{/* 서브 제목 */}
210216
{content.subTitle && (
211-
<h2 className="font-bold text-[18px] leading-[27px] tracking[-0.01em] text-gray-900">{content.subTitle}</h2>
217+
<h2 className="tracking[-0.01em] text-[18px] leading-[27px] font-bold text-gray-900">
218+
{content.subTitle}
219+
</h2>
212220
)}
213221

214222
{/* 본문 내용 */}
215-
<div className="font-medium text-lg leading-6 tracking-norma text-gray-900 mb-[1px]">
223+
<div className="tracking-norma mb-[1px] text-lg leading-6 font-medium text-gray-900">
216224
{content.content && renderContentWithLineBreaks(content.content)}
217225
</div>
218226

219227
{/* 하단 버튼 */}
220228
<button
221-
className="w-full my-[22px] h-[60px] bg-primary-normal text-white rounded-[8px] font-bold"
222-
onClick={handleStartChat}
229+
className="my-[22px] h-[60px] w-full rounded-[8px] bg-primary-normal font-bold text-white"
230+
onClick={handleStartChat}
223231
>
224-
대화 시작하기
232+
대화 시작하기
225233
</button>
226234
</div>
227235
</div>

src/pages/SelectInfo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ const SelectInfo = () => {
111111
const mbti = `${selectedMBTI.E}${selectedMBTI.N}${selectedMBTI.F}${selectedMBTI.P}`;
112112

113113
const commonData = {
114-
mbti
114+
mbti,
115+
interests: interest
115116
};
116117

117118
const selectedData =
@@ -122,8 +123,7 @@ const SelectInfo = () => {
122123
age: mapAgeToNumber(age),
123124
relationship,
124125
gender:
125-
gender === "남자" ? "MALE" : gender === "여자" ? "FEMALE" : null,
126-
interests: interest
126+
gender === "남자" ? "MALE" : gender === "여자" ? "FEMALE" : null
127127
}
128128
: {
129129
...commonData,

vite.config.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import fs from "fs";
99

1010
export default defineConfig(({ mode }: { mode: string }) => {
1111
const isProduction = mode === "production";
12+
const keyPath = "./certs/key.pem";
13+
const certPath = "./certs/cert.pem";
1214

1315
return {
1416
server: {
@@ -22,20 +24,15 @@ export default defineConfig(({ mode }: { mode: string }) => {
2224
},
2325
https: isProduction
2426
? undefined // 배포 환경에서는 HTTPS를 비활성화 (Nginx가 처리)
25-
: {
26-
key: fs.readFileSync("./certs/key.pem"),
27-
cert: fs.readFileSync("./certs/cert.pem")
28-
}
27+
: fs.existsSync(keyPath) && fs.existsSync(certPath)
28+
? { key: fs.readFileSync(keyPath), cert: fs.readFileSync(certPath) }
29+
: undefined
2930
},
3031
plugins: [react(), tailwindcss()],
3132
resolve: {
3233
alias: [
3334
{ find: "@/", replacement: path.resolve(__dirname, "src") },
3435
{ find: "@/api", replacement: path.resolve(__dirname, "src/api") },
35-
{
36-
find: "@/api",
37-
replacement: path.resolve(__dirname, "src/api")
38-
},
3936
{
4037
find: "@/components",
4138
replacement: path.resolve(__dirname, "src/components")
@@ -55,10 +52,6 @@ export default defineConfig(({ mode }: { mode: string }) => {
5552
{
5653
find: "@/store",
5754
replacement: path.resolve(__dirname, "src/store")
58-
},
59-
{
60-
find: "@/api",
61-
replacement: path.resolve(__dirname, "src/api")
6255
}
6356
]
6457
}

0 commit comments

Comments
 (0)