Skip to content

Commit

Permalink
feat: do not display language selection when there is a single availa…
Browse files Browse the repository at this point in the history
…ble language (#16)
  • Loading branch information
marc-gavanier authored Feb 12, 2024
1 parent 3069684 commit ebffaa7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/app/(home)/_components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ export const Header = (): ReactElement => {
<Nav.Link href='#speakers'>{i18n.speakers}</Nav.Link>
<Nav.Link href='#tickets'>{i18n.tickets}</Nav.Link>
<Nav.Link href='#sponsors'>{i18n.sponsors}</Nav.Link>
<NavDropdown className='bg-opacity-10' title={`${selectedLanguage.toUpperCase()}`} id='translation-dropdown'>
{LANGUAGE_SETTINGS.availableLanguages.map((lang: string) => (
<NavDropdown.Item as='button' onClick={() => changeSelectedLanguage(lang)} key={lang}>
{languagesMap.get(lang)}
</NavDropdown.Item>
))}
</NavDropdown>
{LANGUAGE_SETTINGS.availableLanguages.length > 1 && (
<NavDropdown className='bg-opacity-10' title={`${selectedLanguage.toUpperCase()}`} id='translation-dropdown'>
{LANGUAGE_SETTINGS.availableLanguages.map((lang: string) => (
<NavDropdown.Item as='button' onClick={() => changeSelectedLanguage(lang)} key={lang}>
{languagesMap.get(lang)}
</NavDropdown.Item>
))}
</NavDropdown>
)}
</Nav>
</Navbar.Collapse>
</Container>
Expand Down

0 comments on commit ebffaa7

Please sign in to comment.