diff --git a/code/ui/manager/src/components/mobile/navigation/MobileNavigation.tsx b/code/ui/manager/src/components/mobile/navigation/MobileNavigation.tsx index 9cb7cc2e5dbe..97387b873f24 100644 --- a/code/ui/manager/src/components/mobile/navigation/MobileNavigation.tsx +++ b/code/ui/manager/src/components/mobile/navigation/MobileNavigation.tsx @@ -20,14 +20,12 @@ const useFullStoryName = () => { const { index } = useStorybookState(); const currentStory = useStorybookApi().getCurrentStoryData(); - if (!currentStory) { - return ''; - } + if (!currentStory) return ''; let fullStoryName = currentStory.renderLabel?.(currentStory) || currentStory.name; let node = index[currentStory.id]; - while ('parent' in node && node.parent && index[node.parent]) { + while ('parent' in node && node.parent && index[node.parent] && fullStoryName.length < 24) { node = index[node.parent]; const parentName = node.renderLabel?.(node) || node.name; fullStoryName = `${parentName}/${fullStoryName}`; @@ -45,12 +43,12 @@ export const MobileNavigation: FC = ({ menu, panel, showP {panel} {showPanel && ( - setMobilePanelOpen(true)} title="Open addon panel"> + setMobilePanelOpen(true)} title="Open addon panel"> - + )} ); @@ -71,12 +69,6 @@ const Container = styled.div(({ theme }) => ({ color: theme.color.mediumdark, })); -// We should not have to reset the margin-top here -// TODO: remove this once we have a the new IconButton component -const DrawerIconButton = styled(IconButton)({ - marginTop: 0, -}); - const Button = styled.button(({ theme }) => ({ all: 'unset', display: 'flex', @@ -86,4 +78,18 @@ const Button = styled.button(({ theme }) => ({ fontSize: `${theme.typography.size.s2 - 1}px`, padding: '0 7px', fontWeight: theme.typography.weight.bold, + WebkitLineClamp: 1, + + '> svg': { + width: 14, + height: 14, + flexShrink: 0, + }, })); + +const Text = styled.p({ + display: '-webkit-box', + WebkitLineClamp: 1, + WebkitBoxOrient: 'vertical', + overflow: 'hidden', +});