Skip to content

Commit 5edf1ac

Browse files
chore: no nav background color for leader schedule
1 parent dabc65a commit 5edf1ac

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.header-container {
2+
top: 0;
3+
background-color: var(--color-background);
4+
5+
.nav-background {
6+
background-color: var(--slot-nav-background-color);
7+
}
8+
}

src/features/Header/index.tsx

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ import {
88
headerSpacing,
99
logoRightSpacing,
1010
maxZIndex,
11-
slotNavWithoutListWidth,
1211
slotsNavSpacing,
1312
} from "../../consts";
1413
import Logo from "./Logo";
1514
import { CluserIndicator, Cluster } from "./Cluster";
1615
import NavCollapseToggle from "../Navigation/NavCollapseToggle";
1716
import NavBlur from "../Navigation/NavBlur";
18-
import { slotNavBackgroundColor } from "../../colors";
19-
import { useMemo } from "react";
2017
import { useSlotsNavigation } from "../../hooks/useSlotsNavigation";
18+
import clsx from "clsx";
19+
import styles from "./header.module.css";
2120

2221
export 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`}

src/features/Navigation/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ export default function Navigation() {
5858
// width transitions
5959
width={showNav ? `${width + thumbPadding}px` : "0"}
6060
overflow="hidden"
61-
className={clsx("sticky", styles.slotNavContainer)}
61+
className={clsx("sticky", styles.slotNavContainer, {
62+
[styles.navBackground]: !showOnlyEpochBar,
63+
})}
6264
style={{
6365
zIndex: maxZIndex - 1,
6466
}}

src/features/Navigation/navigation.module.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,8 @@
8181
.slot-nav-container {
8282
transition: width 0.3s;
8383
box-sizing: border-box;
84-
background: var(--slot-nav-background-color);
84+
85+
&.nav-background {
86+
background-color: var(--slot-nav-background-color);
87+
}
8588
}

0 commit comments

Comments
 (0)