Add tags to history table

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
Tilman Vatteroth 2020-05-24 13:26:52 +02:00 committed by mrdrogdrog
parent 47ab753959
commit 70ab02431c
3 changed files with 9 additions and 0 deletions

View file

@ -16,6 +16,7 @@
"signOut": "Sign Out",
"exploreFeatures": "Explore all features",
"selectTags": "Select tags…",
"tags": "Tags",
"searchKeywords": "Search keyword…",
"sortByTitle": "Sort by title",
"title": "Title",

View file

@ -4,6 +4,7 @@ import {CloseButton} from "../common/close-button";
import {useTranslation} from "react-i18next";
import {HistoryEntryProps} from "../history-content/history-content";
import {formatHistoryDate} from "../../../../../utils/historyUtils";
import {Badge} from "react-bootstrap";
export const HistoryTableRow: React.FC<HistoryEntryProps> = ({entry, onPinClick}) => {
useTranslation()
@ -11,6 +12,12 @@ export const HistoryTableRow: React.FC<HistoryEntryProps> = ({entry, onPinClick}
<tr>
<td>{entry.title}</td>
<td>{formatHistoryDate(entry.lastVisited)}</td>
<td>
{
entry.tags.map((tag) => <Badge variant={"dark"} className={"mr-1 mb-1"}
key={tag}>{tag}</Badge>)
}
</td>
<td>
<PinButton isDark={true} isPinned={entry.pinned} onPinClick={() => {
onPinClick(entry.id)

View file

@ -11,6 +11,7 @@ const HistoryTable: React.FC<HistoryEntriesProps> = ({entries, onPinClick}) => {
<tr>
<th><Trans i18nKey={"title"}/></th>
<th><Trans i18nKey={"lastVisit"}/></th>
<th><Trans i18nKey={"tags"}/></th>
<th><Trans i18nKey={"actions"}/></th>
</tr>
</thead>