From 41caf721736b8a738b2ba8034526400d9e8e333a Mon Sep 17 00:00:00 2001 From: Robin Pyon Date: Wed, 6 Dec 2023 17:31:16 +0000 Subject: [PATCH] fix: minor regression with menu item spacing --- .../sanity/src/ui/__workshop__/MenuItemStory.tsx | 2 +- packages/sanity/src/ui/menuItem/MenuItem.tsx | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/sanity/src/ui/__workshop__/MenuItemStory.tsx b/packages/sanity/src/ui/__workshop__/MenuItemStory.tsx index 25e9984f21a..df4f134c2cf 100644 --- a/packages/sanity/src/ui/__workshop__/MenuItemStory.tsx +++ b/packages/sanity/src/ui/__workshop__/MenuItemStory.tsx @@ -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') || '' diff --git a/packages/sanity/src/ui/menuItem/MenuItem.tsx b/packages/sanity/src/ui/menuItem/MenuItem.tsx index 2a706b45c67..f28f33a671c 100644 --- a/packages/sanity/src/ui/menuItem/MenuItem.tsx +++ b/packages/sanity/src/ui/menuItem/MenuItem.tsx @@ -75,17 +75,19 @@ export const MenuItem = forwardRef(function MenuItem( return ( {preview && ( - + {preview} )} {icon && ( - - {isValidElement(icon) && icon} - {isValidElementType(icon) && createElement(icon)} - + + + {isValidElement(icon) && icon} + {isValidElementType(icon) && createElement(icon)} + + )} {text && (