스낵바 기능 추가, 현금영수증 날짜 변경 추가

This commit is contained in:
focp212@naver.com
2025-10-23 16:33:27 +09:00
parent 439ea941b0
commit 372ecfa3f0
3 changed files with 24 additions and 7 deletions

View File

@@ -1,11 +1,21 @@
import { toast } from "react-toastify";
export const snackBar = (text: string) => {
export const snackBar = (text: string, callback?: () => void) => {
toast.dismiss({ containerId: 'snackbar' });
toast(text, { containerId: 'snackbar' });
if(!!callback && typeof(callback) === 'function'){
setTimeout(() => {
callback();
}, 3000);
}
};
export const notiBar = (text: string) => {
export const notiBar = (text: string, callback?: () => void) => {
toast.dismiss({ containerId: 'notibar' });
toast(text, { containerId: 'notibar' });
if(!!callback && typeof(callback) === 'function'){
setTimeout(() => {
callback();
}, 3000);
}
};