From d79f40e522dbff1106ebdaa720bfa6a46ec67134 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 7 Mar 2025 13:09:54 -0500 Subject: [PATCH] Link timestamp --- app/components/DocumentPostItem.tsx | 36 +++++++++++------------- app/components/PaginatedDocumentList.tsx | 2 +- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/app/components/DocumentPostItem.tsx b/app/components/DocumentPostItem.tsx index 9155a442fc..f4d83ee6ad 100644 --- a/app/components/DocumentPostItem.tsx +++ b/app/components/DocumentPostItem.tsx @@ -9,7 +9,6 @@ import { Link } from "react-router-dom"; import styled from "styled-components"; import breakpoint from "styled-components-breakpoint"; import EventBoundary from "@shared/components/EventBoundary"; -import Icon from "@shared/components/Icon"; import { richExtensions, withComments } from "@shared/editor/nodes"; import { s, hover } from "@shared/styles"; import Document from "~/models/Document"; @@ -80,6 +79,17 @@ function DocumentPostItem( currentContext: locationSidebarContext, }); + const to = React.useMemo( + () => ({ + pathname: documentPath(document), + state: { + title: document.titleWithDefault, + sidebarContext, + }, + }), + [document, sidebarContext] + ); + return ( - - {document.icon && ( - <> - -   - - )} + <Text type="secondary" size="small"> {t("By {{ author }}", { author: document.createdBy?.name })}{" "} - <Time dateTime={document.updatedAt} addSuffix /> + <Link to={to}> + <Text type="secondary" size="small"> + <Time dateTime={document.updatedAt} addSuffix /> + </Text> + </Link> </Text> </Flex> </Flex> diff --git a/app/components/PaginatedDocumentList.tsx b/app/components/PaginatedDocumentList.tsx index 5dcb4bd880..02f6d0da58 100644 --- a/app/components/PaginatedDocumentList.tsx +++ b/app/components/PaginatedDocumentList.tsx @@ -27,7 +27,7 @@ const PaginatedDocumentList = React.memo<Props>(function PaginatedDocumentList({ documents, fetch, options, - display, + display = CollectionDisplay.List, showParentDocuments, showCollection, showPublished,