From 0abba7f87c73391bca42b762ace3f3be7d34b9ce Mon Sep 17 00:00:00 2001 From: bharathy Date: Wed, 18 Jan 2023 14:46:28 +0530 Subject: [PATCH 1/3] Close All button --- src/components/ToastContainer.tsx | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/components/ToastContainer.tsx b/src/components/ToastContainer.tsx index 7ff346a3..e6831bff 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( @@ -32,6 +38,7 @@ export const ToastContainer = forwardRef( } useEffect(() => { + console.log('check'); if (ref) { (ref as React.MutableRefObject).current = containerRef.current!; @@ -73,6 +80,21 @@ export const ToastContainer = forwardRef( ); })} + {toastList.length > 1 && ( + + )} ); })} From 21cb5566588a7b5d0a7c02d9f79ffeff5424b943 Mon Sep 17 00:00:00 2001 From: bharathy Date: Wed, 18 Jan 2023 14:50:31 +0530 Subject: [PATCH 2/3] removed console --- src/components/ToastContainer.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ToastContainer.tsx b/src/components/ToastContainer.tsx index e6831bff..b6decba0 100644 --- a/src/components/ToastContainer.tsx +++ b/src/components/ToastContainer.tsx @@ -38,7 +38,6 @@ export const ToastContainer = forwardRef( } useEffect(() => { - console.log('check'); if (ref) { (ref as React.MutableRefObject).current = containerRef.current!; From 3bb10ae8a8e99afce8192a7df11969909e2401a8 Mon Sep 17 00:00:00 2001 From: bharathy Date: Wed, 18 Jan 2023 15:02:32 +0530 Subject: [PATCH 3/3] ReadME.md file --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) 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