Skip to content

Commit

Permalink
fix: minor regression with menu item spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
robinpyon authored and rexxars committed Dec 19, 2023
1 parent d09822e commit 41caf72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/sanity/src/ui/__workshop__/MenuItemStory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React from 'react'
import {MenuItem} from '../menuItem'

const HOTKEYS = ['Ctrl', 'Alt', 'P']
const AVATAR_INITIALS = 'A.W.'
const AVATAR_INITIALS = 'AW'

export default function MenuItemStory() {
const text = useString('Text', 'Text', 'Props') || ''
Expand Down
12 changes: 7 additions & 5 deletions packages/sanity/src/ui/menuItem/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,19 @@ export const MenuItem = forwardRef(function MenuItem(
return (
<Flex align="center" gap={2}>
{preview && (
<PreviewWrapper paddingX={1}>
<PreviewWrapper>
<Flex align="center" height="fill" justify="center">
{preview}
</Flex>
</PreviewWrapper>
)}
{icon && (
<Text size={FONT_SIZE}>
{isValidElement(icon) && icon}
{isValidElementType(icon) && createElement(icon)}
</Text>
<Box paddingRight={1}>
<Text size={FONT_SIZE}>
{isValidElement(icon) && icon}
{isValidElementType(icon) && createElement(icon)}
</Text>
</Box>
)}
{text && (
<Stack flex={1} space={2}>
Expand Down

0 comments on commit 41caf72

Please sign in to comment.