From cb928c3360303255a1b86f937a415f5ea42a8943 Mon Sep 17 00:00:00 2001 From: Andre H Date: Thu, 22 Feb 2024 14:16:21 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20use=20buttonbaseprops,?= =?UTF-8?q?=20duration=202000=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/components/shared/Toast/useToast.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/shared/Toast/useToast.tsx b/packages/frontend/src/components/shared/Toast/useToast.tsx index ad088be4..bd0be17e 100644 --- a/packages/frontend/src/components/shared/Toast/useToast.tsx +++ b/packages/frontend/src/components/shared/Toast/useToast.tsx @@ -1,13 +1,15 @@ // Inspired by react-hot-toast library import React from 'react'; import { type ToastProps } from '@radix-ui/react-toast'; +import { SimpleToastProps } from './SimpleToast'; const TOAST_LIMIT = 3; const TOAST_REMOVE_DELAY_DEFAULT = 7000; -type ToasterToast = ToastProps & { - id: string; -}; +type ToasterToast = ToastProps & + SimpleToastProps & { + id: string; + }; const actionTypes = { ADD_TOAST: 'ADD_TOAST', @@ -136,7 +138,7 @@ const dispatch = (action: Action) => { const toast = (props: ToasterToast) => { if (!props.duration) { - props.duration = 20000; + props.duration = 2000; } const id = genId();