Skip to content

Commit 1ccacbc

Browse files
committed
πŸ› Fix: λ§ˆμ΄νŽ˜μ΄μ§€μ—μ„œ κ°•μ•„μ§€ μˆ˜μ • λ²„νŠΌ λ³΄μ΄λŠ” ν˜„μƒ μˆ˜μ •
1 parent 5d71f3a commit 1ccacbc

File tree

3 files changed

+21
-24
lines changed

3 files changed

+21
-24
lines changed

β€Žsrc/components/DogProfile/index.tsxβ€Ž

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,38 @@ import { useModalStore } from '~stores/modalStore'
88
import EditDogProfileModal from '~modals/EditDogProfileModal'
99
import { calculateAge } from '~utils/calculateAge'
1010

11-
export default function DogProfile({
12-
dogId,
13-
name,
14-
gender,
15-
profileImg,
16-
birthDate,
17-
breed,
18-
comment,
19-
isNeutered,
20-
weight,
21-
}: DogProfileType) {
22-
const age = calculateAge(birthDate!)
11+
interface DogProfileProps {
12+
dogProfile: DogProfileType
13+
isEditBtnVisible?: boolean
14+
}
15+
16+
export default function DogProfile({ dogProfile, isEditBtnVisible = false }: DogProfileProps) {
17+
const age = calculateAge(dogProfile.birthDate!)
2318
const { pushModal } = useModalStore()
2419
return (
2520
<S.DogInfoArea>
2621
<S.DogInfoWrapper>
27-
<S.EditIconWrapper onClick={() => pushModal(<EditDogProfileModal dogId={dogId} />)}>
28-
<MdOutlineModeEdit size={20} />
29-
</S.EditIconWrapper>
30-
<Profile $size={80} $src={profileImg || ''} />
22+
{isEditBtnVisible && (
23+
<S.EditIconWrapper onClick={() => pushModal(<EditDogProfileModal dogId={dogProfile.dogId} />)}>
24+
<MdOutlineModeEdit size={20} />
25+
</S.EditIconWrapper>
26+
)}
27+
<Profile $size={80} $src={dogProfile.profileImg || ''} />
3128
<S.DogDetailWrapper>
3229
<S.TypoWrapper>
3330
<S.TyopNameWrapper>
34-
<Typo20 $weight='700'>{name}</Typo20>
31+
<Typo20 $weight='700'>{dogProfile.name}</Typo20>
3532
</S.TyopNameWrapper>
36-
<Typo15 $weight='400'>{breed}</Typo15>
33+
<Typo15 $weight='400'>{dogProfile.breed}</Typo15>
3734
<Separator $height={8} />
3835
<Typo15 $weight='400'>{age}μ‚΄</Typo15>
3936
<Separator $height={8} />
40-
<Typo15 $weight='400'>{gender === 'MALE' ? '남' : 'μ—¬'}</Typo15>
37+
<Typo15 $weight='400'>{dogProfile.gender === 'MALE' ? '남' : 'μ—¬'}</Typo15>
4138
</S.TypoWrapper>
4239
<S.DogDetailInfoWrapper>
43-
<Typo14 $weight='400'>쀑성화 {isNeutered === 'TRUE' ? 'O' : 'X'}</Typo14>
40+
<Typo14 $weight='400'>쀑성화 {dogProfile.isNeutered === 'TRUE' ? 'O' : 'X'}</Typo14>
4441
<Separator $height={8} />
45-
<Typo14 $weight='400'>{weight} KG</Typo14>
42+
<Typo14 $weight='400'>{dogProfile.weight} KG</Typo14>
4643
</S.DogDetailInfoWrapper>
4744
</S.DogDetailWrapper>
4845
</S.DogInfoWrapper>
@@ -51,7 +48,7 @@ export default function DogProfile({
5148
우리 λŒ•λŒ•μ΄λ₯Ό μ†Œκ°œν•΄μš”!
5249
</Typo15>
5350
<Typo13 $weight='500' style={{ lineHeight: 1.2 }}>
54-
{comment}
51+
{dogProfile.comment}
5552
</Typo13>
5653
</S.OneLineIntro>
5754
</S.DogInfoArea>

β€Žsrc/pages/FamilyDDangPage/index.tsxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function FamilyDDang() {
3333
</S.IconWrapper>
3434
</S.Header>
3535

36-
{dogInfo && <DogProfile {...dogInfo} />}
36+
{dogInfo && <DogProfile dogProfile={dogInfo} isEditBtnVisible />}
3737
<S.FamilySection>
3838
<S.ProfileOneArea>
3939
<Profile $size={64} $src={Avatar10} userId={1} />

β€Žsrc/pages/MyPage/index.tsxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default function MyPage() {
7979
</S.ProfileSection>
8080

8181
<CountSection walkCount={23} totalDistance={32} gangCount={16} />
82-
<S.DogProfileWrapper>{myPageData?.dog && <DogProfile {...myPageData.dog} />}</S.DogProfileWrapper>
82+
<S.DogProfileWrapper>{myPageData?.dog && <DogProfile dogProfile={myPageData.dog} />}</S.DogProfileWrapper>
8383
</S.MainContainer>
8484

8585
{/* <S.CountWrapperBig>{myPageData?.walkCount}회</S.CountWrapperBig>

0 commit comments

Comments
Β (0)