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

Commit

Permalink
refactor: use classnames
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarsha-deriv committed Jun 21, 2023
1 parent ea56a0d commit a1ddedc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const config = {
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en', 'pr'],
locales: ['en', 'es'],
localeConfigs: {
en: {
label: 'English',
},
pr: {
label: 'Portuguese',
es: {
label: 'Español',
},
},
},
Expand Down
9 changes: 3 additions & 6 deletions src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { useLocation } from '@docusaurus/router';
import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem';
import type { LinkLikeNavbarItemProps } from '@theme/NavbarItem';
import type { Props } from '@theme/NavbarItem/LocaleDropdownNavbarItem';
import classnames from 'classnames';

export default function LocaleDropdownNavbarItem({
// mobile,
dropdownItemsBefore,
dropdownItemsAfter,
...props
Expand All @@ -31,9 +31,7 @@ export default function LocaleDropdownNavbarItem({
to,
target: '_self',
autoAddBaseUrl: false,
className:
// eslint-disable-next-line no-nested-ternary
locale === currentLocale ? 'dropdown__link--active' : '',
className: classnames({ 'dropdown__link--active': locale === currentLocale }),
};
});

Expand All @@ -44,8 +42,7 @@ export default function LocaleDropdownNavbarItem({
return (
<DropdownNavbarItem
{...props}
// mobile={mobile}
label={<>{dropdownLabel === 'English' ? 'EN' : 'PT'}</>}
label={<>{dropdownLabel === 'English' ? 'EN' : 'ES'}</>}
items={items}
/>
);
Expand Down

0 comments on commit a1ddedc

Please sign in to comment.