Skip to content

Commit

Permalink
fix(ui-top-nav-bar): fix topnavbar item width changing
Browse files Browse the repository at this point in the history
Closes: INSTUI-4085
  • Loading branch information
joyenjoyer committed Jun 25, 2024
1 parent a65f336 commit 88993e2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ class TopNavBarItem extends Component<TopNavBarItemProps, TopNavBarItemState> {
{this.renderAvatar()}
</span>
)}
{content}
<span css={styles?.contentText}>{content}</span>
{this.submenuIcon}
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ type TopNavBarItemStyle = ComponentStyle<
| 'topNavBarItem'
| 'container'
| 'content'
| 'contentText'
| 'avatarContainer'
| 'submenuTriggerContainer'
| 'submenuIcon'
Expand Down
15 changes: 13 additions & 2 deletions packages/ui-top-nav-bar/src/TopNavBar/TopNavBarItem/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,25 @@ const generateStyle = (
color: inverseColor ? componentTheme.colorInverse : componentTheme.color,

...(isActive && {
fontWeight: componentTheme.activeItemFontWeight,
letterSpacing: -0.1818
fontWeight: componentTheme.activeItemFontWeight
}),

'*': {
pointerEvents: 'none'
}
},
contentText: {
textAlign: 'center',
'&::before': {
display: 'block',
content: `"${props.children?.toString()}"`,
fontWeight: componentTheme.activeItemFontWeight,
height: '0px',
color: 'transparent',
overflow: 'hidden',
visibility: 'hidden'
}
},
avatarContainer: {
label: 'topNavBarItem__avatarContainer',
display: 'flex',
Expand Down

0 comments on commit 88993e2

Please sign in to comment.