Skip to content
7 changes: 5 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,15 @@ const App = () => {

<Helmet>
<meta property="og:title" content="MBTips_MBTI AI 대화 시뮬레이션" />
<meta property="og:image" content="%PUBLIC_URL%/image/og_image.png" />
<meta
property="og:image"
content={`${import.meta.env.VITE_API_BASE_URL}image/og_image.png`}
/>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="MBTips_MBTI AI 대화 시뮬레이션" />
<meta
property="twitter:image"
content="%PUBLIC_URL%/image/og_image.png"
content={`${import.meta.env.VITE_API_BASE_URL}image/og_image.png`}
/>
</Helmet>

Expand Down
6 changes: 3 additions & 3 deletions src/components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Banner = () => {
}, []);

return (
<div className="relative flex h-[184px] w-full">
<div className="relative h-[184px] w-screen max-w-[500px]">
<Link
to={order === 0 ? "/mbti-test" : `/contents/${order}`}
className="absolute h-full w-full"
Expand All @@ -67,11 +67,11 @@ const Banner = () => {
)}
>
<source media="(min-width: 500px)" srcSet={image.lg} />
<source media="(min-width: 375px)" srcSet={image.md} />
<source media="(min-width: 375px)" srcSet={image.sm} />
<img
src={image.sm}
alt={image.description}
className="h-full w-full object-cover"
className="h-full w-full"
/>
</picture>
))}
Expand Down
4 changes: 3 additions & 1 deletion src/components/CenteredLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ interface CenteredLayoutProps {

const CenteredLayout = ({ children }: CenteredLayoutProps) => (
<div className="flex min-h-screen w-screen justify-center bg-gray-50">
<div className="flex w-full justify-center bg-gray-50">{children}</div>
<div className="flex w-full flex-col bg-white lg:w-[500px] ">
{children}
</div>
</div>
);

Expand Down
5 changes: 2 additions & 3 deletions src/components/ChatActionBar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ChangeEvent, KeyboardEvent } from "react";
import ToggleChatTipsButton from "@/components/button/ToggleChatTipsButton";
import MessageInput from "@/components/input/MessageInput";
import TipsMenuContainer from "@/components/tips/TipsMenuContainer";

interface ChatActionProps {
isOpen: boolean;
Expand All @@ -21,7 +20,7 @@ const ChatActionBar = ({
onSend
}: ChatActionProps) => {
return (
<div className="flex h-[68px] w-full items-center justify-center border-t border-gray-100 bg-white">
<section className="flex h-[68px] w-full items-center justify-center border-t border-gray-100 bg-white">
<ToggleChatTipsButton isOpen={isOpen} setIsOpen={setIsOpen} />
<MessageInput value={value} onChange={onChange} onKeyUp={onKeyUp} />
<img
Expand All @@ -32,7 +31,7 @@ const ChatActionBar = ({
width={40}
height={40}
/>
</div>
</section>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/button/ChatStartButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ChatStartButton = ({ mode, mbti }: ChatStartButtonProps) => {
};
return (
<button
className="flex h-[56px] w-[320px] items-center justify-center rounded-lg bg-primary-normal font-bold text-white md:w-[335px] lg:w-[460px]"
className="flex h-[56px] w-full items-center justify-center rounded-lg bg-primary-normal font-bold text-white lg:w-[460px]"
onClick={handleNavigate}
>
대화 시작하기
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/LoginButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const LoginButton = () => {

return (
<a href="/login" onClick={handleClick}>
<button className="h-[36px] w-[69px] rounded-lg border-[0.8px] border-gray-300 text-md font-bold text-gray-600">
<button className="mr-5 h-[36px] w-[69px] rounded-lg border-[0.8px] border-gray-300 text-md font-bold text-gray-600">
로그인
</button>
</a>
Expand Down
11 changes: 3 additions & 8 deletions src/components/header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ReactNode } from "react";
import { useLocation } from "react-router-dom";
import SubHeader from "@/components/header/SubHeader";
import MainHeader from "@/components/header/MainHeader";
Expand All @@ -8,22 +7,20 @@ type HeaderProps = {
title?: string;
showPreviousIcon?: boolean;
showShareIcon?: boolean;
children?: ReactNode;
};

const Header = ({
title = "",
showPreviousIcon = true,
showShareIcon = true,
children
showShareIcon = true
}: HeaderProps) => {
const { pathname } = useLocation();
const { isLoggedIn } = useAuthStore();
const isHomepage = pathname === "/";

return (
<>
<div className="fixed z-50 w-[360px] bg-white md:w-[375px] lg:w-[500px]">
<header className="fixed top-0 z-50 w-full bg-white lg:w-[500px]">
{isHomepage ? (
<MainHeader isLoggedIn={isLoggedIn} />
) : (
Expand All @@ -33,9 +30,7 @@ const Header = ({
showShareIcon={showShareIcon}
/>
)}
</div>

<div className="pt-14">{children}</div>
</header>
</>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/MainHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const MainHeader = ({ isLoggedIn }: { isLoggedIn: boolean }) => {
};

return (
<header className="flex h-[56px] w-full items-center justify-between bg-white pl-5">
<div className="flex h-[56px] w-full items-center justify-between bg-white pl-5">
<Link to="/" className="flex items-center">
<img
src="/public/icon/mbtipslogo.svg"
Expand All @@ -32,7 +32,7 @@ const MainHeader = ({ isLoggedIn }: { isLoggedIn: boolean }) => {
onClick={handleNavigate}
/>
)}
</header>
</div>
);
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/header/SubHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const SubHeader = ({

return (
<>
<header className="relative flex h-[56px] w-full items-center justify-between border-b border-gray-100 bg-white">
<div className="relative flex h-[56px] w-full items-center justify-between border-b border-gray-100 bg-white">
{showPreviousIcon && (
<img
src="/public/icon/arrow_left.svg"
Expand Down Expand Up @@ -85,7 +85,7 @@ const SubHeader = ({
/>
</button>
)}
</header>
</div>

{isLeaveChatModalOpen && (
<ActionConfirmModal
Expand Down
42 changes: 21 additions & 21 deletions src/components/modal/TermsAndPrivacyModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@ const TermsAndPrivacyModal = ({
closeModal
}: {
mode: "terms" | "privacy";
closeModal: ()=>void;
closeModal: () => void;
}) => {
const title = mode === "terms" ? "이용약관" : "개인정보처리방침";
const description =
mode === "terms"
? TERMS
: PRIVACY;
const description = mode === "terms" ? TERMS : PRIVACY;

const handleOuterClick = () => {
closeModal()
}
const handleOuterClick = () => {
closeModal();
};

const handleInnerClick = (e:MouseEvent) => {
e.stopPropagation();
}
const handleInnerClick = (e: MouseEvent) => {
e.stopPropagation();
};

return (
<div className="inset-0 fixed flex items-center justify-center z-50 bg-black/50" onClick={handleOuterClick}>
<div className="relative rounded-lg flex flex-col items-center w-[360px] h-[476px] bg-white px-[45px] py-[25px] overflow-scroll " onClick={handleInnerClick}>
<h1 className="font-bold text-2xl ">{title}</h1>
<p className="mt-[30px] whitespace-pre-wrap">{description}</p>
<button
onClick={closeModal}
className="absolute top-6 right-4"
<div
className="fixed inset-0 z-50 flex items-center justify-center bg-black/50"
onClick={handleOuterClick}
>
<div
className="relative flex h-[476px] w-[360px] flex-col items-center overflow-scroll rounded-lg bg-white px-[45px] py-[25px] "
onClick={handleInnerClick}
>
<img src="/icon/close.svg" alt="닫기 버튼" width={22} height={22} />
</button>
</div>
<h1 className="text-2xl font-bold ">{title}</h1>
<p className="mt-[30px] whitespace-pre-wrap">{description}</p>
<button onClick={closeModal} className="absolute top-6 right-4">
<img src="/icon/close.svg" alt="닫기 버튼" width={22} height={22} />
</button>
</div>
</div>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/tips/TipsMenuContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const TipsMenuContainer = ({
mbti: string;
}) => {
return (
<>
<section>
<TipsMenu mode="topic" mbti={mbti} />
<TipsMenu mode="conversation" mbti={mbti} />
<TipsMenu mode="temperature" conversationId={conversationId} />
</>
</section>
);
};

Expand Down
16 changes: 6 additions & 10 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@ body {
}

main {
@media screen and (min-width: 360px) {
background-color: white;
font-size: 14px;
width: 360px;
}
@media screen and (min-width: 375px) {
font-size: 16px;
width: 375px;
}
margin-top: 54px;
background-color: white;
font-size: 14px;
width: 100vw;
max-width: 500px;

@media screen and (min-width: 500px) {
font-size: 16px;
width: 500px;
}
}

Expand Down
11 changes: 5 additions & 6 deletions src/pages/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,9 @@ const Chat = () => {
<meta property="twitter:description" content={`${mbti}와의 대화창`} />
</Helmet>

<div className="flex h-screen w-[360px] flex-col bg-white md:w-[375px] lg:w-[500px]">
<Header title={chatTitle} showShareIcon={false}/>

<div className="flex-1 space-y-4 overflow-y-auto px-[20px] pt-6">
<Header title={chatTitle} showShareIcon={false} />
<main>
<section className="h-[calc(100vh-124px)] flex-1 space-y-4 overflow-y-auto px-[20px] pt-6">
<IntroGuide />
{/* 메시지 리스트 */}
{messages.map((msg, idx) => (
Expand All @@ -173,7 +172,7 @@ const Chat = () => {
))}

<div ref={bottomRef} />
</div>
</section>

<ChatActionBar
isOpen={isOpen}
Expand All @@ -185,7 +184,7 @@ const Chat = () => {
/>

{isOpen && <TipsMenuContainer conversationId={id} mbti={mbti} />}
</div>
</main>
</>
);
};
Expand Down
28 changes: 13 additions & 15 deletions src/pages/ChatRecommend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,20 @@ const ChatRecommend = () => {
<meta property="twitter:description" content="대화 주제 추천" />
</Helmet>

<div>
<Header
title="대화 주제 추천"
showPreviousIcon={true}
showShareIcon={true}
<Header
title="대화 주제 추천"
showPreviousIcon={true}
showShareIcon={true}
/>
<main className="mx-auto flex h-screen flex-col px-5 py-6">
<img
src={mbtiImage}
alt="mbti 이미지"
className="h-auto w-full rounded-2xl"
/>
<main className="mx-auto flex h-screen flex-col px-5 py-6">
<img
src={mbtiImage}
alt="mbti 이미지"
className="h-auto w-full rounded-2xl"
/>
<h1 className="mt-9 text-xl font-bold">{title}</h1>
<span className="mt-6 whitespace-pre-wrap">{description}</span>
</main>
</div>
<h1 className="mt-9 text-xl font-bold">{title}</h1>
<span className="mt-6 whitespace-pre-wrap">{description}</span>
</main>
</>
);
};
Expand Down
44 changes: 19 additions & 25 deletions src/pages/ChatTemperature.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,26 @@ const ChatTemperature = () => {
<meta property="twitter:description" content="대화의 온도" />
</Helmet>

<div>
<Header
title="대화 온도"
showPreviousIcon={true}
showShareIcon={true}
<Header title="대화 온도" showPreviousIcon={true} showShareIcon={true} />
<main className="mx-auto flex h-screen flex-col px-5 py-6">
<img
src={"/image/image_온도.png"}
alt="mbti 온도 이미지"
className="h-auto w-full rounded-2xl"
/>
<main className="mx-auto flex h-screen flex-col px-5 py-6">
<img
src={"/image/image_온도.png"}
alt="mbti 온도 이미지"
className="h-auto w-full rounded-2xl"
/>
<h1 className="mt-9 text-xl font-bold">
방금까지 나눈 대화로 온도를 측정했어요!
</h1>
{temperature ? (
<span className="mt-6 whitespace-pre-wrap">
현재까지 나눈 대화의 온도는 {temperature}도에요
</span>
) : (
<span className="mt-6 whitespace-pre-wrap">
...대화의 온도를 불러오는 중
</span>
)}
</main>
</div>
<h1 className="mt-9 text-xl font-bold">
방금까지 나눈 대화로 온도를 측정했어요!
</h1>
{temperature ? (
<span className="mt-6 whitespace-pre-wrap">
현재까지 나눈 대화의 온도는 {temperature}도에요
</span>
) : (
<span className="mt-6 whitespace-pre-wrap">
...대화의 온도를 불러오는 중
</span>
)}
</main>
</>
);
};
Expand Down
Loading