diff --git a/features/marketplace/frontend-public/src/components/MarketplaceHeader.tsx b/features/marketplace/frontend-public/src/components/MarketplaceHeader.tsx index 1e2b2eb31..3e9302bf4 100755 --- a/features/marketplace/frontend-public/src/components/MarketplaceHeader.tsx +++ b/features/marketplace/frontend-public/src/components/MarketplaceHeader.tsx @@ -5,9 +5,10 @@ * Consumes theme from ThemeProvider and deployment config for vertical-specific branding. */ -import { Link, useLocation } from 'react-router-dom'; +import { Link, useLocation, useNavigate } from 'react-router-dom'; import styled from 'styled-components'; import { useDeploymentConfig } from '../hooks/useDeploymentConfig'; +import { clearStoredAudience } from '../features/landing/hooks/useAudienceDetection'; const HeaderContainer = styled.header` position: sticky; @@ -231,9 +232,18 @@ const MobileMenuButton = styled.button` export function MarketplaceHeader() { const location = useLocation(); + const navigate = useNavigate(); const currentPath = location.pathname; const { branding, vertical } = useDeploymentConfig(); + // Clear audience choice when navigating home via logo + // This allows users to return to the choice screen + const handleLogoClick = (e: React.MouseEvent) => { + e.preventDefault(); + clearStoredAudience(); + navigate('/'); + }; + const isActive = (path: string) => { if (path === '/' || path === '') { return currentPath === '/'; @@ -250,7 +260,7 @@ export function MarketplaceHeader() { return ( - + import('./WorkerLandingPage')); @@ -55,32 +55,22 @@ function PageLoader() { export default function AudienceRouter() { const { audience, confidence } = useAudienceDetection(); - // Allow overriding from choice screen without navigation - const [overrideAudience, setOverrideAudience] = useState(null); - - const handleChoice = useCallback((choice: 'worker' | 'client') => { - setOverrideAudience(choice); - }, []); - - // Use override if set, otherwise use detected audience - const effectiveAudience = overrideAudience || audience; - // Determine whether to show audience toggle // Show toggle when confidence is medium (detected but not definitive) const showToggle = confidence === 'medium'; return ( }> - {effectiveAudience === 'worker' && ( + {audience === 'worker' && ( )} - {effectiveAudience === 'client' && ( + {audience === 'client' && ( )} - {effectiveAudience === 'unknown' && ( - + {audience === 'unknown' && ( + )} );