@@ -2,29 +2,45 @@ import { useNavigate } from 'react-router';
22import * as s from './style.css' ;
33import SchoolVerifiedTag from '@/common/components/SchoolVerifiedTag' ;
44import { UserProfileImage } from '@/common/components/UserProfileImage' ;
5- import type { ChatRoomInterface } from '@/features/chatRoom/types' ;
5+ import type { ChatRoomInterface , CurrentAppointmentInterface } from '@/features/chatRoom/types' ;
6+ import RepickaLogo from '@/libs/assets/RepickaLogo' ;
67
78export interface Props {
8- data : ChatRoomInterface ;
9+ chatRoomData : ChatRoomInterface ;
10+ appointmentData : CurrentAppointmentInterface ;
911}
1012
11- const ChatRoomHeader = ( { data } : Props ) => {
13+ const ChatRoomHeader = ( { appointmentData , chatRoomData } : Props ) => {
1214 const navigate = useNavigate ( ) ;
1315 const goBack = ( ) => navigate ( - 1 ) ;
1416
15- const nickname = data . opponentNickname ;
16- const isOpponentKorean = data . isOpponentKorean ;
17+ const nickname = chatRoomData . opponentNickname ;
18+ const isOpponentKorean = chatRoomData . isOpponentKorean ;
19+ const profileImg = chatRoomData . opponentProfileImageUrl ;
20+ const isPicked = appointmentData . isPresent ;
21+
22+ const onClick = ( ) => {
23+ if ( isPicked ) navigate ( `/pick-detail/${ appointmentData . appointment . appointmentId } ` ) ;
24+ } ;
1725
1826 return (
19- < header className = { s . Container } >
20- < button className = { `mgc_left_fill ${ s . BackBtn } ` } onClick = { goBack } > </ button >
21- < div className = { s . UserInfo } >
22- < UserProfileImage nickname = { data . opponentNickname } src = { data . opponentProfileImageUrl } />
23- < div className = { s . Verifiy } >
24- { isOpponentKorean && < SchoolVerifiedTag /> }
25- < span > { nickname } </ span >
27+ < header className = { s . Wrapper } >
28+ < div className = { s . Container } >
29+ < button className = { `mgc_left_fill ${ s . BackBtn } ` } onClick = { goBack } > </ button >
30+ < div className = { s . UserInfo } >
31+ < UserProfileImage nickname = { nickname } src = { profileImg } />
32+ < div className = { s . Verifiy } >
33+ { isOpponentKorean && < SchoolVerifiedTag /> }
34+ < span > { nickname } </ span >
35+ </ div >
2636 </ div >
2737 </ div >
38+ < button className = { s . Pick ( { isPicked } ) } onClick = { onClick } >
39+ < div className = { s . Logo ( { isPicked } ) } >
40+ < RepickaLogo />
41+ </ div >
42+ PICK
43+ </ button >
2844 </ header >
2945 ) ;
3046} ;
0 commit comments