Skip to content

Commit

Permalink
misc: add bottom nav animation to mobile app
Browse files Browse the repository at this point in the history
  • Loading branch information
tjsry0466 committed Sep 11, 2024
1 parent 80b662b commit 94b5c95
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/web/src/components/layout/BottomNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ const BottomNav = ({ type }: { type: any }) => {
const pathName = usePathname();
const navRef = useRef<HTMLUListElement>(null);
const scrollDirection = useScrollDirection();
const { isMobile } = useDevice();
const { isMobile, isJirumAlarmApp } = useDevice();
const isMobileWithApp = isMobile || isJirumAlarmApp;

if (!BottomNavList.some((nav) => nav.link === pathName)) return;

Expand Down Expand Up @@ -99,8 +100,8 @@ const BottomNav = ({ type }: { type: any }) => {
className={cn(
`fixed bottom-0 left-1/2 z-50 mx-auto w-full max-w-screen-layout-max -translate-x-1/2 border-t border-t-[#D0D5DD] bg-white pb-safe-bottom transition-all duration-300`,
{
'translate-y-full': isMobile && scrollDirection === 'down',
'translate-y-0': !isMobile || scrollDirection === 'up',
'translate-y-full': isMobileWithApp && scrollDirection === 'down',
'translate-y-0': !isMobileWithApp || scrollDirection === 'up',
},
)}
>
Expand Down

0 comments on commit 94b5c95

Please sign in to comment.