@@ -7,6 +7,7 @@ import { useRecoilState } from "recoil";
77
88import SearchInput from "@/components/chat/SearchInput" ;
99import SearchMenu from "@/components/chat/SearchMenu" ;
10+ import Button from "@/components/common/Button" ;
1011import ProfileModal from "@/components/common/ProfileModal" ;
1112import useDebounce from "@/hooks/useDebounce" ;
1213import { getSearchChatMessage , getSearchChatRoom } from "@/lib/api/chat" ;
@@ -79,6 +80,18 @@ const ChatSearch = () => {
7980 return `${ period } ${ hours } :${ formattedMinutes } ` ;
8081 } ;
8182
83+ const ChangeTypeFollowing = ( ) => {
84+ setType ( "팔로잉" ) ;
85+ } ;
86+
87+ const ChangeTypeChatRoom = ( ) => {
88+ setType ( "채팅방" ) ;
89+ } ;
90+
91+ const ChangeTypeMessage = ( ) => {
92+ setType ( "메시지" ) ;
93+ } ;
94+
8295 const renderSearchResults = ( type : "전체" | "팔로잉" | "채팅방" | "메시지" ) => {
8396 switch ( type ) {
8497 case "전체" :
@@ -87,16 +100,9 @@ const ChatSearch = () => {
87100 < section >
88101 < div className = { "flex justify-between" } >
89102 < div className = { "text-h3 font-semibold" } > 팔로잉</ div >
90- < button
91- className = {
92- "flex gap-x-1 text-h5 text-primaryMid rounded-full border border-primaryMid py-1 px-3 items-center"
93- }
94- onClick = { ( ) => {
95- setType ( "팔로잉" ) ;
96- } } >
103+ < Button className = { "border-primaryMid-button" } onClick = { ChangeTypeFollowing } RightIcon = { ArrowIcon } >
97104 더보기
98- < ArrowIcon />
99- </ button >
105+ </ Button >
100106 </ div >
101107 < div className = { "overflow-x-scroll pt-[12px] flex flex-col gap-y-3" } >
102108 < div className = { "flex gap-x-3" } >
@@ -129,16 +135,9 @@ const ChatSearch = () => {
129135 < section >
130136 < div className = { "flex justify-between" } >
131137 < div className = { "text-h3 font-semibold" } > 채팅방</ div >
132- < button
133- className = {
134- "flex gap-x-1 text-h5 text-primaryMid rounded-full border border-primaryMid py-1 px-3 items-center"
135- }
136- onClick = { ( ) => {
137- setType ( "채팅방" ) ;
138- } } >
138+ < Button className = { "border-primaryMid-button" } RightIcon = { ArrowIcon } onClick = { ChangeTypeChatRoom } >
139139 더보기
140- < ArrowIcon />
141- </ button >
140+ </ Button >
142141 </ div >
143142 < div className = { "mt-3" } >
144143 { searchChatRoomResults ?. map ( ( searchChatRoomResult ) => {
@@ -178,16 +177,9 @@ const ChatSearch = () => {
178177 < section >
179178 < div className = { "flex justify-between" } >
180179 < div className = { "text-h3 font-semibold" } > 메시지</ div >
181- < button
182- className = {
183- "flex gap-x-1 text-h5 text-primaryMid rounded-full border border-primaryMid py-1 px-3 items-center"
184- }
185- onClick = { ( ) => {
186- setType ( "메시지" ) ;
187- } } >
180+ < Button RightIcon = { ArrowIcon } className = { "border-primaryMid-button" } onClick = { ChangeTypeMessage } >
188181 더보기
189- < ArrowIcon />
190- </ button >
182+ </ Button >
191183 </ div >
192184 < div className = { "mt-3" } >
193185 { searchChatMessageResults . map ( ( searchChatMessageResult ) => {
@@ -227,16 +219,6 @@ const ChatSearch = () => {
227219 < section >
228220 < div className = { "flex justify-between" } >
229221 < div className = { "text-h3 font-semibold" } > 팔로잉</ div >
230- < button
231- className = {
232- "flex gap-x-1 text-h5 text-primaryMid rounded-full border border-primaryMid py-1 px-3 items-center"
233- }
234- onClick = { ( ) => {
235- setType ( "팔로잉" ) ;
236- } } >
237- 더보기
238- < ArrowIcon />
239- </ button >
240222 </ div >
241223 < div className = { "overflow-x-scroll pt-[12px] flex flex-col gap-y-3" } >
242224 < div className = { "flex gap-x-3" } >
@@ -318,16 +300,6 @@ const ChatSearch = () => {
318300 < section >
319301 < div className = { "flex justify-between" } >
320302 < div className = { "text-h3 font-semibold" } > 메시지</ div >
321- < button
322- className = {
323- "flex gap-x-1 text-h5 text-primaryMid rounded-full border border-primaryMid py-1 px-3 items-center"
324- }
325- onClick = { ( ) => {
326- setType ( "메시지" ) ;
327- } } >
328- 더보기
329- < ArrowIcon />
330- </ button >
331303 </ div >
332304 < div className = { "mt-3" } >
333305 { searchChatMessageResults . map ( ( searchChatMessageResult ) => {
0 commit comments