feat: create edit Event Page and add closeOnAction prop for Toaster
This commit is contained in:
parent
b3ee77f9a8
commit
5616ba05de
4 changed files with 40 additions and 6 deletions
|
@ -60,6 +60,7 @@ interface ToastInnerProps {
|
|||
| 'warning'
|
||||
| 'notification';
|
||||
iconName?: keyof typeof Icons;
|
||||
closeOnAction?: boolean;
|
||||
}
|
||||
|
||||
const variantConfig = {
|
||||
|
@ -97,6 +98,7 @@ export const ToastInner: React.FC<ToastInnerProps> = ({
|
|||
toastId,
|
||||
variant = 'default',
|
||||
iconName,
|
||||
closeOnAction = true,
|
||||
}) => {
|
||||
const bgColor = variantConfig[variant].bgColor;
|
||||
|
||||
|
@ -134,7 +136,12 @@ export const ToastInner: React.FC<ToastInnerProps> = ({
|
|||
<Button
|
||||
variant={'secondary'}
|
||||
className='w-100px w-full mr-2'
|
||||
onClick={onAction}
|
||||
onClick={() => {
|
||||
onAction();
|
||||
if (closeOnAction) {
|
||||
toast.dismiss(toastId);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{buttonText}
|
||||
</Button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue