You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
758 B
TypeScript
25 lines
758 B
TypeScript
8 months ago
|
import { Item } from 'react-contexify';
|
||
|
import { showCopyCommunityUrlMenuItem } from '.';
|
||
|
import { useIsPublic } from '../../../../hooks/useParamSelector';
|
||
|
import { copyPublicKeyByConvoId } from '../../../../interactions/conversationInteractions';
|
||
|
import { Localizer } from '../../../basic/Localizer';
|
||
|
|
||
|
export const CopyCommunityUrlMenuItem = ({ convoId }: { convoId: string }): JSX.Element | null => {
|
||
|
const isPublic = useIsPublic(convoId);
|
||
|
|
||
|
// we want to show the copyId for communities only
|
||
|
|
||
|
if (showCopyCommunityUrlMenuItem({ isPublic })) {
|
||
|
return (
|
||
|
<Item
|
||
|
onClick={() => {
|
||
|
void copyPublicKeyByConvoId(convoId);
|
||
|
}}
|
||
|
>
|
||
|
<Localizer token="communityUrlCopy" />
|
||
|
</Item>
|
||
|
);
|
||
|
}
|
||
|
return null;
|
||
|
};
|