This commit is contained in:
josc146
2023-05-18 20:48:53 +08:00
parent 75075d6483
commit 5078a884b0
13 changed files with 252 additions and 59 deletions

View File

@@ -31,8 +31,10 @@ import {useMediaQuery} from 'usehooks-ts';
import {ToastContainer} from 'react-toastify';
import commonStore from './stores/commonStore';
import {observer} from 'mobx-react-lite';
import {useTranslation} from 'react-i18next';
const App: FC = observer(() => {
const {t} = useTranslation();
const navigate = useNavigate();
const location = useLocation();
const mq = useMediaQuery('(min-width: 640px)');
@@ -57,7 +59,7 @@ const App: FC = observer(() => {
>
{pages.filter(page => page.top).map(({label, path, icon}, index) => (
<Tab icon={icon} key={`${path}-${index}`} value={path}>
{mq && label}
{mq && t(label)}
</Tab>
))}
</TabList>
@@ -70,7 +72,7 @@ const App: FC = observer(() => {
>
{pages.filter(page => !page.top).map(({label, path, icon}, index) => (
<Tab icon={icon} key={`${path}-${index}`} value={path}>
{mq && label}
{mq && t(label)}
</Tab>
))}
</TabList>