Our team has some technical questions about the usage of Copy Post Links.
First off, we note there are TWO separate locations with DIFFERENT logic to display the copy link icon:
- In
src/v4/social/internal-components/PostMenu/PostMenu.tsx, the CopyLink button is shown if the user is not part of the community:-
119 const showCopyLinkButton = useMemo(() => { 120 if (post.targetType === 'user') return false; 121 if (community?.isPublic && !community?.isJoined) return true; 122 if (community?.isPublic && community?.isJoined) return false; 123 }, [post.targetType, community?.isJoined, community?.isPublic]);
-
- In
src/v4/social/components/PostContent/PostContent.tsx, we show the CopyLink button only if there is no community, OR if the community is public:-
(!targetCommunity || targetCommunity?.isPublic)
-
The two separate locations is confusing, but the fact the logic is different is more so. Why the separate cases?
I’d like to note that the button doesn’t appear to show up in the 2nd case above for a community that is public, even with post links enabled for a particular application and it’s child communities.
Can the decisions behind these two paths of logic be explained? And is there something I’m missing for our particular case where the button won’t show up in the PostMenu?