Skip to content

Commit

Permalink
change(language): restore dropdown duplication in order to properly s…
Browse files Browse the repository at this point in the history
…how and hide language dropdown
  • Loading branch information
ichim-david committed Feb 21, 2023
1 parent cc6064f commit cb28888
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions src/ui/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,35 @@ const TopDropdownMenu = ({
const Component = ({ mobileText }) => {
return (
<>
<Dropdown
id={id}
className={className}
text={mobileText || text}
icon={icon || 'chevron down'}
aria-label="dropdown"
closeOnChange={true}
closeOnBlur={false}
closeOnEscape={true}
>
<Dropdown.Menu role="group">{children}</Dropdown.Menu>
</Dropdown>
{children.props['aria-label'] === 'language switcher' ? (
hasLanguageDropdown && (
<Dropdown
id={id}
className={className}
text={mobileText || text}
icon={icon || 'chevron down'}
aria-label="dropdown"
closeOnChange={true}
closeOnBlur={false}
closeOnEscape={true}
>
<Dropdown.Menu role="group">{children}</Dropdown.Menu>
</Dropdown>
)
) : (
<Dropdown
id={id}
className={className}
text={mobileText || text}
icon={icon || 'chevron down'}
aria-label="dropdown"
closeOnChange={true}
closeOnBlur={false}
closeOnEscape={true}
>
<Dropdown.Menu role="group">{children}</Dropdown.Menu>
</Dropdown>
)}
</>
);
};
Expand Down

0 comments on commit cb28888

Please sign in to comment.