diff --git a/apps/wodsmith-start/src/components/cohost-sidebar.tsx b/apps/wodsmith-start/src/components/cohost-sidebar.tsx index 896cb7b47..b484343dd 100644 --- a/apps/wodsmith-start/src/components/cohost-sidebar.tsx +++ b/apps/wodsmith-start/src/components/cohost-sidebar.tsx @@ -81,7 +81,13 @@ const getNavigation = ( label: "Competition Setup", items: [ ...(permissions?.divisions - ? [{ label: "Divisions", href: `${basePath}/divisions`, icon: Layers }] + ? [ + { + label: "Divisions", + href: `${basePath}/divisions`, + icon: Layers, + }, + ] : []), ...(permissions?.editEvents ? [ @@ -98,13 +104,31 @@ const getNavigation = ( ] : []), ...(permissions?.locations - ? [{ label: "Locations", href: `${basePath}/locations`, icon: MapPin }] + ? [ + { + label: "Locations", + href: `${basePath}/locations`, + icon: MapPin, + }, + ] : []), ...(permissions?.scoringConfig - ? [{ label: "Scoring", href: `${basePath}/scoring`, icon: Calculator }] + ? [ + { + label: "Scoring", + href: `${basePath}/scoring`, + icon: Calculator, + }, + ] : []), ...(permissions?.viewRegistrations - ? [{ label: "Registrations", href: `${basePath}/athletes`, icon: Users }] + ? [ + { + label: "Registrations", + href: `${basePath}/athletes`, + icon: Users, + }, + ] : []), ...(permissions?.waivers ? [ @@ -189,7 +213,13 @@ const getNavigation = ( ] : []), ...(permissions?.sponsors - ? [{ label: "Sponsors", href: `${basePath}/sponsors`, icon: Sparkles }] + ? [ + { + label: "Sponsors", + href: `${basePath}/sponsors`, + icon: Sparkles, + }, + ] : []), ], }, @@ -215,8 +245,9 @@ function NavMenuItem({ item, isActive }: { item: NavItem; isActive: boolean }) { function CohostSidebarHeader({ competitionName }: { competitionName: string }) { return ( + {/* @lat: [[architecture#Route Groups#compete]] */} - + {/* @lat: [[architecture#Route Groups#compete]] */} + wodsmith compete
- + {/* @lat: [[architecture#Route Groups#compete]] */} + wodsmith compete - {competitionName} + + {competitionName} +
diff --git a/apps/wodsmith-start/src/components/compete-breadcrumb.tsx b/apps/wodsmith-start/src/components/compete-breadcrumb.tsx index 24d4aaddd..01c19a3fe 100644 --- a/apps/wodsmith-start/src/components/compete-breadcrumb.tsx +++ b/apps/wodsmith-start/src/components/compete-breadcrumb.tsx @@ -14,6 +14,9 @@ interface BreadcrumbSegment { href?: string } +// @lat: [[architecture#Route Groups#compete]] +const COMPETITION_DISCOVERY_PATH = "/" + /** * Route segment to human-readable label mapping */ @@ -128,9 +131,13 @@ export function CompeteBreadcrumb({ // Don't add href for the last segment (current page) const isLast = i === pathSegments.length - 1 + const href = + segment === "compete" && currentPath === "/compete" + ? COMPETITION_DISCOVERY_PATH + : currentPath segments.push({ label, - href: isLast ? undefined : currentPath, + href: isLast ? undefined : href, }) } diff --git a/apps/wodsmith-start/src/components/compete-mobile-nav.tsx b/apps/wodsmith-start/src/components/compete-mobile-nav.tsx index 51c658a50..3d17594c1 100644 --- a/apps/wodsmith-start/src/components/compete-mobile-nav.tsx +++ b/apps/wodsmith-start/src/components/compete-mobile-nav.tsx @@ -33,7 +33,7 @@ interface AthleteProfileMissingFields { interface CompeteMobileNavProps { session: SessionValidationResult | null invitations?: PendingInvitation[] - canOrganize?: boolean + hasOrganizerApplication?: boolean missingProfileFields?: AthleteProfileMissingFields | null } @@ -63,12 +63,23 @@ function shouldHideBrand(pathname: string) { export default function CompeteMobileNav({ session, invitations = [], - canOrganize = false, + hasOrganizerApplication = false, missingProfileFields = null, }: CompeteMobileNavProps) { const [open, setOpen] = useState(false) const router = useRouterState() const pathname = router.location.pathname + const isCompetitionIndex = pathname === "/" + const isManageCompetitionsActive = + pathname === "/compete/organizer" || + pathname.startsWith("/compete/organizer/") + const competitionsLinkClass = isCompetitionIndex + ? "font-semibold text-foreground underline decoration-primary decoration-2 underline-offset-4 dark:text-dark-foreground" + : "hover:text-primary" + const manageCompetitionsLinkClass = isManageCompetitionsActive + ? "flex items-center gap-2 font-semibold text-foreground underline decoration-primary decoration-2 underline-offset-4 dark:text-dark-foreground" + : "flex items-center gap-2 hover:text-primary" + const showManageCompetitionsLink = hasOrganizerApplication const isProfileIncomplete = missingProfileFields && @@ -95,9 +106,10 @@ export default function CompeteMobileNav({ Navigation Menu