From 42f971f32b0f87a35a7857da7a0c3b900dc5322a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Mart=C3=ADnez?= Date: Tue, 17 Sep 2019 20:37:08 +0200 Subject: [PATCH] Remove old Snackbar --- src/components/SnackbarContent/index.jsx | 110 ----------------------- src/theme/mui.js | 7 -- 2 files changed, 117 deletions(-) delete mode 100644 src/components/SnackbarContent/index.jsx diff --git a/src/components/SnackbarContent/index.jsx b/src/components/SnackbarContent/index.jsx deleted file mode 100644 index 7d6a4798..00000000 --- a/src/components/SnackbarContent/index.jsx +++ /dev/null @@ -1,110 +0,0 @@ -// @flow -import SnackbarContent from '@material-ui/core/SnackbarContent' -import classNames from 'classnames/bind' -import * as React from 'react' -import CloseIcon from '@material-ui/icons/Close' -import CheckCircleIcon from '@material-ui/icons/CheckCircle' -import ErrorIcon from '@material-ui/icons/Error' -import InfoIcon from '@material-ui/icons/Info' -import IconButton from '@material-ui/core/IconButton' -import { withStyles } from '@material-ui/core/styles' -import WarningIcon from '@material-ui/icons/Warning' -import { type WithStyles } from '~/theme/mui' -import { - secondary, warning, connected, error, -} from '~/theme/variables' - -type Variant = 'success' | 'error' | 'warning' | 'info' - -type MessageProps = WithStyles & { - variant: Variant, - message: string, -} - -type Props = MessageProps & { - onClose?: () => void, -} - -type CloseProps = WithStyles & { - onClose: () => void, -} - -const variantIcon = { - success: CheckCircleIcon, - warning: WarningIcon, - error: ErrorIcon, - info: InfoIcon, -} - -const styles = (theme) => ({ - success: { - backgroundColor: '#ffffff', - }, - successIcon: { - color: connected, - }, - warning: { - backgroundColor: '#fff3e2', - }, - warningIcon: { - color: warning, - }, - error: { - backgroundColor: '#ffe6ea', - }, - errorIcon: { - color: error, - }, - info: { - backgroundColor: '#ffffff', - }, - infoIcon: { - color: secondary, - }, - icon: { - fontSize: 20, - }, - iconVariant: { - opacity: 0.9, - marginRight: theme.spacing(1), - }, - message: { - display: 'flex', - alignItems: 'center', - }, -}) - -const Close = ({ classes, onClose }: CloseProps) => ( - - - -) - -const Message = ({ classes, message, variant }: MessageProps) => { - const Icon = variantIcon[variant] - - return ( - - - {message} - - ) -} - -const GnoSnackbarContent = ({ - variant, classes, message, onClose, -}: Props) => { - const action = onClose ? [] : undefined - const messageComponent = - - return ( - - ) -} - -export default withStyles(styles)(GnoSnackbarContent) diff --git a/src/theme/mui.js b/src/theme/mui.js index 01d96c8a..0b6cb1f3 100644 --- a/src/theme/mui.js +++ b/src/theme/mui.js @@ -199,13 +199,6 @@ export default createMuiTheme({ }, }, }, - MuiSnackbarContent: { - root: { - boxShadow: '0 0 10px 0 rgba(33, 48, 77, 0.1)', - borderRadius: '3px', - color: primary, - }, - }, MuiSvgIcon: { colorSecondary: { color: secondaryText,