Skip to content

Commit 7252d7f

Browse files
fix(multi-org): no HR line when switch button hidden (#5509)
1 parent eb93758 commit 7252d7f

File tree

1 file changed

+23
-21
lines changed
  • src/identity/components/GlobalHeader/GlobalHeaderDropdown

1 file changed

+23
-21
lines changed

src/identity/components/GlobalHeader/GlobalHeaderDropdown/index.tsx

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ export class GlobalHeaderDropdown extends React.Component<Props, State> {
107107
const {mainMenuOptions} = this.props
108108
return (
109109
<div>
110-
<hr className="line-break" />
111110
{mainMenuOptions.map(value => {
112111
const iconEl = <Icon glyph={value.iconFont} className="button-icon" />
113112
const textEl = <span>{value.name}</span>
@@ -172,27 +171,30 @@ export class GlobalHeaderDropdown extends React.Component<Props, State> {
172171
>
173172
{/* Multi-org UI tickets #4051 and #4047, when user only has 1 account or 1 org, switch button is disabled */}
174173
{!onlyRenderSubmenu && typeAheadMenuOptions.length > 1 && (
175-
<Dropdown.Item
176-
onClick={this.toggleShowTypeAheadMenu}
177-
className="global-header--switch-button"
178-
>
179-
<FlexBox
180-
justifyContent={JustifyContent.SpaceBetween}
181-
alignItems={AlignItems.Center}
174+
<>
175+
<Dropdown.Item
176+
onClick={this.toggleShowTypeAheadMenu}
177+
className="global-header--switch-button"
182178
>
183-
<span className="global-header--align-center">
184-
{iconEl}
185-
{textEl}
186-
</span>
187-
{showTypeAheadMenu === false && (
188-
<Icon
189-
glyph={IconFont.CaretRight_New}
190-
className="button-icon"
191-
style={{marginRight: 0}}
192-
/>
193-
)}
194-
</FlexBox>
195-
</Dropdown.Item>
179+
<FlexBox
180+
justifyContent={JustifyContent.SpaceBetween}
181+
alignItems={AlignItems.Center}
182+
>
183+
<span className="global-header--align-center">
184+
{iconEl}
185+
{textEl}
186+
</span>
187+
{showTypeAheadMenu === false && (
188+
<Icon
189+
glyph={IconFont.CaretRight_New}
190+
className="button-icon"
191+
style={{marginRight: 0}}
192+
/>
193+
)}
194+
</FlexBox>
195+
</Dropdown.Item>
196+
<hr className="line-break" />
197+
</>
196198
)}
197199
{showTypeAheadMenu
198200
? this.renderTypeAheadMenu()

0 commit comments

Comments
 (0)