Files
suwayomi-material-you-webui/src/screens/Browse.tsx
schroda d58bd6cd92 add translation keys (#246)
* Fix i18n tsc issue

"t" can return null by default.
This was already disabled in the config, but it had no effect on tsc.

* Fix translation in "DefaultNavBar"

key was missing and since this is a constant the translation wouldn't update in case the language got changed after first load.

* Enable typing for i18n translation keys

* Add translation keys
2023-03-23 16:29:32 +03:30

45 lines
1.4 KiB
TypeScript

/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React, { useState } from 'react';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
import TabPanel from 'components/util/TabPanel';
import Sources from 'screens/Sources';
import Extensions from 'screens/Extensions';
import { useTranslation } from 'react-i18next';
export default function Browse() {
const { t } = useTranslation();
const [tabNum, setTabNum] = useState<number>(0);
return (
<>
<Tabs
value={tabNum}
onChange={(e, newTab) => setTabNum(newTab)}
indicatorColor="primary"
textColor="primary"
centered
variant="fullWidth"
scrollButtons
allowScrollButtonsMobile
>
<Tab sx={{ textTransform: 'none' }} label={t('source.title')} />
<Tab sx={{ textTransform: 'none' }} label={t('extension.title')} />
</Tabs>
<TabPanel index={0} currentIndex={tabNum}>
<Sources />
</TabPanel>
<TabPanel index={1} currentIndex={tabNum}>
<Extensions />
</TabPanel>
</>
);
}