From 731453588b93e02a113332d68f81e48bc11f7da7 Mon Sep 17 00:00:00 2001 From: Blaster4385 Date: Wed, 15 May 2024 22:55:13 +0530 Subject: feat: added keyboard accessibility --- client/src/components/AlertToast/AlertToast.jsx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 client/src/components/AlertToast/AlertToast.jsx (limited to 'client/src/components/AlertToast/AlertToast.jsx') diff --git a/client/src/components/AlertToast/AlertToast.jsx b/client/src/components/AlertToast/AlertToast.jsx new file mode 100644 index 0000000..824b9e6 --- /dev/null +++ b/client/src/components/AlertToast/AlertToast.jsx @@ -0,0 +1,24 @@ +import React, { useEffect } from "react"; +import styles from "./AlertToast.module.css"; + +const AlertToast = ({ openAlertToast, setOpenAlertToast }) => { + useEffect(() => { + const timer = setTimeout(() => { + setOpenAlertToast(false); + }, 3000); + + return () => clearTimeout(timer); + }, [openAlertToast, setOpenAlertToast]); + + return ( +
+
+

Please enter some text!

+
+
+ ); +}; + +export default AlertToast; -- cgit v1.2.3-73-gaa49b