Skip to content

Commit 75d5d07

Browse files
committed
Refactor CustomAlert component for improved readability and styling consistency
1 parent d1592db commit 75d5d07

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

client/src/components/Notifications/CustomAlert.jsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
import React from 'react';
1+
import React from "react";
22

33
const CustomAlert = ({ message, type, onClose }) => {
44
const alertTypeStyles = {
5-
success: 'bg-green-500',
6-
error: 'bg-red-500',
7-
info: 'bg-blue-500',
8-
warning: 'bg-yellow-500',
5+
success: "bg-green-500",
6+
error: "bg-red-500",
7+
info: "bg-blue-500",
8+
warning: "bg-yellow-500",
99
};
1010

1111
return (
12-
<div className={`fixed top-[90px] right-4 p-4 rounded shadow-lg text-white ${alertTypeStyles[type]}`}
13-
role="alert">
12+
<div
13+
className={`fixed top-[90px] z-200 right-4 p-4 rounded shadow-lg text-white ${alertTypeStyles[type]}`}
14+
role="alert"
15+
>
1416
<span>{message}</span>
15-
<button onClick={onClose} className="ml-4 text-xl font-bold">&times;</button>
17+
<button onClick={onClose} className="ml-4 text-xl font-bold">
18+
&times;
19+
</button>
1620
</div>
1721
);
1822
};

0 commit comments

Comments
 (0)