Skip to content

Commit

Permalink
fix(header-topdropdown): dedupe html dropdown elements for topdropdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
ichim-david committed Mar 22, 2022
2 parents 78580d6 + 11b99e1 commit f10a7a8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/ui/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ const TopDropdownMenu = ({
<Dropdown.Menu role="group">{children}</Dropdown.Menu>
</Dropdown>
);
return (
<>
<Component />
{mobileText && <Component mobileText={mobileText} />}
</>
);
if (typeof window !== 'undefined') {
const resolution = window?.innerWidth;
const isMobile = resolution < 480;
return (
<>{isMobile ? <Component mobileText={mobileText} /> : <Component />}</>
);
}
return null;
};

const Main = ({
Expand Down

0 comments on commit f10a7a8

Please sign in to comment.