Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit a1ddedc

Browse files
refactor: use classnames
1 parent ea56a0d commit a1ddedc

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

docusaurus.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ const config = {
2424
// to replace "en" with "zh-Hans".
2525
i18n: {
2626
defaultLocale: 'en',
27-
locales: ['en', 'pr'],
27+
locales: ['en', 'es'],
2828
localeConfigs: {
2929
en: {
3030
label: 'English',
3131
},
32-
pr: {
33-
label: 'Portuguese',
32+
es: {
33+
label: 'Español',
3434
},
3535
},
3636
},

src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { useLocation } from '@docusaurus/router';
55
import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem';
66
import type { LinkLikeNavbarItemProps } from '@theme/NavbarItem';
77
import type { Props } from '@theme/NavbarItem/LocaleDropdownNavbarItem';
8+
import classnames from 'classnames';
89

910
export default function LocaleDropdownNavbarItem({
10-
// mobile,
1111
dropdownItemsBefore,
1212
dropdownItemsAfter,
1313
...props
@@ -31,9 +31,7 @@ export default function LocaleDropdownNavbarItem({
3131
to,
3232
target: '_self',
3333
autoAddBaseUrl: false,
34-
className:
35-
// eslint-disable-next-line no-nested-ternary
36-
locale === currentLocale ? 'dropdown__link--active' : '',
34+
className: classnames({ 'dropdown__link--active': locale === currentLocale }),
3735
};
3836
});
3937

@@ -44,8 +42,7 @@ export default function LocaleDropdownNavbarItem({
4442
return (
4543
<DropdownNavbarItem
4644
{...props}
47-
// mobile={mobile}
48-
label={<>{dropdownLabel === 'English' ? 'EN' : 'PT'}</>}
45+
label={<>{dropdownLabel === 'English' ? 'EN' : 'ES'}</>}
4946
items={items}
5047
/>
5148
);

0 commit comments

Comments
 (0)