Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Turn note summaries in the activity log into links to the full note

fzaninotto62cea148f050
diff --git a/src/components/atomic-crm/activity/ActivityLogContactNoteCreated.tsx b/src/components/atomic-crm/activity/ActivityLogContactNoteCreated.tsx
index 284454cd..27167ec8 100644
--- a/src/components/atomic-crm/activity/ActivityLogContactNoteCreated.tsx
+++ b/src/components/atomic-crm/activity/ActivityLogContactNoteCreated.tsx
@@ -68,6 +68,7 @@ export function ActivityLogContactNoteCreated({
</div>
}
text={contactNote.text}
+ link={`/contacts/${contactNote.contact_id}/show`}
/>
);
}
diff --git a/src/components/atomic-crm/activity/ActivityLogDealNoteCreated.tsx b/src/components/atomic-crm/activity/ActivityLogDealNoteCreated.tsx
index d2cd2b61..6513700f 100644
--- a/src/components/atomic-crm/activity/ActivityLogDealNoteCreated.tsx
+++ b/src/components/atomic-crm/activity/ActivityLogDealNoteCreated.tsx
@@ -81,6 +81,7 @@ export function ActivityLogDealNoteCreated({
</div>
}
text={dealNote.text}
+ link={`/deals/${dealNote.deal_id}/show`}
/>
);
}
diff --git a/src/components/atomic-crm/activity/ActivityLogNote.tsx b/src/components/atomic-crm/activity/ActivityLogNote.tsx
index 24f96e26..03ff4ee1 100644
--- a/src/components/atomic-crm/activity/ActivityLogNote.tsx
+++ b/src/components/atomic-crm/activity/ActivityLogNote.tsx
@@ -1,16 +1,15 @@
import { type ReactNode } from "react";
+import { Link } from "react-router";
import { Markdown } from "../misc/Markdown";
-type ActivityLogContactNoteCreatedProps = {
+type ActivityLogNoteProps = {
header: ReactNode;
text: string;
+ link: string;
};
-export function ActivityLogNote({
- header,
- text,
-}: ActivityLogContactNoteCreatedProps) {
+export function ActivityLogNote({ header, text, link }: ActivityLogNoteProps) {
if (!text) {
return null;
}
@@ -21,11 +20,11 @@ export function ActivityLogNote({
<div className="flex flex-row space-x-1 items-center w-full">
{header}
</div>
- <div>
+ <Link to={link} className="hover:bg-muted rounded transition-colors">
<Markdown className="text-sm line-clamp-3 overflow-hidden [&_p]:my-1 [&_p:first-child]:mt-0 [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_blockquote]:my-1 [&_blockquote]:text-muted-foreground [&_a]:text-primary [&_a]:underline [&_a:hover]:no-underline">
{text}
</Markdown>
- </div>
+ </Link>
</div>
</div>
);