|
1 | 1 | import React from 'react'; |
2 | 2 | import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; |
3 | 3 | import { useAlternatePageUtils } from '@docusaurus/theme-common/internal'; |
4 | | -import { translate } from '@docusaurus/Translate'; |
5 | 4 | import { useLocation } from '@docusaurus/router'; |
6 | 5 | import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem'; |
7 | 6 | import type { LinkLikeNavbarItemProps } from '@theme/NavbarItem'; |
@@ -34,27 +33,13 @@ export default function LocaleDropdownNavbarItem({ |
34 | 33 | autoAddBaseUrl: false, |
35 | 34 | className: |
36 | 35 | // eslint-disable-next-line no-nested-ternary |
37 | | - locale === currentLocale |
38 | | - ? // Similar idea as DefaultNavbarItem: select the right Infima active |
39 | | - // class name. This cannot be substituted with isActive, because the |
40 | | - // target URLs contain `pathname://` and therefore are not NavLinks! |
41 | | - // mobile |
42 | | - // ? 'menu__link--active' : |
43 | | - 'dropdown__link--active' |
44 | | - : '', |
| 36 | + locale === currentLocale ? 'dropdown__link--active' : '', |
45 | 37 | }; |
46 | 38 | }); |
47 | 39 |
|
48 | 40 | const items = [...dropdownItemsBefore, ...localeItems, ...dropdownItemsAfter]; |
49 | 41 |
|
50 | | - // Mobile is handled a bit differently |
51 | | - const dropdownLabel = |
52 | | - // mobile ? translate({ |
53 | | - // message: 'Languages', |
54 | | - // id: 'theme.navbar.mobileLanguageDropdown.label', |
55 | | - // description: 'The label for the mobile language switcher dropdown', |
56 | | - // }) : |
57 | | - localeConfigs[currentLocale].label; |
| 42 | + const dropdownLabel = localeConfigs[currentLocale].label; |
58 | 43 |
|
59 | 44 | return ( |
60 | 45 | <DropdownNavbarItem |
|
0 commit comments