From 1a96ca32f99c41876f110a5078373c966388f5c8 Mon Sep 17 00:00:00 2001 From: Matthew Jacobs Date: Wed, 24 Apr 2024 00:56:00 +0000 Subject: [PATCH 1/2] add link actions to readable view --- .../LinkViews/LinkComponents/LinkActions.tsx | 12 ++++++++--- components/ReadableView.tsx | 21 +++++++++++++++++-- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/components/LinkViews/LinkComponents/LinkActions.tsx b/components/LinkViews/LinkComponents/LinkActions.tsx index d809dfc..fcd4750 100644 --- a/components/LinkViews/LinkComponents/LinkActions.tsx +++ b/components/LinkViews/LinkComponents/LinkActions.tsx @@ -18,6 +18,7 @@ type Props = { position?: string; toggleShowInfo?: () => void; linkInfo?: boolean; + alignToTop?: boolean; flipDropdown?: boolean; }; @@ -26,6 +27,7 @@ export default function LinkActions({ toggleShowInfo, position, linkInfo, + alignToTop, flipDropdown, }: Props) { const permissions = usePermissions(link.collection.id as number); @@ -67,9 +69,9 @@ export default function LinkActions({ return ( <>
-
    +
    • { + return collections.find( + (e) => e.id === link.collection.id + ) as CollectionIncludingMembersAndLinkCount; + }, [collections, link]); useEffect(() => { const fetchLinkContent = async () => { @@ -131,7 +141,7 @@ export default function ReadableView({ link }: Props) {
      + +
      From 7442799836f89233c82364b8b7dfe9a7c9401f14 Mon Sep 17 00:00:00 2001 From: daniel31x13 Date: Tue, 14 May 2024 12:14:22 -0400 Subject: [PATCH 2/2] minor fix --- components/LinkViews/LinkCard.tsx | 2 +- components/ReadableView.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/LinkViews/LinkCard.tsx b/components/LinkViews/LinkCard.tsx index d93904a..8f11cea 100644 --- a/components/LinkViews/LinkCard.tsx +++ b/components/LinkViews/LinkCard.tsx @@ -208,7 +208,7 @@ export default function LinkCard({ link, flipDropdown, editMode }: Props) { )}

      - {link.tags[0] && ( + {link.tags && link.tags[0] && ( <>

      Tags

      diff --git a/components/ReadableView.tsx b/components/ReadableView.tsx index 977ca2a..539ec8e 100644 --- a/components/ReadableView.tsx +++ b/components/ReadableView.tsx @@ -43,7 +43,7 @@ export default function ReadableView({ link }: Props) { const router = useRouter(); - const { links, getLink } = useLinkStore(); + const { getLink } = useLinkStore(); const { collections } = useCollectionStore(); const collection = useMemo(() => { @@ -138,7 +138,7 @@ export default function ReadableView({ link }: Props) { }, [colorPalette]); return ( -
      +