Skip to content

Commit 78a6956

Browse files
committed
Wrap the NoteCard component with a react-router-dom link
1 parent 5b9a912 commit 78a6956

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/components/NotesList/NotesList.jsx

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React, { useEffect } from "react";
22
import "./NotesList.css";
33
import { useSelector } from "react-redux";
4+
import { Link } from "react-router-dom";
45
import {
56
selectAllNotes,
67
selectNoteError,
78
selectNoteStatus,
89
} from "../../features/notes/notesSlice";
9-
import NoteItem from "./NoteItem";
10+
import NoteCard from "./NoteCard";
1011

1112
function NotesList() {
1213
// Get all notes from the redux store
@@ -54,12 +55,13 @@ function NotesList() {
5455
// showDate = `${day}/${month}/${year}`;
5556

5657
return (
57-
<NoteItem
58-
key={note._id}
59-
note={note}
60-
// showTitle={showTitle}
61-
// showDate={showDate}
62-
/>
58+
<Link to={`/note/${note._id}`} key={note._id}>
59+
<NoteCard
60+
note={note}
61+
// showTitle={showTitle}
62+
// showDate={showDate}
63+
/>
64+
</Link>
6365
);
6466
})}
6567
</div>

0 commit comments

Comments
 (0)