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 #7038

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Add hide/show Banner component state
  • Loading branch information
jdorfman committed Jun 25, 2024
commit c07c67220b47b2c920dcb70bd4664409474c586a
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