Skip to content
Open
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
14 changes: 12 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()
const [logoSrc, setLogoSrc] = useState('/img/logo_light.png')
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
useEffect(() => {
console.log('theme changed:', theme, '→', theme === 'dark' ? 'logo_dark' : 'logo_light')
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
setLogoSrc(theme === 'dark' ? '/img/logo_dark.png' : '/img/logo_light.png')
}, [theme])


Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
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,10 +176,11 @@ 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"
/>

</div>
<div className="text-2xl text-slate-800 dark:text-slate-300 dark:hover:text-slate-200">
Nest
Expand Down