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.

46 lines 1.74 kB
import React from 'react'; import PropTypes from 'prop-types'; import { ToastContainer as ReactToastify, toast } from 'react-toastify'; import Container, { classes } from './ToastStyles'; import 'react-toastify/dist/ReactToastify.css'; /** * Toast provide brief notifications. */ const ToastContainer = ({ position = toast.POSITION.TOP_CENTER, newestOnTop = true, transitionType = 'Slide', limit = 5, ...rest }) => { return (React.createElement(Container, null, React.createElement(ReactToastify, { className: classes.toastWrapper, position: position, newestOnTop: newestOnTop, transition: transitionType, theme: "colored", limit: limit, ...rest }))); }; ToastContainer.propTypes = { /** * Set the delay in ms to close the toast automatically. * Use `false` to prevent the toast from closing. * @default false */ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore autoClose: PropTypes.oneOf([PropTypes.number, false]), /** * Limit the number of toast displayed at the same time * @default 5 */ limit: PropTypes.number, /** * 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 }; export default ToastContainer; //# sourceMappingURL=ToastContainer.js.map