From 1f5ca2fcb0db86948de5d3e73083f8a1d9cf9b77 Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Fri, 12 Apr 2024 01:14:16 +0900 Subject: [PATCH] #325 fix: BottomNavigation fix --- src/app/feed/detail/[id]/page.tsx | 2 + src/app/feed/page.tsx | 72 ++++++++++--------- .../common/BottomNavigation/index.tsx | 18 ++--- src/constants/navigation.ts | 18 +++-- 4 files changed, 58 insertions(+), 52 deletions(-) diff --git a/src/app/feed/detail/[id]/page.tsx b/src/app/feed/detail/[id]/page.tsx index b2c4983a..5d6950ca 100644 --- a/src/app/feed/detail/[id]/page.tsx +++ b/src/app/feed/detail/[id]/page.tsx @@ -4,6 +4,7 @@ import { usePathname } from 'next/navigation'; import { Feed } from '@components/feed/Feed'; import { useGetFeedDetail } from '@hooks/api/useGetFeedDetail'; +import BottomNavigation from '@components/common/BottomNavigation'; export default function Page() { const pathname = usePathname(); @@ -36,6 +37,7 @@ export default function Page() { )} + ); } diff --git a/src/app/feed/page.tsx b/src/app/feed/page.tsx index 4f51724a..3e26557d 100644 --- a/src/app/feed/page.tsx +++ b/src/app/feed/page.tsx @@ -3,6 +3,7 @@ import { useGetFeedList } from '@hooks/api/useGetFeedList'; import useObserver from '@hooks/useObserver'; import { Feed } from '@components/feed/Feed'; +import BottomNavigation from '@components/common/BottomNavigation'; export default function Page() { const { @@ -24,39 +25,42 @@ export default function Page() { }); return ( -
- {feedList && - !feedList[0].data.empty && - feedList.map((feedList) => - feedList.data.content.map((feed) => { - return ( - - {feed.createdAt} - - - - - ); - }), - )} - {!isLoading && hasNextPage &&
} -
+ <> +
+ {feedList && + !feedList[0].data.empty && + feedList.map((feedList) => + feedList.data.content.map((feed) => { + return ( + + {feed.createdAt} + + + + + ); + }), + )} + {!isLoading && hasNextPage &&
} + +
+ ); } diff --git a/src/components/common/BottomNavigation/index.tsx b/src/components/common/BottomNavigation/index.tsx index 1817e992..120f4dbb 100644 --- a/src/components/common/BottomNavigation/index.tsx +++ b/src/components/common/BottomNavigation/index.tsx @@ -5,39 +5,33 @@ import { usePathname } from 'next/navigation'; import Icon from '@components/common/Icon/index'; import cn from '@utils/cn'; import { NAVIGATION } from '@constants/navigation'; -import { useGetUserProfile } from '@hooks/api/useGetUserProfile'; export default function BottomNavigation({ className, ...restProps }: HTMLAttributes) { - const currentPath = usePathname(); - const { data: userProfile } = useGetUserProfile(); + const pathname = usePathname(); + const slicedPathname = pathname.slice(1).split('/')[0]; return (