feat translation of the user module

Signed-off-by: jingyang <3161362058@qq.com>
This commit is contained in:
jingyang
2023-08-02 10:50:38 +08:00
parent 911c5c00ba
commit 2f28f57d78
8 changed files with 111 additions and 25 deletions

View File

@@ -2,6 +2,7 @@ import React, { useMemo } from 'react';
import { Box, Flex, useTheme } from '@chakra-ui/react';
import type { GridProps } from '@chakra-ui/react';
import MyIcon, { type IconName } from '../Icon';
import { useTranslation } from 'next-i18next';
// @ts-ignore
export interface Props extends GridProps {
@@ -12,6 +13,7 @@ export interface Props extends GridProps {
}
const SideTabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) => {
const { t } = useTranslation();
const sizeMap = useMemo(() => {
switch (size) {
case 'sm':
@@ -61,7 +63,7 @@ const SideTabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) =>
}}
>
<MyIcon mr={2} name={item.icon as IconName} w={'16px'} />
{item.label}
{t(item.label)}
</Flex>
))}
</Box>