From ad02d64defaced10039c19cefe6689e019494f29 Mon Sep 17 00:00:00 2001 From: MIGHTY1o1 Date: Thu, 17 Oct 2024 20:23:02 +0530 Subject: [PATCH] fix button on hover --- client/src/pages/Journal/JournalPage.tsx | 97 ++++++++++-------------- 1 file changed, 39 insertions(+), 58 deletions(-) diff --git a/client/src/pages/Journal/JournalPage.tsx b/client/src/pages/Journal/JournalPage.tsx index 091c8dcb..e6a7ad7a 100644 --- a/client/src/pages/Journal/JournalPage.tsx +++ b/client/src/pages/Journal/JournalPage.tsx @@ -338,67 +338,48 @@ const JournalPage: React.FC = () => { {Object.entries(sortedEntries).map(([monthYear, entries]) => ( -
-

- {monthYear} -

-
- {entries.map((entry) => ( -
- setHoveredEntry(entry._id) - } - onMouseLeave={() => setHoveredEntry(null)} - > - {`${entry.movie.title} - handleClick(entry.movie.movie_id) - } - /> +
+

+ {monthYear} +

+
+ {entries.map((entry) => ( +
setHoveredEntry(entry._id)} + onMouseLeave={() => setHoveredEntry(null)} + > + {`${entry.movie.title} handleClick(entry.movie.movie_id)} + /> - {hoveredEntry === entry._id && ( - -

- {entry.movie.title} -

-

- Watched:{" "} - {format( - new Date(entry.dateWatched), - "PPP" - )} -

-

- Times Watched: {entry.rewatches} -

- -
- )} -
- ))} + +

{entry.movie.title}

+

Watched: {format(new Date(entry.dateWatched), "PPP")}

+

Times Watched: {entry.rewatches}

+ + {/* Delete button visible on hover for desktop, always visible on mobile */} + +
+ ))}
- ))} +
+ ))}