Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: change changelog paginator label #7251

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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