Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conditional rendering based on the showBanner state #7039

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add conditional rendering for Banner
  • Loading branch information
jdorfman committed Jun 25, 2024
commit c6e8056d313e2c2457aa31ca27f945fe776c8211
3 changes: 2 additions & 1 deletion src/components/Layout/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const Header: FunctionComponent<Props> = ({ minimal, colorTheme, navRef }
const [sticky, setSticky] = useState<boolean>(false)
const router = useRouter()
const { pathname } = router
const [showBanner, setShowBanner] = useState(false)

const source = pathname.slice(1) || 'about-home'

Expand Down Expand Up @@ -56,7 +57,7 @@ export const Header: FunctionComponent<Props> = ({ minimal, colorTheme, navRef }
<Disclosure as="nav" className={classNames('fixed top-0 left-0 right-0 z-[1030]')} ref={navRef}>
{({ open, close }) => (
<>
<Banner />
{showBanner && <Banner />}
<HeaderContent
colorTheme={colorTheme}
minimal={minimal}
Expand Down
Loading