Skip to content

Commit

Permalink
docs: change changelog paginator label
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Apr 27, 2022
1 parent 67faa68 commit 49cc802
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/src/plugins/changelog/theme/ChangelogPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import BlogLayout from '@theme/BlogLayout';
import ChangelogItem from '@theme/ChangelogItem';
import BlogPostPaginator from '@theme/BlogPostPaginator';
import ChangelogPaginator from '@theme/ChangelogPaginator';
import type {Props} from '@theme/BlogPostPage';
import {
PageMetadata,
Expand Down Expand Up @@ -97,7 +97,7 @@ function ChangelogPageContent(props: Props): JSX.Element {
</ChangelogItem>

{(nextItem || prevItem) && (
<BlogPostPaginator nextItem={nextItem} prevItem={prevItem} />
<ChangelogPaginator nextItem={nextItem} prevItem={prevItem} />
)}
</BlogLayout>
</>
Expand Down
56 changes: 56 additions & 0 deletions website/src/plugins/changelog/theme/ChangelogPaginator/index.tsx
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>
);
}
1 change: 1 addition & 0 deletions website/src/plugins/changelog/theme/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
declare module '@theme/ChangelogItem';
declare module '@theme/ChangelogAuthors';
declare module '@theme/ChangelogAuthor';
declare module '@theme/ChangelogPaginator';
declare module '@theme/IconExpand' {
import type {ComponentProps} from 'react';

Expand Down

0 comments on commit 49cc802

Please sign in to comment.