diff --git a/README.md b/README.md index efd235d1..768fb42d 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,12 @@ You can find the release note for the latest release [here](https://github.com/f You can browse them all [here](https://github.com/fkhadra/react-toastify/releases) +## Latest Code Changes +Import toast file from Core +Added button for Close all toastr as svg (X) + in ToastContainer.tsx file +Added closeAllprop variable for style property + ## License Licensed under MIT diff --git a/src/components/ToastContainer.tsx b/src/components/ToastContainer.tsx index 7ff346a3..b6decba0 100644 --- a/src/components/ToastContainer.tsx +++ b/src/components/ToastContainer.tsx @@ -2,19 +2,25 @@ /* eslint react/prop-types: "off" */ import React, { forwardRef, StyleHTMLAttributes, useEffect } from 'react'; import cx from 'clsx'; - +import { toast } from '../core'; import { Toast } from './Toast'; import { CloseButton } from './CloseButton'; import { Bounce } from './Transitions'; import { Direction, Default, parseClassName, isFn } from '../utils'; import { useToastContainer } from '../hooks/useToastContainer'; import { ToastContainerProps, ToastPosition } from '../types'; - export const ToastContainer = forwardRef( (props, ref) => { const { getToastToRender, containerRef, isToastActive } = useToastContainer(props); const { className, style, rtl, containerId } = props; + const closeAllprop = { + backgroundColor: '#fff', + border: '2px solid white', + padding: '5px', + borderRadius: '50%', + color: '#000' + }; function getClassName(position: ToastPosition) { const defaultClassName = cx( @@ -73,6 +79,21 @@ export const ToastContainer = forwardRef( ); })} + {toastList.length > 1 && ( + + )} ); })}