-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor : 토큰을 받아오는 로직 함수로 분리 * Refactor : 네비게이션 바 컴포넌트 변경 * Refactor : 토큰을 받아오는 로직 함수로 분리 * Minor : 사용하지 않는 모듈 제거 * Fix : Suspense Query를 useQuery로 변경 * Refactor : Retry 를 하지않음 * Refactor : 유저명 클릭시 해당유저의 프로필로 이동 * Refactor : 인터페이스 변경
- Loading branch information
1 parent
debe62d
commit 7fcb3a2
Showing
17 changed files
with
179 additions
and
111 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
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,20 @@ | ||
"use client"; | ||
import { useUserInfoQuery } from "@/queries/auth/useUserInfoQuery"; | ||
import UserAvatar from "../user/info/UserAvatar"; | ||
import MyIcon from "~/assets/icons/MyIcon.svg"; | ||
const NavbarUserImage = () => { | ||
try { | ||
const { data } = useUserInfoQuery(); | ||
return ( | ||
<UserAvatar | ||
sx={{ width: 28, height: 28, m:0.25 }} | ||
src={data?.profileImages[0]?.attachUrl} | ||
fallback={data?.id} | ||
/> | ||
); | ||
} catch (err) { | ||
return <MyIcon/>; | ||
} | ||
}; | ||
|
||
export default NavbarUserImage; |
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,82 @@ | ||
"use client"; | ||
import { BottomNavigation, BottomNavigationAction, Paper } from "@mui/material"; | ||
|
||
import HomeIcon from "~/assets/icons/HomeIcon.svg"; | ||
import SearchIcon from "~/assets/icons/SearchIcon.svg"; | ||
import PostIcon from "~/assets/icons/PostIcon.svg"; | ||
import BeverageIcon from "~/assets/icons/BeverageIcon.svg"; | ||
|
||
import HOME, { MY_PROFILE, NEW_POST, SEARCH, WIKI } from "@/const/clientPath"; | ||
import Link from "next/link"; | ||
import { usePathname } from "next/navigation"; | ||
import NavbarUserImage from "@/components/Navigation/NavbarUserImage"; | ||
import { useMemo } from "react"; | ||
|
||
const NavigationBar = () => { | ||
const path = usePathname(); | ||
const NavbarData = useMemo( | ||
() => [ | ||
{ | ||
iconComponent: <HomeIcon />, | ||
label: "홈", | ||
href: HOME, | ||
}, | ||
{ | ||
iconComponent: <SearchIcon />, | ||
label: "검색", | ||
href: SEARCH, | ||
}, | ||
{ | ||
iconComponent: <PostIcon />, | ||
href: NEW_POST, | ||
}, | ||
{ | ||
iconComponent: <BeverageIcon />, | ||
label: "술과사전", | ||
href: WIKI, | ||
}, | ||
{ | ||
iconComponent: <NavbarUserImage />, | ||
label: "내 정보", | ||
href: MY_PROFILE, | ||
}, | ||
], | ||
[] | ||
); | ||
return ( | ||
<Paper sx={WrapperStyle} elevation={0}> | ||
<BottomNavigation value={path} showLabels sx={BtnStyle}> | ||
{NavbarData.map(({ label, href, iconComponent, ...others }) => { | ||
return ( | ||
<BottomNavigationAction | ||
icon={iconComponent as any} | ||
key={String(label)} | ||
component={href ? Link : "button"} | ||
href={href} | ||
value={href} | ||
label={label} | ||
{...others} | ||
/> | ||
); | ||
})} | ||
</BottomNavigation> | ||
</Paper> | ||
); | ||
}; | ||
|
||
const WrapperStyle = { | ||
position: "fixed", | ||
bottom: 0, | ||
left: 0, | ||
right: 0, | ||
borderRadius: 0, | ||
}; | ||
const BtnStyle = { | ||
borderRadius: "12px 12px 0 0", | ||
border: "1px solid", | ||
borderBottom: "none", | ||
borderColor: "gray.secondary", | ||
boxSizing: "border-box", | ||
}; | ||
|
||
export default NavigationBar; |
This file was deleted.
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
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
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
Oops, something went wrong.