Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-full bg-white 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
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
3 changes: 2 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ body {
}

main {
margin-top: 54px;
background-color: white;
font-size: 14px;
width: 100vh;
width: 100vw;
max-width: 500px;

@media screen and (min-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-full flex-col bg-white 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
24 changes: 9 additions & 15 deletions src/pages/ChatTips.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,16 @@ const ChatTips = () => {
<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
4 changes: 2 additions & 2 deletions src/pages/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const Content = () => {
<div className="flex w-full flex-col bg-white lg:w-[500px]">
<Header title="콘텐츠" />

<div className="flex flex-col gap-[36px] px-5 py-5">
<main className="flex flex-col gap-[36px] px-5 py-5">
{/* 상단 배너 */}
<div className="relative overflow-hidden rounded-[16px] bg-gray-100">
<picture>
Expand Down Expand Up @@ -104,7 +104,7 @@ const Content = () => {
>
대화 시작하기
</button>
</div>
</main>
</div>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Home = () => {
<section aria-label="콘텐츠 배너">
<Banner />
</section>
<section className="mt-5 w-full" aria-label="빠른 대화">
<section className="mt-5" aria-label="빠른 대화">
<div className="w-full px-[20px] py-[13px]">
<SubTitle mode="빠른대화" />
</div>
Expand All @@ -56,7 +56,7 @@ const Home = () => {
</div>
</section>
<section aria-label="친구 목록">
<div className="w-full px-[20px] py-[21px]">
<div className="px-[20px] py-[21px]">
<SubTitle mode="친구목록" />
</div>
<div className="flex justify-center pb-[127px]">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Login = () => {
<meta property="twitter:description" content="로그인/회원가입" />
</Helmet>

<main className="flex h-[812px] flex-col items-center bg-white">
<main className="!mt-0 flex h-[812px] flex-col items-center bg-white">
<img
src={isPC ? "/image/login/banner_lg.png" : "/image/login/banner.png"}
alt="로그인 페이지 이미지"
Expand Down
Loading