UNPKG

@totalsoft/rocket-ui

Version:

A set of reusable and composable React components built on top of Material UI core for developing fast and friendly web applications interfaces.

48 lines 1.82 kB
import React from 'react'; import PropTypes from 'prop-types'; import { ToastContainer as ReactToastify } from 'react-toastify'; import Container, { classes } from './ToastStyles'; import 'react-toastify/dist/ReactToastify.css'; /** * Toast provide brief notifications. */ const ToastContainer = ({ position = 'top-center', newestOnTop = true, transitionType = 'Slide', closeOnClick = true, closeButton = false, icon = false, limit = 5, textSize = 'small', ...rest }) => { return (React.createElement(Container, { textSize: textSize }, React.createElement(ReactToastify, { className: classes.toastWrapper, position: position, closeOnClick: closeOnClick, closeButton: closeButton, newestOnTop: newestOnTop, icon: icon, transition: transitionType, theme: "colored", limit: limit, ...rest }))); }; ToastContainer.propTypes = { /** * Limit the number of toast displayed at the same time * @default 5 */ limit: PropTypes.number, /** * Close the toast when clicked. * @default true */ closeOnClick: PropTypes.bool, /** * Set the position to use. * @default 'top-center' */ position: PropTypes.oneOf(['top-right', 'top-center', 'top-left', 'bottom-right', 'bottom-center', 'bottom-left']), /** * The appearance effect. * @default Slide */ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore transitionType: PropTypes.oneOf(['Slide', 'Bounce', 'Zoom', 'Flip']), /** * Whether or not to display the newest toast on top. * @default true */ newestOnTop: PropTypes.bool, /** * @default 'small' * The content font size */ textSize: PropTypes.oneOf(['small', 'medium', 'large']) }; export default ToastContainer; //# sourceMappingURL=ToastContainer.js.map