refactor(web): remove typescript
This commit is contained in:
@@ -2,16 +2,11 @@ import * as React from 'react';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import useMediaQuery from '@mui/material/useMediaQuery';
|
||||
import Button from '@mui/material/Button';
|
||||
import type { ButtonProps } from '@mui/material/Button';
|
||||
|
||||
import { IconButton } from './style';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
export default function ConditionalIconButton(props: any): React.ReactElement {
|
||||
export default function ConditionalIconButton(props) {
|
||||
const { icon, ...buttonProps } = props;
|
||||
const theme = useTheme();
|
||||
const matchSmallScreens = useMediaQuery(theme.breakpoints.down('md'));
|
||||
|
||||
if (matchSmallScreens) {
|
||||
return (
|
||||
<IconButton
|
||||
@@ -27,6 +22,5 @@ export default function ConditionalIconButton(props: any): React.ReactElement {
|
||||
</IconButton>
|
||||
);
|
||||
}
|
||||
|
||||
return <Button {...(buttonProps as ButtonProps)} />;
|
||||
return <Button {...buttonProps} />;
|
||||
}
|
@@ -1,6 +1,5 @@
|
||||
import { styled } from '@mui/material/styles';
|
||||
import MuiIconButton, { iconButtonClasses } from '@mui/material/IconButton';
|
||||
|
||||
export const IconButton = styled(MuiIconButton)`
|
||||
&.${iconButtonClasses.colorPrimary}:not(.${iconButtonClasses.disabled}) {
|
||||
background: ${({ theme }) => theme.palette.primary.main};
|
||||
@@ -10,4 +9,4 @@ export const IconButton = styled(MuiIconButton)`
|
||||
background: ${({ theme }) => theme.palette.primary.dark};
|
||||
}
|
||||
}
|
||||
` as typeof MuiIconButton;
|
||||
`;
|
Reference in New Issue
Block a user