Skip to content

Commit

Permalink
#6 Shorten code for note-filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
tina-e committed Aug 18, 2022
1 parent dd4c9a3 commit 9e8cee8
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/components/sidebar/SidebarNotes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,15 @@ export const SidebarNotes = () => {
)}
<div className="text-mediumGrey font-bold text-sm">
OHNE BEZUG AUF BEITRAG
{notes
.filter((note) => {
return !note.referenceTo;
})
.map((note) => (
<Note key={note.id} {...note}></Note>
))}
{notes.map(
(note) => !note.referenceTo && <Note key={note.id} {...note}></Note>
)}
</div>
<div className="text-mediumGrey font-bold text-sm">
MIT BEZUG AUF BEITRAG
{notes
.filter((note) => {
return note.referenceTo;
})
.map((note) => (
<Note key={note.id} {...note}></Note>
))}
{notes.map(
(note) => note.referenceTo && <Note key={note.id} {...note}></Note>
)}
</div>
</div>
);
Expand Down

0 comments on commit 9e8cee8

Please sign in to comment.