Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: hide document/folder updated at when hidden in dataroom

Marc Seitz05ce16d90ec6
diff --git a/components/view/dataroom/document-card.tsx b/components/view/dataroom/document-card.tsx
index e981ba06..66eece35 100644
--- a/components/view/dataroom/document-card.tsx
+++ b/components/view/dataroom/document-card.tsx
@@ -43,6 +43,7 @@ type DocumentsCardProps = {
allowDownload: boolean;
isProcessing?: boolean;
dataroomIndexEnabled?: boolean;
+ showLastUpdated?: boolean;
};
export default function DocumentCard({
@@ -53,6 +54,7 @@ export default function DocumentCard({
allowDownload,
isProcessing = false,
dataroomIndexEnabled,
+ showLastUpdated = true,
}: DocumentsCardProps) {
const { theme, systemTheme } = useTheme();
const canDownload = document.canDownload && allowDownload;
@@ -219,11 +221,13 @@ export default function DocumentCard({
</button>
</h2>
</div>
- <div className="mt-1 flex items-center space-x-1 text-xs leading-5 text-muted-foreground">
- <p className="truncate">
- Updated {timeAgo(document.versions[0].updatedAt)}
- </p>
- </div>
+ {showLastUpdated && (
+ <div className="mt-1 flex items-center space-x-1 text-xs leading-5 text-muted-foreground">
+ <p className="truncate">
+ Updated {timeAgo(document.versions[0].updatedAt)}
+ </p>
+ </div>
+ )}
</div>
</div>
{canDownload && !isProcessing && (
diff --git a/components/view/dataroom/folder-card.tsx b/components/view/dataroom/folder-card.tsx
index f7ab2520..2e8f1029 100644
--- a/components/view/dataroom/folder-card.tsx
+++ b/components/view/dataroom/folder-card.tsx
@@ -28,6 +28,7 @@ type FolderCardProps = {
viewId?: string;
allowDownload: boolean;
dataroomIndexEnabled?: boolean;
+ showLastUpdated?: boolean;
};
export default function FolderCard({
folder,
@@ -38,6 +39,7 @@ export default function FolderCard({
viewId,
allowDownload,
dataroomIndexEnabled,
+ showLastUpdated = true,
}: FolderCardProps) {
const [open, setOpen] = useState(false);
@@ -121,9 +123,11 @@ export default function FolderCard({
</span>
</h2>
</div>
- <div className="mt-1 flex items-center space-x-1 text-xs leading-5 text-muted-foreground">
- <p className="truncate">Updated {timeAgo(folder.updatedAt)}</p>
- </div>
+ {showLastUpdated && (
+ <div className="mt-1 flex items-center space-x-1 text-xs leading-5 text-muted-foreground">
+ <p className="truncate">Updated {timeAgo(folder.updatedAt)}</p>
+ </div>
+ )}
</div>
</div>
{allowDownload ? (
diff --git a/components/view/viewer/dataroom-viewer.tsx b/components/view/viewer/dataroom-viewer.tsx
index 89273df7..020459a9 100644
--- a/components/view/viewer/dataroom-viewer.tsx
+++ b/components/view/viewer/dataroom-viewer.tsx
@@ -354,6 +354,7 @@ export default function DataroomViewer({
allowDownload={allowDownload && item.canDownload}
isProcessing={isProcessing}
dataroomIndexEnabled={dataroomIndexEnabled}
+ showLastUpdated={dataroom?.showLastUpdated ?? true}
/>
);
}
@@ -369,6 +370,7 @@ export default function DataroomViewer({
viewId={viewId}
allowDownload={item.allowDownload}
dataroomIndexEnabled={dataroomIndexEnabled}
+ showLastUpdated={dataroom?.showLastUpdated ?? true}
/>
);
};