// @flow import * as React from 'react'; import { defineMessages, injectIntl } from 'react-intl'; import classNames from 'classnames'; import IconAlertCircle from '../../icons/general/IconAlertCircle'; import IconBell from '../../icons/general/IconBell'; import IconClose from '../../icons/general/IconClose'; import IconInfoThin from '../../icons/general/IconInfoThin'; import IconSync from '../../icons/general/IconSync'; import './Notification.scss'; // @NOTE: We can't import these constants from ./constant.js because `react-docgen` // can't handle imported variables appear in propTypes // see https://github.com/reactjs/react-docgen/issues/33 const DURATION_SHORT = 'short'; const DURATION_LONG = 'long'; const TYPE_DEFAULT = 'default'; const TYPE_INFO = 'info'; const TYPE_WARN = 'warn'; const TYPE_ERROR = 'error'; const OVERFLOW_WRAP = 'wrap'; const DURATION_TIMES = { [DURATION_SHORT]: 5000, [DURATION_LONG]: 10000, }; const ICON_RENDERER: { [string]: Function } = { [TYPE_DEFAULT]: () => , [TYPE_ERROR]: () => , [TYPE_INFO]: () => , [TYPE_WARN]: () => , }; const messages = defineMessages({ clearNotificationButtonText: { defaultMessage: 'Clear Notification', description: 'Button to clear notification', id: 'boxui.notification.clearNotification', }, }); type Props = { /** * The contents of the `Notification`. * - Notification text must be wrapped in a `` tag. * - Notification buttons must be the ` ); } } export default injectIntl(Notification);