From 731453588b93e02a113332d68f81e48bc11f7da7 Mon Sep 17 00:00:00 2001
From: Blaster4385 <blaster4385@tablaster.dev>
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 (
+    <div
+      className={`${styles.background} ${openAlertToast ? styles.active : ""}`}
+    >
+      <div className={styles.container}>
+        <p className={styles.container__title}>Please enter some text!</p>
+      </div>
+    </div>
+  );
+};
+
+export default AlertToast;
-- 
cgit v1.2.3-73-gaa49b

