2021-10-26 12:13:37 +03:30
|
|
|
/*
|
|
|
|
|
* 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/. */
|
|
|
|
|
|
2021-10-26 14:57:11 +03:30
|
|
|
import React, { useState } from 'react';
|
|
|
|
|
import Tabs from '@mui/material/Tabs';
|
|
|
|
|
import Tab from '@mui/material/Tab';
|
|
|
|
|
import TabPanel from 'components/util/TabPanel';
|
2021-10-30 16:16:36 +03:30
|
|
|
import Sources from 'screens/Sources';
|
|
|
|
|
import Extensions from 'screens/Extensions';
|
2023-02-14 16:47:38 +03:30
|
|
|
import { useTranslation } from 'react-i18next';
|
2021-10-26 14:57:11 +03:30
|
|
|
|
2021-10-26 12:13:37 +03:30
|
|
|
export default function Browse() {
|
2023-02-14 16:47:38 +03:30
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
2021-10-26 14:57:11 +03:30
|
|
|
const [tabNum, setTabNum] = useState<number>(0);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Tabs
|
|
|
|
|
value={tabNum}
|
|
|
|
|
onChange={(e, newTab) => setTabNum(newTab)}
|
|
|
|
|
indicatorColor="primary"
|
|
|
|
|
textColor="primary"
|
|
|
|
|
centered
|
|
|
|
|
variant="fullWidth"
|
|
|
|
|
scrollButtons
|
|
|
|
|
allowScrollButtonsMobile
|
|
|
|
|
>
|
2023-03-23 13:59:32 +01:00
|
|
|
<Tab sx={{ textTransform: 'none' }} label={t('source.title')} />
|
|
|
|
|
<Tab sx={{ textTransform: 'none' }} label={t('extension.title')} />
|
2021-10-26 14:57:11 +03:30
|
|
|
</Tabs>
|
|
|
|
|
<TabPanel index={0} currentIndex={tabNum}>
|
|
|
|
|
<Sources />
|
|
|
|
|
</TabPanel>
|
|
|
|
|
<TabPanel index={1} currentIndex={tabNum}>
|
|
|
|
|
<Extensions />
|
|
|
|
|
</TabPanel>
|
|
|
|
|
</>
|
|
|
|
|
);
|
2021-10-26 12:13:37 +03:30
|
|
|
}
|