-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: change changelog paginator label
- Loading branch information
Showing
3 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
website/src/plugins/changelog/theme/ChangelogPaginator/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// Changed the text labels. | ||
|
||
import React from 'react'; | ||
import Translate, {translate} from '@docusaurus/Translate'; | ||
import PaginatorNavLink from '@theme/PaginatorNavLink'; | ||
import type {Props} from '@theme/BlogPostPaginator'; | ||
|
||
export default function ChangelogPaginator(props: Props): JSX.Element { | ||
const {nextItem, prevItem} = props; | ||
|
||
return ( | ||
<nav | ||
className="pagination-nav docusaurus-mt-lg" | ||
aria-label={translate({ | ||
id: 'theme.changelog.post.paginator.navAriaLabel', | ||
message: 'Changelog item navigation', | ||
description: 'The ARIA label for the changelog pagination', | ||
})}> | ||
<div className="pagination-nav__item"> | ||
{prevItem && ( | ||
<PaginatorNavLink | ||
{...prevItem} | ||
subLabel={ | ||
<Translate | ||
id="theme.changelog.post.paginator.newerRelease" | ||
description="The changelog button label to navigate to the newer release"> | ||
Newer release | ||
</Translate> | ||
} | ||
/> | ||
)} | ||
</div> | ||
<div className="pagination-nav__item pagination-nav__item--next"> | ||
{nextItem && ( | ||
<PaginatorNavLink | ||
{...nextItem} | ||
subLabel={ | ||
<Translate | ||
id="theme.changelog.post.paginator.olderRelease" | ||
description="The changelog button label to navigate to the older release"> | ||
Older release | ||
</Translate> | ||
} | ||
/> | ||
)} | ||
</div> | ||
</nav> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters