[JA] translate docs page

This commit is contained in:
tequ
2024-07-02 09:04:30 +09:00
parent 0cf71fc46f
commit edb1b5c997
3 changed files with 86 additions and 62 deletions

View File

@@ -1,5 +1,6 @@
import React from "react";
import { useTranslate } from "@portal/hooks";
import { useThemeHooks } from '@redocly/theme/core/hooks';
import { Link } from "@redocly/theme/components/Link/Link";
interface PageProps {
description: string;
@@ -15,19 +16,20 @@ export const NavList: React.FC<NavListProps> = ({
pages,
bottomBorder = true,
}) => {
const { useTranslate } = useThemeHooks();
const { translate } = useTranslate();
return (
<ul className="nav flex-column">
{pages.map((useCase, index) => (
<li className="nav-item" key={useCase.link}>
<a
href={useCase.link}
<Link
to={useCase.link}
className={`nav-link ${
index === pages.length - 1 && !bottomBorder ? "border-none" : ""
}`}
>
{translate(useCase.description)}
</a>
</Link>
</li>
))}
</ul>