-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 모바일 사이드 네이바 구현 * feat: 700이상으로 width 늘어날때 모바일 버전 헤더 지우기 * feat: 코드리뷰 수정 * feat: 코드리뷰 수정
- Loading branch information
Showing
10 changed files
with
334 additions
and
111 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
39 changes: 33 additions & 6 deletions
39
src/components/HeaderSection/components/MobileHeader/MobileHeader.tsx
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
121 changes: 121 additions & 0 deletions
121
src/components/HeaderSection/components/MobileSlideNav/MobileSlideNav.css.ts
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,121 @@ | ||
import { style, styleVariants } from '@vanilla-extract/css'; | ||
|
||
import colors from '@/styles/color'; | ||
|
||
export const container = style({ padding: '0 16px', display: 'flex', flexDirection: 'column' }); | ||
|
||
export const logo = style({ fontSize: '24px', color: colors.primary9, marginBottom: '24px' }); | ||
|
||
export const division = style({ | ||
padding: '0px', | ||
height: '1px', | ||
border: 'none', | ||
backgroundColor: 'rgb(234, 237, 239)', | ||
margin: '20px 0px', | ||
}); | ||
|
||
export const hrTitle = style({ fontSize: '14px', color: colors.gray12 }); | ||
|
||
export const userSection = style({ display: 'flex', flexDirection: 'column', gap: '8px' }); | ||
|
||
export const userWrapper = style({ | ||
display: 'flex', | ||
gap: '4px', | ||
}); | ||
|
||
export const profileImage = style({ | ||
borderRadius: '50%', | ||
}); | ||
|
||
export const authWrapper = style({ | ||
display: 'flex', | ||
gap: '8px', | ||
marginTop: '16px', | ||
}); | ||
|
||
export const userName = style({ | ||
fontSize: '14px', | ||
lineHeight: '20px', | ||
color: colors.gray11, | ||
}); | ||
|
||
export const buttonBase = style({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
cursor: 'pointer', | ||
width: '100%', | ||
height: '40px', | ||
borderRadius: '4px', | ||
}); | ||
|
||
export const likeCount = style({ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
color: colors.primary11, | ||
backgroundColor: colors.gray3, | ||
minWidth: '30px', | ||
padding: '4px 8px', | ||
borderRadius: '20px', | ||
marginLeft: '12px', | ||
}); | ||
|
||
export const normalNavButtonBase = style({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
cursor: 'pointer', | ||
width: '100%', | ||
textAlign: 'left', | ||
height: '40px', | ||
borderRadius: '4px', | ||
fontSize: '14px', | ||
color: colors.gray11, | ||
padding: '0 8px', | ||
boxSizing: 'border-box', | ||
':hover': { | ||
backgroundColor: colors.gray3, | ||
}, | ||
}); | ||
|
||
export const bottomNavButtonBase = style({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
cursor: 'pointer', | ||
width: '100%', | ||
textAlign: 'left', | ||
borderRadius: '4px', | ||
fontSize: '12px', | ||
color: colors.gray11, | ||
padding: '4px 8px', | ||
boxSizing: 'border-box', | ||
}); | ||
|
||
export const button = styleVariants({ | ||
login: [ | ||
buttonBase, | ||
{ | ||
fontSize: '12px', | ||
color: colors.primary9, | ||
backgroundColor: colors.white, | ||
border: `1px solid ${colors.primary9}`, | ||
}, | ||
], | ||
join: [ | ||
buttonBase, | ||
{ | ||
fontSize: '12px', | ||
backgroundColor: colors.primary9, | ||
color: colors.white, | ||
border: `1px solid ${colors.primary9}`, | ||
}, | ||
], | ||
uploadAuction: [ | ||
buttonBase, | ||
{ | ||
fontSize: '14px', | ||
color: colors.primary9, | ||
backgroundColor: colors.primary3, | ||
border: `1px solid ${colors.primary9}`, | ||
}, | ||
], | ||
}); |
109 changes: 109 additions & 0 deletions
109
src/components/HeaderSection/components/MobileSlideNav/index.tsx
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,109 @@ | ||
import { UserIcon } from 'lucide-react'; | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
|
||
import usePostLogout from '@/apis/queryHooks/Auth/usePostLogout'; | ||
import colors from '@/styles/color'; | ||
|
||
import * as S from './MobileSlideNav.css'; | ||
|
||
interface MobileSlideNavProps { | ||
isLogin: boolean; | ||
onClose: () => void; | ||
userProfileImage?: string | null; | ||
userNickname?: string | null; | ||
userEmail?: string; | ||
userHeartCount?: number; | ||
} | ||
|
||
function MobileSlideNav({ | ||
isLogin, | ||
onClose, | ||
userProfileImage, | ||
userNickname, | ||
userEmail, | ||
userHeartCount, | ||
}: MobileSlideNavProps) { | ||
const { mutate: logout } = usePostLogout(); | ||
|
||
const handleLogout = () => { | ||
logout(); | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<div className={S.container}> | ||
<Link href="/" onClick={onClose}> | ||
<div className={S.logo}>OMOCHA</div> | ||
</Link> | ||
<div> | ||
{isLogin ? ( | ||
<div className={S.userSection}> | ||
<div className={S.userWrapper}> | ||
{userProfileImage ? ( | ||
<Image | ||
className={S.profileImage} | ||
src={`${process.env.NEXT_PUBLIC_S3_URL}${userProfileImage}`} | ||
width={100} | ||
height={100} | ||
priority | ||
alt="프로필 이미지" | ||
/> | ||
) : ( | ||
<UserIcon | ||
size={20} | ||
strokeWidth={1} | ||
stroke={colors.gray9} | ||
style={{ borderRadius: '50%', border: `1px solid ${colors.gray9}` }} | ||
/> | ||
)} | ||
<span className={S.userName}>{userNickname}</span> | ||
</div> | ||
<div className={S.userWrapper}> | ||
<span className={S.userName}>{userEmail}</span> | ||
</div> | ||
{/* <Link href="/mypage/heart" onClick={onClose}> | ||
<div className={S.userWrapper}> | ||
<span className={S.userName}>찜 개수: </span> | ||
<span className={S.userName}>{userHeartCount}</span> | ||
</div> | ||
</Link> */} | ||
</div> | ||
) : ( | ||
<div className={S.authWrapper}> | ||
<Link href="/login" className={S.button.login} onClick={onClose}> | ||
로그인 | ||
</Link> | ||
<Link href="/join" className={S.button.join} onClick={onClose}> | ||
회원가입 | ||
</Link> | ||
</div> | ||
)} | ||
</div> | ||
<hr className={S.division} /> | ||
<Link href="/create" className={S.button.uploadAuction} onClick={onClose}> | ||
경매 등록 | ||
</Link> | ||
<hr className={S.division} /> | ||
<Link href="/mypage/profile" className={S.normalNavButtonBase} onClick={onClose}> | ||
회원 정보 | ||
</Link> | ||
<Link href="/mypage/heart" className={S.normalNavButtonBase} onClick={onClose}> | ||
<> | ||
찜<div className={S.likeCount}>{userHeartCount}</div> | ||
</> | ||
</Link> | ||
<Link href="/mypage/record" className={S.normalNavButtonBase} onClick={onClose}> | ||
거래 내역 | ||
</Link> | ||
<hr className={S.division} /> | ||
{isLogin && ( | ||
<button className={S.bottomNavButtonBase} type="button" onClick={handleLogout}> | ||
로그아웃 | ||
</button> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default MobileSlideNav; |
Oops, something went wrong.