From c29dd269bf22372419fe8f29181081bf932c180f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Krakowski?= <48633090+bart-krakowski@users.noreply.github.com> Date: Tue, 25 Aug 2026 09:36:41 +0200 Subject: [PATCH 1/2] fix: navbar showing Log In to signed-in users --- src/components/Navbar.tsx | 34 ++++++++++++++------------- src/components/NavbarAuthControls.tsx | 14 +++++++++-- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 3f09c3e14..e74fd2d6b 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -76,6 +76,7 @@ import { trackPartnerInquiry, } from '~/utils/partner-inquiry' import { fetchRecentPosts, type RecentPost } from '~/utils/blog.functions' +import { useCurrentUserQuery } from '~/hooks/useCurrentUser' const LogoSection = () => { return ( @@ -484,7 +485,6 @@ export function Navbar({ children }: { children: React.ReactNode }) { ) const [dismissedDesktopMenuKey, setDismissedDesktopMenuKey] = React.useState(null) - const [canLoadAuthControls, setCanLoadAuthControls] = React.useState(false) const [isScrolled, setIsScrolled] = React.useState(false) React.useEffect(() => { @@ -534,10 +534,6 @@ export function Navbar({ children }: { children: React.ReactNode }) { [blurActiveNavigationElement], ) - const requestAuthControls = React.useCallback(() => { - setCanLoadAuthControls(true) - }, []) - React.useEffect(() => { if (!mobileMenuOpen) { return @@ -556,6 +552,8 @@ export function Navbar({ children }: { children: React.ReactNode }) { } }, [mobileMenuOpen]) + const userQuery = useCurrentUserQuery() + const getLoginButtonFallback = (className?: string) => ( ) - const renderAuthControls = (className?: string) => - canLoadAuthControls ? ( - - - + const getAuthControlsFallback = (className?: string) => + userQuery.data || userQuery.isLoading ? ( +