added notes to the frontend

This commit is contained in:
QkoSad
2022-12-11 11:28:40 +02:00
parent 475f924381
commit 88f04e2734
11 changed files with 538 additions and 16 deletions
+23
View File
@@ -0,0 +1,23 @@
import { useSelector } from "react-redux";
function NoteItem({ note }) {
const { user } = useSelector((state) => state.auth);
return (
<div
className="note"
style={{
backgroundColor: note.isStaff ? "rgba(0,0,0,0.7)" : "#fff",
color: note.isStaff ? "#fff" : "#000",
}}
>
<h4>Note from {note.isStaff ? <span>Staff</span>:<span>{user.name}</span>}</h4>
<p>{note.text}</p>
<div className="note=date">
{new Date(note.createdAt).toLocaleString('en-US')}
</div>
</div>
);
}
export default NoteItem