@@ -8,16 +8,15 @@ import {
88 headerSpacing ,
99 logoRightSpacing ,
1010 maxZIndex ,
11- slotNavWithoutListWidth ,
1211 slotsNavSpacing ,
1312} from "../../consts" ;
1413import Logo from "./Logo" ;
1514import { CluserIndicator , Cluster } from "./Cluster" ;
1615import NavCollapseToggle from "../Navigation/NavCollapseToggle" ;
1716import NavBlur from "../Navigation/NavBlur" ;
18- import { slotNavBackgroundColor } from "../../colors" ;
19- import { useMemo } from "react" ;
2017import { useSlotsNavigation } from "../../hooks/useSlotsNavigation" ;
18+ import clsx from "clsx" ;
19+ import styles from "./header.module.css" ;
2120
2221export default function Header ( ) {
2322 const showDropdownNav = useMedia ( "(max-width: 900px)" ) ;
@@ -26,16 +25,6 @@ export default function Header() {
2625 const { isNarrowScreen, blurBackground, showNav, showOnlyEpochBar } =
2726 useSlotsNavigation ( ) ;
2827
29- const leftBackground = useMemo ( ( ) => {
30- if ( ! showNav ) return undefined ;
31- if ( showOnlyEpochBar ) {
32- // only color the epoch bar portion
33- const width = `${ slotNavWithoutListWidth + epochThumbPadding } px` ;
34- return `linear-gradient(to right, ${ slotNavBackgroundColor } 0px ${ width } , transparent ${ width } 100%)` ;
35- }
36- return slotNavBackgroundColor ;
37- } , [ showOnlyEpochBar , showNav ] ) ;
38-
3928 const useExtraNarrowGap = ! showNav && isXNarrow ;
4029 const extraNarrowGap = "3px" ;
4130
@@ -53,14 +42,14 @@ export default function Header() {
5342 < Box px = "2" className = "app-width-container" >
5443 < Flex height = { `${ headerHeight } px` } align = "center" >
5544 < Flex
45+ className = { clsx ( {
46+ [ styles . navBackground ] : showNav && ! showOnlyEpochBar ,
47+ } ) }
5648 height = "100%"
5749 align = "center"
5850 gapX = { useExtraNarrowGap ? extraNarrowGap : `${ logoRightSpacing } px` }
5951 // slots nav background color boundary
6052 pr = { useExtraNarrowGap ? extraNarrowGap : `${ slotsNavSpacing } px` }
61- style = { {
62- background : leftBackground ,
63- } }
6453 // align with epoch bar thumb overflow padding
6554 ml = { `${ - epochThumbPadding } px` }
6655 pl = { `${ epochThumbPadding } px` }
0 commit comments