@@ -35,6 +35,12 @@ import { V4Badge } from "../V4Badge";
3535import { type SideMenuEnvironment , type SideMenuProject } from "./SideMenu" ;
3636import { Badge } from "../primitives/Badge" ;
3737
38+ // Size this Env popover's items to match the Project popover menu items
39+ // (SIDE_MENU_POPOVER_ITEM_* in SideMenu.tsx). Applied only at these call sites so the
40+ // shared EnvironmentLabel/EnvironmentCombo defaults used elsewhere in the app stay unchanged.
41+ const ENV_POPOVER_ITEM_ICON = "size-5" ;
42+ const ENV_POPOVER_ITEM_LABEL = "text-[0.90625rem] font-medium tracking-[-0.01em]" ;
43+
3844export function EnvironmentSelector ( {
3945 organization,
4046 project,
@@ -135,7 +141,13 @@ export function EnvironmentSelector({
135141 < PopoverMenuItem
136142 key = { env . id }
137143 to = { urlForEnvironment ( env ) }
138- title = { < EnvironmentCombo environment = { env } className = "mx-auto grow text-2sm" /> }
144+ title = {
145+ < EnvironmentCombo
146+ environment = { env }
147+ className = { cn ( "mx-auto grow" , ENV_POPOVER_ITEM_LABEL ) }
148+ iconClassName = { ENV_POPOVER_ITEM_ICON }
149+ />
150+ }
139151 isSelected = { env . id === environment . id }
140152 />
141153 ) ;
@@ -153,8 +165,12 @@ export function EnvironmentSelector({
153165 ) }
154166 title = {
155167 < div className = "flex w-full items-center justify-between" >
156- < EnvironmentCombo environment = { { type : "STAGING" } } className = "text-2sm" />
157- < span className = "text-indigo-500" > Upgrade</ span >
168+ < EnvironmentCombo
169+ environment = { { type : "STAGING" } }
170+ className = { ENV_POPOVER_ITEM_LABEL }
171+ iconClassName = { ENV_POPOVER_ITEM_ICON }
172+ />
173+ < span className = { cn ( "text-indigo-500" , ENV_POPOVER_ITEM_LABEL ) } > Upgrade</ span >
158174 </ div >
159175 }
160176 isSelected = { false }
@@ -167,8 +183,12 @@ export function EnvironmentSelector({
167183 ) }
168184 title = {
169185 < div className = "flex w-full items-center justify-between" >
170- < EnvironmentCombo environment = { { type : "PREVIEW" } } className = "text-2sm" />
171- < span className = "text-indigo-500" > Upgrade</ span >
186+ < EnvironmentCombo
187+ environment = { { type : "PREVIEW" } }
188+ className = { ENV_POPOVER_ITEM_LABEL }
189+ iconClassName = { ENV_POPOVER_ITEM_ICON }
190+ />
191+ < span className = { cn ( "text-indigo-500" , ENV_POPOVER_ITEM_LABEL ) } > Upgrade</ span >
172192 </ div >
173193 }
174194 isSelected = { false }
@@ -233,7 +253,11 @@ function Branches({
233253 textAlignLeft
234254 fullWidth
235255 >
236- < EnvironmentCombo environment = { parentEnvironment } className = "mx-auto grow text-2sm" />
256+ < EnvironmentCombo
257+ environment = { parentEnvironment }
258+ className = { cn ( "mx-auto grow" , ENV_POPOVER_ITEM_LABEL ) }
259+ iconClassName = { ENV_POPOVER_ITEM_ICON }
260+ />
237261 </ ButtonContent >
238262 </ PopoverTrigger >
239263 < PopoverContent
@@ -302,14 +326,16 @@ export function BranchesPopoverContent({
302326 to = { urlForEnvironment ( environment ) }
303327 title = {
304328 < >
305- < span className = { cn ( "block w-full" , envTextClassName ) } >
329+ < span className = { cn ( "block w-full" , envTextClassName , ENV_POPOVER_ITEM_LABEL ) } >
306330 { environment . branchName }
307331 </ span >
308332 < Badge variant = "extra-small" > Archived</ Badge >
309333 </ >
310334 }
311335 icon = {
312- < BranchEnvironmentIconSmall className = { cn ( "size-4 shrink-0" , envTextClassName ) } />
336+ < BranchEnvironmentIconSmall
337+ className = { cn ( ENV_POPOVER_ITEM_ICON , "shrink-0" , envTextClassName ) }
338+ />
313339 }
314340 isSelected = { environment . id === currentEnvironment . id }
315341 />
@@ -323,13 +349,13 @@ export function BranchesPopoverContent({
323349 key = { env . id }
324350 to = { urlForEnvironment ( env ) }
325351 title = {
326- < span className = { cn ( "block w-full" , envTextClassName ) } >
352+ < span className = { cn ( "block w-full" , envTextClassName , ENV_POPOVER_ITEM_LABEL ) } >
327353 { env . branchName ?? DEFAULT_DEV_BRANCH }
328354 </ span >
329355 }
330356 icon = {
331357 < BranchEnvironmentIconSmall
332- className = { cn ( "size-4 shrink-0", envTextClassName ) }
358+ className = { cn ( ENV_POPOVER_ITEM_ICON , " shrink-0", envTextClassName ) }
333359 />
334360 }
335361 isSelected = { env . id === currentEnvironment . id }
@@ -362,15 +388,17 @@ export function BranchesPopoverContent({
362388 < PopoverMenuItem
363389 to = { branchesDevPath ( organization , project , environment ) }
364390 title = "Manage dev branches"
365- icon = { < Cog8ToothIcon className = "size-4 text-text-dimmed" /> }
391+ icon = { < Cog8ToothIcon className = { cn ( ENV_POPOVER_ITEM_ICON , " text-text-dimmed") } /> }
366392 leadingIconClassName = "text-text-dimmed"
393+ className = { ENV_POPOVER_ITEM_LABEL }
367394 />
368395 ) : (
369396 < PopoverMenuItem
370397 to = { branchesPath ( organization , project , environment ) }
371398 title = "Manage preview branches"
372- icon = { < Cog8ToothIcon className = "size-4 text-text-dimmed" /> }
399+ icon = { < Cog8ToothIcon className = { cn ( ENV_POPOVER_ITEM_ICON , " text-text-dimmed") } /> }
373400 leadingIconClassName = "text-text-dimmed"
401+ className = { ENV_POPOVER_ITEM_LABEL }
374402 />
375403 ) }
376404 </ div >
0 commit comments