@@ -8,9 +8,10 @@ import Link from 'next/link';
88import cn from 'classnames' ;
99import { useRouter } from 'next/navigation' ;
1010// import { sessionIdAtom } from '@/store/sessionId';
11- import { ArrowBigLeft , Blend as AppIcon } from 'lucide-react' ;
11+ import { ArrowBigLeft , Blend as AppIcon , Undo2 } from 'lucide-react' ;
1212import Menu from '@/components/MobileMenu' ;
1313import { useIsMobile } from '@/hooks/useIsMobile' ;
14+ import { useIsScrolled } from 'lib/hooks/useIsScrolled' ;
1415
1516interface TabItem {
1617 label : string ;
@@ -65,7 +66,7 @@ const BackButton = () => {
6566 return (
6667 < div
6768 className = { cn (
68- 'lg:w-[30px] flex w-[20px] justify-start items-center text-xl shrink-0 transition-all duration-300 absolute left-0' ,
69+ 'lg:w-[30px] flex w-[20px] justify-start items-center text-xl shrink-0 absolute left-0' ,
6970 canBack && 'hover:scale-110'
7071 ) }
7172 >
@@ -74,7 +75,7 @@ const BackButton = () => {
7475 onClick = { handleBackClick }
7576 className = "flex items-center cursor-pointer select-none"
7677 >
77- < ArrowBigLeft
78+ < Undo2
7879 style = { {
7980 fontSize : 16 ,
8081 // transform: 'rotateY(180deg)', // Apply 180-degree rotation on the X-axis
@@ -93,6 +94,7 @@ const Tabs = ({
9394 activeIndex,
9495 setActiveIndex,
9596 onTabClick,
97+ className,
9698} : TabsProps ) => {
9799 const router = useRouter ( ) ;
98100 const pathname = usePathname ( ) ;
@@ -110,7 +112,10 @@ const Tabs = ({
110112
111113 return (
112114 < div
113- className = { `py-4 md:py-2 flex items-center justify-center md:rounded overflow-auto w-full` }
115+ className = { cn (
116+ 'py-2 md:py-2 flex items-center justify-center md:rounded overflow-auto w-full' ,
117+ className
118+ ) }
114119 >
115120 < div className = "flex md:rounded w-[fit-content] shrink-0 flex gap-2" >
116121 { tabs . map ( ( tab , idx ) => {
@@ -176,6 +181,8 @@ export default function PageLayout({
176181 const activeTab = tabs [ activeIndex ] ;
177182 const isMobile = useIsMobile ( ) ;
178183
184+ const isScrolled = useIsScrolled ( 20 ) ;
185+
179186 return (
180187 < >
181188 { /* Mobile layout */ }
@@ -188,18 +195,27 @@ export default function PageLayout({
188195 { title && (
189196 < div
190197 data-page = "Header"
191- className = "w-full shrink-0 relative backdrop-blur-xs flex flex-col items-start px-4 gap-5 sticky top-0 z-[999999]"
198+ className = { cn (
199+ 'w-full shrink-0 relative flex flex-col items-start transition-transform text-white translate-y-[0px] duration-300 px-4 gap-5 sticky top-0 z-[999998]' ,
200+ isScrolled ? '!translate-y-[-10px] !text-black' : ''
201+ ) }
192202 style = { {
193- background : `radial-gradient(196.3% 65.93% at 98.09% -7.2%, rgba(246, 180, 14, 0.30) 0%, rgba(246, 180, 14, 0.00) 100%),
203+ background : isScrolled
204+ ? 'white'
205+ : `radial-gradient(196.3% 65.93% at 98.09% -7.2%, rgba(246, 180, 14, 0.30) 0%, rgba(246, 180, 14, 0.00) 100%),
194206 radial-gradient(71.21% 71.21% at 50% 71.21%, rgba(36, 36, 54, 0.20) 0%, rgba(36, 36, 54, 0.00) 100%),
195207 linear-gradient(263deg, rgba(246, 180, 14, 0.30) 2.9%, rgba(45, 45, 66, 0.30) 58.72%, rgba(36, 36, 54, 0.30) 100.39%),
196208 linear-gradient(98deg, rgba(116, 172, 223, 0.80) -7.48%, rgba(73, 129, 180, 0.80) 43.5%, rgba(255, 133, 166, 0.80) 122.37%)` ,
197209 backgroundBlendMode : 'normal, normal, overlay, normal' ,
198- backdropFilter : 'blur(4px)' ,
210+ backdropFilter : isScrolled ? 'blur(0px)' : 'blur(4px)' ,
199211 paddingTop : 'calc(0px + max(0px, env(safe-area-inset-top)))' ,
200212 } }
201213 >
202- < div className = "relative flex items-center justify-center w-full gap-3 text-white text-lg font-bold h-[59px]" >
214+ < div
215+ className = { cn (
216+ 'relative flex items-center transition-transform duration-300 h-[59px] translate-y-[0px] justify-center w-full gap-3 font-medium'
217+ ) }
218+ >
203219 < BackButton />
204220 { title }
205221 </ div >
@@ -208,7 +224,10 @@ export default function PageLayout({
208224
209225 { tabs . length > 1 && (
210226 < div
211- className = "px-4 text-lg font-bold border-b border-b-solid border-[#8855CC26] sticky bg-white md:rounded-t-sm z-[999998]"
227+ className = { cn (
228+ 'px-4 text-lg z-[1] font-bold border-b border-b-solid border-[#8855CC26] transition-transform translate-y-[0px] duration-300 sticky bg-white md:rounded-t-sm z-[999999]' ,
229+ isScrolled ? '!translate-y-[-25px]' : ''
230+ ) }
212231 style = { {
213232 top : 'calc(59px + max(0px, env(safe-area-inset-top)))' ,
214233 } }
0 commit comments