File tree Expand file tree Collapse file tree 13 files changed +134
-63
lines changed
Expand file tree Collapse file tree 13 files changed +134
-63
lines changed Original file line number Diff line number Diff line change 11import { ChangeEvent , KeyboardEvent } from "react" ;
22import ToggleChatTipsButton from "@/components/button/ToggleChatTipsButton" ;
33import MessageInput from "@/components/input/MessageInput" ;
4+ import TipsMenuContainer from "@/components/tips/TipsMenuContainer" ;
45
56interface ChatActionProps {
67 isOpen : boolean ;
Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ const StrokeBanner = () => {
2323 친구 정보를 저장하고 대화할 수 있어요
2424 </ strong >
2525 < p className = "mt-2 text-sm font-light text-gray-900" >
26- 로그인 시 기억하고 싶은 친구의 MBTI와 특징을 입력해서 빠르게 대화할 수
27- 있어요
26+ 로그인 시 기억하고 싶은 친구의 MBTI와 특징을
27+ < br />
28+ 입력해서 빠르게 대화할 수 있어요
2829 </ p >
2930 </ div >
3031 ) ;
Original file line number Diff line number Diff line change @@ -8,13 +8,15 @@ const ToggleChatTipsButton = ({
88 setIsOpen
99} : ToggleChatTipsButtonProps ) => {
1010 return (
11- < img
12- src = { isOpen ? "/icon/close.svg" : "/icon/plus.svg" }
13- onClick = { ( ) => setIsOpen ( ! isOpen ) }
14- alt = "토글 메뉴 버튼"
15- width = { 14 }
16- height = { 14 }
17- />
11+ < button >
12+ < img
13+ src = { isOpen ? "/icon/close.svg" : "/icon/plus.svg" }
14+ onClick = { ( ) => setIsOpen ( ! isOpen ) }
15+ alt = "토글 메뉴 버튼"
16+ width = { 14 }
17+ height = { 14 }
18+ />
19+ </ button >
1820 ) ;
1921} ;
2022
Original file line number Diff line number Diff line change 1+ import { ReactNode } from "react" ;
12import { useLocation } from "react-router-dom" ;
23import SubHeader from "@/components/header/SubHeader" ;
34import MainHeader from "@/components/header/MainHeader" ;
@@ -7,25 +8,35 @@ type HeaderProps = {
78 title ?: string ;
89 showPreviousIcon ?: boolean ;
910 showShareIcon ?: boolean ;
11+ children ?: ReactNode ;
1012} ;
1113
1214const Header = ( {
1315 title = "" ,
1416 showPreviousIcon = true ,
15- showShareIcon = false
17+ showShareIcon = false ,
18+ children
1619} : HeaderProps ) => {
1720 const { pathname } = useLocation ( ) ;
1821 const { isLoggedIn } = useAuthStore ( ) ;
1922 const isHomepage = pathname === "/" ;
2023
21- return isHomepage ? (
22- < MainHeader isLoggedIn = { isLoggedIn } />
23- ) : (
24- < SubHeader
25- title = { title }
26- showPreviousIcon = { showPreviousIcon }
27- showShareIcon = { showShareIcon }
28- />
24+ return (
25+ < >
26+ < div className = "fixed z-50 w-[360px] bg-white md:w-[375px] lg:w-[500px]" >
27+ { isHomepage ? (
28+ < MainHeader isLoggedIn = { isLoggedIn } />
29+ ) : (
30+ < SubHeader
31+ title = { title }
32+ showPreviousIcon = { showPreviousIcon }
33+ showShareIcon = { showShareIcon }
34+ />
35+ ) }
36+ </ div >
37+
38+ < div className = "pt-14" > { children } </ div >
39+ </ >
2940 ) ;
3041} ;
3142
Original file line number Diff line number Diff line change @@ -56,13 +56,13 @@ const SubHeader = ({
5656 src = "/public/icon/arrow_left.svg"
5757 alt = "Go To Back"
5858 className = "absolute left-[18.77px] cursor-pointer"
59- width = { 9.87 }
59+ width = { 9 }
6060 height = { 16 }
6161 onClick = { handleGoBack }
6262 />
6363 ) }
6464
65- < h1 className = "absolute left-1/2 -translate-x-1/2 transform text-[18px] font-bold text-gray-900" >
65+ < h1 className = "absolute left-1/2 -translate-x-1/2 transform font-bold text-gray-900" >
6666 { title }
6767 </ h1 >
6868
Original file line number Diff line number Diff line change @@ -19,10 +19,13 @@ const ActionConfirmModal = ({
1919} : AlertProps ) => {
2020 return (
2121 < div
22- className = "absolute inset-0 z-50 flex items-center justify-center bg-black/50"
22+ className = "fixed inset-0 z-50 flex items-center justify-center bg-black/50"
2323 onClick = { onCancel }
2424 >
25- < div className = "flex h-[200px] w-[294px] flex-col items-center justify-center rounded-2xl bg-white" >
25+ < div
26+ className = "flex h-[200px] w-[294px] flex-col items-center justify-center rounded-2xl bg-white"
27+ onClick = { ( e ) => e . stopPropagation ( ) }
28+ >
2629 < h3 className = "text-2xl font-bold" > { title } </ h3 >
2730 < p className = "mt-[9px] text-center text-xl font-medium" >
2831 { message . map ( ( line , index ) => (
Original file line number Diff line number Diff line change 1+ import { Link } from "react-router-dom" ;
2+
13const TipsMenu = ( {
24 mode
35} : {
46 mode : "topic" | "conversation" | "temporature" ;
57} ) => {
68 let text = "" ;
79 let imageUrl = "" ;
10+ let href = "" ;
11+
812 switch ( mode ) {
913 case "topic" :
1014 text = "대화 주제 추천" ;
1115 imageUrl = "/icon/starbubble.svg" ;
16+ href = "/chat-recommend" ;
1217 break ;
1318 case "conversation" :
1419 text = "대화 꿀팁" ;
1520 imageUrl = "/icon/lightbulb.svg" ;
21+ href = "/chat-tips" ;
1622 break ;
1723 case "temporature" :
1824 text = "현재 대화의 온도 측정하기" ;
1925 imageUrl = "/icon/thermometer.svg" ;
26+ href = "/chat-temporature" ;
2027 break ;
2128 default :
2229 return ;
2330 }
2431
2532 return (
26- < div className = "flex bg-white px-4 py-4 border-gray-100 border-b w-[375px] h-[56px]" >
27- < img src = { imageUrl } alt = { text } width = { 20 } height = { 20 } />
28- < h2 className = "ml-[22px] font-medium text-2lg text-gray-800" > { text } </ h2 >
29- </ div >
33+ < Link to = { href } >
34+ < div className = "flex h-[56px] w-full border-t border-gray-100 bg-white px-4 py-4 hover:bg-primary-pale" >
35+ < img src = { imageUrl } alt = { text } width = { 20 } height = { 20 } />
36+ < h2 className = "text-2lg ml-[22px] font-medium text-gray-800" > { text } </ h2 >
37+ </ div >
38+ </ Link >
3039 ) ;
3140} ;
3241
Original file line number Diff line number Diff line change 1+ import TipsMenu from "@/components/tips/TipsMenu" ;
2+
3+ const TipsMenuContainer = ( ) => {
4+ return (
5+ < >
6+ < TipsMenu mode = "topic" />
7+ < TipsMenu mode = "conversation" />
8+ < TipsMenu mode = "temporature" />
9+ </ >
10+ ) ;
11+ } ;
12+
13+ export default TipsMenuContainer ;
Original file line number Diff line number Diff line change @@ -30,18 +30,31 @@ body {
3030
3131main {
3232 @media screen and (min-width : 360px ) {
33+ font-size : 14px ;
3334 width : 360px ;
34-
3535 }
3636 @media screen and (min-width : 375px ) {
37+ font-size : 16px ;
3738 width : 375px ;
38-
3939 }
4040 @media screen and (min-width : 500px ) {
41+ font-size : 16px ;
4142 width : 500px ;
4243 }
4344}
4445
46+ header {
47+ @media screen and (min-width : 360px ) {
48+ font-size : 16px ;
49+ }
50+ @media screen and (min-width : 375px ) {
51+ font-size : 18px ;
52+ }
53+ @media screen and (min-width : 500px ) {
54+ font-size : 18px ;
55+ }
56+ }
57+
4558input : focus {
4659 outline : none;
4760}
@@ -55,7 +68,6 @@ button:hover {
5568}
5669
5770@keyframes pulse-custom {
58-
5971 0% ,
6072 100% {
6173 transform : scale (1 );
@@ -87,4 +99,4 @@ button:hover {
8799 * {
88100 @apply transition-transform duration-200 ease-in-out;
89101 }
90- }
102+ }
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import ChatActionBar from "@/components/ChatActionBar";
66import pickMbtiImage from "@/utils/pickMbtiImage" ;
77import instance from "@/api/axios" ;
88import { useLocation } from "react-router-dom" ;
9+ import { cls } from "@/utils/cls" ;
10+ import TipsMenuContainer from "@/components/tips/TipsMenuContainer" ;
911
1012interface Message {
1113 role : "user" | "assistant" ;
@@ -27,7 +29,7 @@ const Chat = () => {
2729
2830 useEffect ( ( ) => {
2931 bottomRef . current ?. scrollIntoView ( { behavior : "smooth" } ) ;
30- } , [ messages ] ) ;
32+ } , [ messages , isOpen ] ) ;
3133
3234 const chatTitle = `${ mbti } 와 대화` ;
3335 const assistantInfo = mbti ;
@@ -123,7 +125,6 @@ const Chat = () => {
123125
124126 < div ref = { bottomRef } />
125127 </ div >
126-
127128 < ChatActionBar
128129 isOpen = { isOpen }
129130 setIsOpen = { setIsOpen }
@@ -132,6 +133,7 @@ const Chat = () => {
132133 onKeyUp = { handleKeyup }
133134 onSend = { ( ) => handleSend ( input ) }
134135 />
136+ { isOpen && < TipsMenuContainer /> }
135137 </ div >
136138 ) ;
137139} ;
You can’t perform that action at this time.
0 commit comments