refactor(web): remove typescript
This commit is contained in:
@@ -6,18 +6,12 @@ import useMediaQuery from '@mui/material/useMediaQuery';
|
||||
import AccountCircleIcon from '@mui/icons-material/AccountCircle';
|
||||
import ArrowBackIosNewIcon from '@mui/icons-material/ArrowBackIosNew';
|
||||
import PaymentIcon from '@mui/icons-material/Payment';
|
||||
|
||||
import * as URLS from 'config/urls';
|
||||
import useAutomatischInfo from 'hooks/useAutomatischInfo';
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
import AppBar from 'components/AppBar';
|
||||
import Drawer from 'components/Drawer';
|
||||
|
||||
type SettingsLayoutProps = {
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
function createDrawerLinks({ isCloud }: { isCloud: boolean }) {
|
||||
function createDrawerLinks({ isCloud }) {
|
||||
const items = [
|
||||
{
|
||||
Icon: AccountCircleIcon,
|
||||
@@ -25,7 +19,6 @@ function createDrawerLinks({ isCloud }: { isCloud: boolean }) {
|
||||
to: URLS.SETTINGS_PROFILE,
|
||||
},
|
||||
];
|
||||
|
||||
if (isCloud) {
|
||||
items.push({
|
||||
Icon: PaymentIcon,
|
||||
@@ -33,23 +26,17 @@ function createDrawerLinks({ isCloud }: { isCloud: boolean }) {
|
||||
to: URLS.SETTINGS_BILLING_AND_USAGE,
|
||||
});
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
export default function SettingsLayout({
|
||||
children,
|
||||
}: SettingsLayoutProps): React.ReactElement {
|
||||
export default function SettingsLayout({ children }) {
|
||||
const { isCloud } = useAutomatischInfo();
|
||||
const theme = useTheme();
|
||||
const formatMessage = useFormatMessage();
|
||||
const matchSmallScreens = useMediaQuery(theme.breakpoints.down('lg'));
|
||||
const [isDrawerOpen, setDrawerOpen] = React.useState(!matchSmallScreens);
|
||||
|
||||
const openDrawer = () => setDrawerOpen(true);
|
||||
const closeDrawer = () => setDrawerOpen(false);
|
||||
const drawerLinks = createDrawerLinks({ isCloud });
|
||||
|
||||
const drawerBottomLinks = [
|
||||
{
|
||||
Icon: ArrowBackIosNewIcon,
|
||||
@@ -57,7 +44,6 @@ export default function SettingsLayout({
|
||||
to: '/',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppBar
|
Reference in New Issue
Block a user