1+ import { GetMeResponse } from '@/types/user' ;
2+ import Image from 'next/image' ;
3+
4+ interface ProfileProp {
5+ profileData : GetMeResponse ;
6+ isMyProfile ?: boolean ;
7+ editProfile ?: ( ) => void ;
8+ logout ?: ( ) => void ;
9+ onClickFollowBtn ?: ( ) => void ;
10+ }
11+
12+ function Profile ( { profileData, isMyProfile= false , editProfile, logout, onClickFollowBtn } : ProfileProp ) {
13+ return (
14+ < div className = "mb-[60px] px-[20px] py-[30px] w-full h-auto rounded-[8px] bg-[#252530] md:px-[30px] lg:w-[340px] lg:mb-0" >
15+ < div className = "w-full h-auto flex flex-col items-center gap-[30px] lg:gap-[40px]" >
16+ < div className = "w-[120px] h-[120px] relative rounded-full lg:w-[180px] lg:h-[180px]" >
17+ { profileData ?. image ? (
18+ < Image src = { profileData . image } alt = "유저 이미지" fill />
19+ ) : (
20+ < Image src = "/img/profileimage/img=profile1.png" alt = "유저 이미지" fill />
21+ ) }
22+ </ div >
23+ < div className = "w-full flex flex-col gap-[10px] lg:gap-[20px]" >
24+ < span className = "text-center text-[20px] font-semibold text-[#F1F1F5] lg:text-[24px]" >
25+ { profileData ?. nickname }
26+ </ span >
27+ < p className = "text-[14px] font-normal text-[#6E6E82] lg:text-[16px]" >
28+ { profileData ?. description }
29+ </ p >
30+ </ div >
31+ < div className = "w-full px-[51px] flex justify-between relative md:px-[108px] lg:px-[58px]" >
32+ < div className = "flex flex-col items-center gap-[10px]" >
33+ < span className = "text-[18px] font-semibold text-[#F1F1F5] lg:text-[20px]" >
34+ { profileData ?. followersCount }
35+ </ span >
36+ < span className = "text-[14px] font-normal text-[#9FA6B2] lg:text-[16px]" > 팔로워</ span >
37+ </ div >
38+ < div className = "absolute left-1/2 top-0 w-px h-full bg-[#353542]" > </ div >
39+ < div className = "flex flex-col items-center gap-[10px]" >
40+ < span className = "text-[18px] font-semibold text-[#F1F1F5] lg:text-[20px]" >
41+ { profileData ?. followeesCount }
42+ </ span >
43+ < span className = "text-[14px] font-normal text-[#9FA6B2] lg:text-[16px]" > 팔로잉</ span >
44+ </ div >
45+ </ div >
46+ { isMyProfile ? (
47+ profileData . isFollowing ? (
48+ < div
49+ className = "w-full h-[50px] flex justify-center items-center rounded-lg border border-gray-100 text-gray-100 text-[16px] font-semibold hover:cursor-pointer
50+ md:h-[55px] lg:h-[65px] lg:text-[18px]"
51+ onClick = { onClickFollowBtn }
52+ >
53+ 팔로우 취소
54+ </ div >
55+ ) : (
56+ < div
57+ className = "w-full h-[50px] flex justify-center items-center rounded-lg bg-main-blue text-gray-50 text-[16px] font-semibold hover:cursor-pointer
58+ md:h-[55px] lg:h-[65px] lg:text-[18px]"
59+ onClick = { onClickFollowBtn }
60+ >
61+ 팔로우
62+ </ div >
63+ )
64+ ) : (
65+ < div className = "w-full flex flex-col gap-[10px] md:gap-[15px] lg:gap-[20px]" >
66+ < div
67+ className = "w-full h-[50px] flex justify-center items-center rounded-lg bg-main-blue text-gray-50 text-[16px] font-semibold hover:cursor-pointer
68+ md:h-[55px] lg:h-[65px] lg:text-[18px]"
69+ onClick = { editProfile }
70+ >
71+ 프로필 편집
72+ </ div >
73+ < div
74+ className = "w-full h-[50px] flex justify-center items-center rounded-lg border border-gray-100 text-gray-100 text-[16px] font-semibold hover:cursor-pointer
75+ md:h-[55px] lg:h-[65px] lg:text-[18px]"
76+ onClick = { logout }
77+ >
78+ 로그아웃
79+ </ div >
80+ </ div >
81+ ) }
82+ </ div >
83+ </ div >
84+ ) ;
85+ }
86+
87+ export default Profile ;
0 commit comments