From 2d0b605257682a97b6dfe2f45537cd5aa935a75d Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Sun, 14 Jun 2020 12:25:45 +0200 Subject: [PATCH] Add links from recent note history entries to the actual note (#203) * Added Link objects around history-cards and the title in table-view This commit adds one Link element wrapping the title of a note in the table view and one Link element wrapping the whole card of a note in cards view. This behaviour currently doesn't work completely correct as other buttons on the card become unclickable and needs to be fixed in another commit before merging this branch. * Fixed Link behaviour for card view The cards aren't wrapped inside a Link element anymore but the middle column of a card (where the title and tags are located) is now wrapped inside the Link element. With this approach not the whole card is clickable anymore, but it's enough clickable space anyway. The positive aspect is that we don't have to deal with "position: absolute"-elements that may break responsiveness. --- .../history/history-card/history-card.tsx | 27 ++++++++++--------- .../history-table/history-table-row.tsx | 7 ++++- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/components/landing/pages/history/history-card/history-card.tsx b/src/components/landing/pages/history/history-card/history-card.tsx index 6cfad7555..3f5632ecd 100644 --- a/src/components/landing/pages/history/history-card/history-card.tsx +++ b/src/components/landing/pages/history/history-card/history-card.tsx @@ -1,6 +1,7 @@ import moment from 'moment' import React from 'react' import { Badge, Card } from 'react-bootstrap' +import { Link } from 'react-router-dom' import { formatHistoryDate } from '../../../../../utils/historyUtils' import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon' import { EntryMenu } from '../common/entry-menu' @@ -16,20 +17,22 @@ export const HistoryCard: React.FC = ({ entry, onPinClick, on
onPinClick(entry.id, entry.location)}/>
-
- {entry.title} -
-
- {moment(entry.lastVisited).fromNow()}
- {formatHistoryDate(entry.lastVisited)} -
-
- { - entry.tags.map((tag) => {tag}) - } + +
+ {entry.title} +
+
+ {moment(entry.lastVisited).fromNow()}
+ {formatHistoryDate(entry.lastVisited)} +
+
+ { + entry.tags.map((tag) => {tag}) + } +
-
+
= ({ entry, onPinClick, onRemoveClick }) => { return ( - {entry.title} + + + {entry.title} + + {formatHistoryDate(entry.lastVisited)} {