Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
feat(Header): hide metaMenu if lang < 2
Browse files Browse the repository at this point in the history
  • Loading branch information
CanRau committed Apr 5, 2020
1 parent 962fe4e commit 830ce43
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,26 @@ const Header = ({ homepage, meta, menu, logo, bgImage }) => {
</Brand>

{/* TODO: remember lang in local FORAGE? to show correct in 404 */}
<Meta>
{meta.map(link => (
<MetaItem className={link.class} key={link.id}>
<MetaLink
to={link.to}
activeClassName="active"
onClick={() => setCookie(`nf_lang`, link.id)}
>
<OnlyDesktop visible={link.titleShort}>
{link.title}
</OnlyDesktop>
{link.titleShort && (
<OnlyMobile>{link.titleShort}</OnlyMobile>
)}
</MetaLink>
</MetaItem>
))}
</Meta>
{meta.length > 1 && (
<Meta>
{meta.map(link => (
<MetaItem className={link.class} key={link.id}>
<MetaLink
to={link.to}
activeClassName="active"
onClick={() => setCookie(`nf_lang`, link.id)}
>
<OnlyDesktop visible={link.titleShort}>
{link.title}
</OnlyDesktop>
{link.titleShort && (
<OnlyMobile>{link.titleShort}</OnlyMobile>
)}
</MetaLink>
</MetaItem>
))}
</Meta>
)}
</TopInner>
</HeaderTop>

Expand Down

0 comments on commit 830ce43

Please sign in to comment.