From 8278878673126e7c2fe98df76783a4ac4a6c78ac Mon Sep 17 00:00:00 2001 From: QAComet Date: Thu, 18 Apr 2024 11:34:29 -0600 Subject: [PATCH] feat: add close button and data-testids to toast messages --- pages/_app.tsx | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index b965941..3cdd0f5 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -5,7 +5,8 @@ import { SessionProvider } from "next-auth/react"; import type { AppProps } from "next/app"; import Head from "next/head"; import AuthRedirect from "@/layouts/AuthRedirect"; -import { Toaster } from "react-hot-toast"; +import toast from "react-hot-toast"; +import { Toaster, ToastBar } from "react-hot-toast"; import { Session } from "next-auth"; import { isPWA } from "@/lib/client/utils"; @@ -61,7 +62,30 @@ export default function App({ className: "border border-sky-100 dark:border-neutral-700 dark:bg-neutral-800 dark:text-white", }} - /> + > + {(t) => ( + + {({ icon, message }) => ( +
+ {icon} + {message} + {t.type !== "loading" && ( + + )} +
+ )} +
+ )} +