Skip to content

Commit

Permalink
Merge pull request #89 from jisung-in/88-pivoting
Browse files Browse the repository at this point in the history
๋ฉ”์ธ ํŽ˜์ด์ง€ ๋ฐฐ๋„ˆ ์ปดํฌ๋„ŒํŠธ ์ œ์ž‘ ๋ฐ ํ† ํฌ๋ฃธ ์ƒ์„ฑ ์ „ํŽ˜์ด์ง€ ์ œ์ž‘
  • Loading branch information
SeungHun6450 authored Jun 30, 2024
2 parents ce498f4 + 9741049 commit b42f5dd
Show file tree
Hide file tree
Showing 14 changed files with 237 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const buttonVariants = cva(
variants: {
variant: {
main: "bg-brown-50 text-white hover:bg-brown-60",
empty: "bg-white text-gray-50 border-2 border-gray-40",
empty: "bg-white text-brown-40 border-2 border-brown-40",
none: "text-white",
gray: "text-gray-80 font-[500] border-2",
ivory: "bg-ivory-40 text-brown-50",
Expand Down
86 changes: 86 additions & 0 deletions src/app/components/MainSelectionCard/MainSelectionCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import RecordComponent from "@/assets/img/record.svg";
import QuestionComponent from "@/assets/img/question.svg";
import EvaluationComponent from "@/assets/img/evalutaion.svg";
import clsx from "clsx";

type MainSelectionCardType = {
isMain: boolean;
type:
| "record"
| "question"
| "evaluation"
| "smallerRecord"
| "smallerQuestion"
| "smallerEvaluation";
rounded: boolean;
};

const obj = {
record: {
color: "#C08CF8",
file: <RecordComponent className="w-40 h-40" />,
text: "๊ธฐ๋ก",
},
question: {
color: "#FFCE55",
file: <QuestionComponent className="w-40 h-40" />,
text: "์งˆ๋ฌธ",
},
evaluation: {
color: "#FF9597",
file: <EvaluationComponent className="w-40 h-40" />,
text: "ํ‰๊ฐ€",
},
smallerRecord: {
color: "#C08CF8",
file: <RecordComponent className="w-8 h-8" />,
text: "๊ธฐ๋ก",
},
smallerQuestion: {
color: "#FFCE55",
file: <QuestionComponent className="w-8 h-8" />,
text: "์งˆ๋ฌธ",
},
smallerEvaluation: {
color: "#FF9597",
file: <EvaluationComponent className="w-6 h-6" />,
text: "ํ‰๊ฐ€",
},
};

const MainSelectionCard = ({
isMain,
type,
rounded,
}: MainSelectionCardType) => {
const { color, file, text } = obj[type];

if (isMain) {
return (
<div
className="flex flex-col rounded-lg flex-1 text-brown-60 hover:text-white duration-200 cursor-pointer"
style={{ backgroundColor: color }}
>
<span className="flex w-full text-[40px] pl-4 pt-4 font-bold">
{text}
</span>
<div className="flex w-full justify-end pr-4">{file}</div>
</div>
);
}

return (
<div
className={clsx(
"flex items-center justify-center rounded-lg p-2 px-4 gap-2",
rounded && "rounded-[40px]",
)}
style={{ backgroundColor: color }}
>
<span className="flex text-[25px] font-bold text-brown-60">{text}</span>
{file}
</div>
);
};

export default MainSelectionCard;
69 changes: 69 additions & 0 deletions src/app/detail/talkroom/_component/TalkRoomSelection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"use client";

import { Button } from "@/app/components/Button/Button";
import MainSelectionCard from "@/app/components/MainSelectionCard/MainSelectionCard";
import BackButton from "@/app/summary/_component/BackButton";
import clsx from "clsx";
import { useState } from "react";
import TalkRoomIcon from "@/assets/img/talk-icon.svg";

const TalkRoomSelection = () => {
const [selection, setSelection] = useState("record");

return (
<div className="flex flex-col w-full min-h-[800px] bg-white px-[20%] py-10">
<BackButton />

<span className="flex items-center gap-4 text-[30px] font-bold py-4 border-b-[1px]">
ํ† ํฌ๋ฐฉ ์ƒ์„ฑ
<TalkRoomIcon />
</span>
<div className="flex flex-col gap-8">
<div
className={clsx(
"flex items-center hover:bg-purple-40 duration-500 hover:border-purple-50 cursor-pointer border-2 rounded-xl p-2 gap-4 text-lg font-bold text-gray-60",
selection === "record" &&
"bg-purple-40 border-purple-50 text-[#000000]",
)}
onClick={() => setSelection("record")}
>
<MainSelectionCard
isMain={false}
type="smallerRecord"
rounded={true}
/>
<span>
๋…์„œ ๊ธฐ๋ก์„ ํ˜ผ์ž์„œ ํ•  ์ˆ˜ ์žˆ๋Š” ๊ณต๊ฐ„์œผ๋กœ, ์ฑ…์„ ์„ ํƒํ•œ ํ›„ ์ฑ…์— ๋Œ€ํ•œ
๋‚ด์šฉ์„ ์Šคํฌ๋žฉ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
</span>
</div>
<div
className={clsx(
"flex items-center hover:bg-yellow-40 duration-500 hover:border-yellow-50 cursor-pointer border-2 rounded-xl p-2 gap-4 text-lg font-bold text-gray-60",
selection === "question" &&
"text-[#000000] bg-yellow-40 border-yellow-50",
)}
onClick={() => setSelection("question")}
>
<MainSelectionCard
isMain={false}
type="smallerQuestion"
rounded={true}
/>
<span>
์ฑ…์— ๊ด€๋ จํ•œ ์งˆ๋ฌธ์„ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ๋Š” ๊ณต๊ฐ„์œผ๋กœ, ์ฑ…์„ ์„ ํƒ ํ›„ ์ฑ…์— ๋Œ€ํ•œ
์งˆ๋ฌธ์„ ์ž‘์„ฑํ•ด๋ณด์„ธ์š”.
</span>
</div>
</div>

<div className="flex w-full justify-end pt-8">
<div className="w-[100px]">
<Button variant="empty">๋‹ค์Œ</Button>
</div>
</div>
</div>
);
};

export default TalkRoomSelection;
4 changes: 3 additions & 1 deletion src/app/detail/talkroom/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Input } from "@/app/components/Input/Input";
import BackButton from "@/app/summary/_component/BackButton";
import { BUTTON_INDEX } from "@/constants/buttonIndex";
import { Textarea } from "@/app/components/Textarea/Textarea";
import { ChangeEvent, useRef, useState } from "react";
import { ChangeEvent, useEffect, useRef, useState } from "react";
import { BookInfo } from "@/hook/reactQuery/search/useGetKakaoResults";
import ConditionButtons from "@/app/components/molecules/ConditionButtons/ConditionButtons";
import { useCreateRoom } from "@/hook/reactQuery/talkRoom/useCreateRoom";
Expand Down Expand Up @@ -71,6 +71,8 @@ const NewTalkRoom = () => {
router.back();
};

useEffect(() => {}, []);

return (
<main className="flex flex-col w-full p-8">
<BackButton />
Expand Down
4 changes: 3 additions & 1 deletion src/app/detail/talkroom/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import TalkRoomSelection from "./_component/TalkRoomSelection";

const TalkRoom = () => {
return <div></div>;
return <TalkRoomSelection />;
};

export default TalkRoom;
4 changes: 3 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export default function RootLayout({
<ReactQueryProvider>
<ReduxProvider>
<Header />
<div className="flex flex-grow flex-col w-[100%]">{children}</div>
<div className="flex flex-grow flex-col w-[100%] h-full">
{children}
</div>
<Footer />
</ReduxProvider>
</ReactQueryProvider>
Expand Down
10 changes: 10 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import ResizeImage from "./components/ResizeImage/ResizeImage";
import RankSwiper from "./components/Swiper/RankSwiper";
import TalkRoomCardSwiper from "./components/Swiper/TalkRoomCardSwiper";
import { ThemeMain } from "./components/Theme/Theme";
import MainSelectionCard from "./components/MainSelectionCard/MainSelectionCard";
type TalkRoom = {
id: number;
profileImage: string;
Expand Down Expand Up @@ -112,6 +113,15 @@ const page = () => {
xl:mb-[24px]
xl2:mb-[26px]"
>
<div className="flex w-full gap-[2%] pb-4">
<MainSelectionCard isMain={true} rounded={false} type="record" />
<MainSelectionCard isMain={true} rounded={false} type="question" />
<MainSelectionCard
isMain={true}
rounded={false}
type="evaluation"
/>
</div>
<ThemeMain>
<ThemeMain.MainTheme>
<div
Expand Down
Loading

0 comments on commit b42f5dd

Please sign in to comment.