-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refector: 로그인됐을 경우 gnb userInfo 리팩토링
GnbUserInfo 분리
- Loading branch information
1 parent
2d156c2
commit ffae485
Showing
5 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { IMAGES } from "@/constants/images"; | ||
import * as S from "./Gnb.styled"; | ||
|
||
interface GnbUserInfoProps { | ||
user: { | ||
id: number; | ||
nickname: string; | ||
profileImageUrl: string; | ||
}; | ||
onClick: () => void; | ||
} | ||
|
||
export default function GnbUserInfo({ user, onClick }: GnbUserInfoProps) { | ||
return ( | ||
<S.UserInfoWrapper onClick={onClick}> | ||
{user.profileImageUrl ? ( | ||
<S.ProfileImg src={user.profileImageUrl} alt="프로필 사진" /> | ||
) : ( | ||
<img src={IMAGES.profileImg.src} alt={IMAGES.profileImg.alt} /> | ||
)} | ||
<S.Nickname>{user.nickname}</S.Nickname> | ||
</S.UserInfoWrapper> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters