11import { FC } from 'react'
2- import useScrollTrigger from '@mui/material/useScrollTrigger'
32import { useTheme } from '@mui/material/styles'
3+ import { useScrolled } from '../../hooks/useScrolled'
44import { HomePageLink } from './Logotype'
55import { NetworkSelector } from './NetworkSelector'
66import { Button } from '@oasisprotocol/ui-library/src/components/ui/button'
@@ -16,24 +16,19 @@ export const Header: FC = () => {
1616 const { isDesktop } = useScreenSize ( )
1717 const scope = useScopeParam ( )
1818 const withScopeSelector = ! ! scope && isScopeSelectorNeeded ( scope )
19- const scrollTrigger = useScrollTrigger ( {
20- disableHysteresis : true ,
21- threshold : 0 ,
22- } )
19+ const scrolled = useScrolled ( )
2320
2421 return (
2522 < header
26- className = "flex flex-col w-full box-border flex-shrink-0 sticky z-[1100] top-0 right-0 left-auto transition-colors duration-300 ease-in-out shadow-md"
23+ className = "flex flex-col w-full box-border flex-shrink-0 sticky z-[1100] top-0 right-0 left-auto shadow-md"
2724 style = { {
28- backgroundColor : scrollTrigger
29- ? theme . palette . layout . contrastSecondary
30- : theme . palette . layout . secondary ,
25+ backgroundColor : theme . palette . layout . contrastSecondary ,
3126 } }
3227 >
3328 < div className = "px-4" >
3429 < div className = "grid grid-cols-12 pt-3 pb-4 px-0 md:px-[4%]" >
3530 < div className = "col-span-6 xl:col-span-3 flex items-center" >
36- < HomePageLink showText = { ! scrollTrigger && ! isMobile } />
31+ < HomePageLink showText = { ! scrolled && ! isMobile } />
3732 </ div >
3833
3934 { withScopeSelector && (
0 commit comments