Skip to content
Open
Changes from 2 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
13 changes: 11 additions & 2 deletions frontend/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,21 @@ import ModeToggle from 'components/ModeToggle'
import NavButton from 'components/NavButton'
import NavDropdown from 'components/NavDropDown'
import UserMenu from 'components/UserMenu'
import { useTheme } from 'next-themes'

export default function Header({ isGitHubAuthEnabled }: { readonly isGitHubAuthEnabled: boolean }) {
const pathname = usePathname()
const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
const toggleMobileMenu = () => setMobileMenuOpen(!mobileMenuOpen)

const { Theme } = useTheme()
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
const [mounted, setMounted] = useState(false)

useEffect(() => {
setMounted(true)
}, [])
const logoSrc = mounted && Theme === 'light' ? '/img/logo_light.png' : '/img/logo_dark.png'

useEffect(() => {
const handleResize = () => {
if (globalThis.innerWidth >= desktopViewMinWidth) {
Expand Down Expand Up @@ -70,7 +79,7 @@ export default function Header({ isGitHubAuthEnabled }: { readonly isGitHubAuthE
width={64}
height={64}
priority={true}
src={'/img/logo_dark.png'}
src={logoSrc}
className="h-full w-auto object-contain"
alt="OWASP Logo"
/>
Expand Down Expand Up @@ -167,7 +176,7 @@ export default function Header({ isGitHubAuthEnabled }: { readonly isGitHubAuthE
width={64}
height={64}
priority={true}
src={'/img/logo_dark.png'}
src={logoSrc}
className="h-full w-auto object-contain"
alt="OWASP Logo"
/>
Expand Down