import React from 'react' import PropTypes from 'prop-types' import { Card, Flex, Text } from 'rebass' import X from 'components/Icon/X' import SystemSuccess from 'components/Icon/SystemSuccess' import SystemWarning from 'components/Icon/SystemWarning' import SystemError from 'components/Icon/SystemError' import Spinner from './Spinner' /** * @render react * @name Notification * @example * Success message */ class Notification extends React.Component { static displayName = 'Notification' static defaultProps = { processing: false, variant: 'success' } static propTypes = { children: PropTypes.node, processing: PropTypes.bool, variant: PropTypes.string } constructor(props) { super(props) this.state = { hover: false } this.hoverOn = this.hoverOn.bind(this) this.hoverOff = this.hoverOff.bind(this) } hoverOn() { this.setState({ hover: true }) } hoverOff() { this.setState({ hover: false }) } render() { const { children, processing, variant } = this.props const { hover } = this.state return ( {processing && } {!processing && variant === 'success' && } {!processing && variant === 'warning' && } {!processing && variant === 'error' && } {children} ) } } export default Notification