Add DisplayMenu component#10
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Promotes the flow.game menu's triplicated big-uppercase display nav button (
MenuItemcopies inweb/menu/src/App.tsx,RoomsPage.tsx, and theSettingsPage.tsxBack button) into the shared library asDisplayMenu/DisplayMenuItem, so the flow.game SSR rewrite can consume one canonical implementation instead of three drifting copies.API
DisplayMenu—<nav>wrapper,flex flex-col items-start gap-1.5, accepts allnavprops.DisplayMenuItem— cva +useRender(same conventions asitem.tsx/badge.tsx), renders a<button type="button">by default or any element via the Base UIrenderprop (anchor, routerLink, ...).size:lg(text-2xl md:text-4xl, the rooms-page scale, default) |xl(text-6xl leading-none md:text-8xl, the home-menu scale)trailing?: React.ReactNode— smaller baseline-aligned suffix (text-lg md:text-xlatlg,text-3xl md:text-4xlatxl,font-semibold text-muted-foreground), used for the Play preload percentagedisabled?: boolean— setsaria-disabled+data-disabled, nativedisabledwhen rendering the default<button>, swapscursor-pointer hover:text-muted-foregroundforcursor-defaultfont-bold tracking-tight text-foreground,transition-[color] duration-200 ease-(--ease-out)data-slot="display-menu"/"display-menu-item"/"display-menu-item-trailing";displayMenuItemVariantsexported alongside the componentssrc/components/ui/index.ts; version bumped 0.16.1 -> 0.17.0 per the component-add convention (add StatusWidget component #7).Testing
bun run lintandbun run typecheckare both clean.bun run dev-> Components page -> new "Display Menu" section at the bottom demosxlwith a trailing42%while disabled, defaultlgitems, an anchor viarender, and a disabledlgitem (no hover shift, default cursor).