11import { FC } from 'react'
2- import AppBar from '@mui/material/AppBar'
3- import useScrollTrigger from '@mui/material/useScrollTrigger'
42import { useTheme } from '@mui/material/styles'
3+ import { useScrolled } from '../../hooks/useScrolled'
54import { HomePageLink } from './Logotype'
65import { NetworkSelector } from './NetworkSelector'
7- import Button from '@mui/material/Button '
6+ import { Button } from '@oasisprotocol/ui-library/src/components/ui/button '
87import { useScopeParam } from '../../hooks/useScopeParam'
98import { useScreenSize } from '../../hooks/useScreensize'
109import { isScopeSelectorNeeded } from '../../utils/route-utils'
@@ -17,29 +16,19 @@ export const Header: FC = () => {
1716 const { isDesktop } = useScreenSize ( )
1817 const scope = useScopeParam ( )
1918 const withScopeSelector = ! ! scope && isScopeSelectorNeeded ( scope )
20- const scrollTrigger = useScrollTrigger ( {
21- disableHysteresis : true ,
22- threshold : 0 ,
23- } )
19+ const scrolled = useScrolled ( )
2420
2521 return (
26- < AppBar
27- position = "sticky"
28- sx = { {
29- transitionProperty : 'background-color' ,
30- transitionDuration : `${ theme . transitions . duration . standard } ms` ,
31- transitionTimingFunction : theme . transitions . easing . easeInOut ,
32- backgroundColor : scrollTrigger
33- ? theme . palette . layout . contrastSecondary
34- : theme . palette . layout . secondary ,
35- borderRadius : 0 ,
36- boxShadow : '0px 4px 6px -1px rgba(0, 0, 0, 0.10), 0px 2px 4px -1px rgba(0, 0, 0, 0.06)' ,
22+ < header
23+ className = "flex flex-col w-full box-border flex-shrink-0 sticky z-[1100] top-0 right-0 left-auto shadow-md"
24+ style = { {
25+ backgroundColor : theme . palette . layout . contrastSecondary ,
3726 } }
3827 >
3928 < div className = "px-4" >
4029 < div className = "grid grid-cols-12 pt-3 pb-4 px-0 md:px-[4%]" >
4130 < div className = "col-span-6 xl:col-span-3 flex items-center" >
42- < HomePageLink showText = { ! scrollTrigger && ! isMobile } />
31+ < HomePageLink showText = { ! scrolled && ! isMobile } />
4332 </ div >
4433
4534 { withScopeSelector && (
@@ -50,21 +39,15 @@ export const Header: FC = () => {
5039
5140 { isDesktop && (
5241 < div className = "col-span-3 flex justify-end items-center" >
53- < Button
54- component = "a"
55- href = "https://rose.oasis.io/"
56- target = "_blank"
57- rel = "noopener noreferrer"
58- color = "secondary"
59- variant = "outlined"
60- size = "large"
61- >
62- { t ( 'common.visitRoseApp' ) }
42+ < Button variant = "outline" size = "lg" asChild >
43+ < a href = "https://rose.oasis.io/" target = "_blank" rel = "noopener noreferrer" >
44+ { t ( 'common.visitRoseApp' ) }
45+ </ a >
6346 </ Button >
6447 </ div >
6548 ) }
6649 </ div >
6750 </ div >
68- </ AppBar >
51+ </ header >
6952 )
7053}
0 commit comments