diff --git a/web/invite-links/view-invite-link-modal.react.js b/web/invite-links/view-invite-link-modal.react.js index 58990ad67..c5c1e9477 100644 --- a/web/invite-links/view-invite-link-modal.react.js +++ b/web/invite-links/view-invite-link-modal.react.js @@ -1,52 +1,57 @@ // @flow import * as React from 'react'; import { useModalContext } from 'lib/components/modal-provider.react.js'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { inviteLinkUrl } from 'lib/facts/links.js'; import { threadInfoSelector } from 'lib/selectors/thread-selectors.js'; import type { InviteLink } from 'lib/types/link-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; import css from './view-invite-link-modal.css'; import Button from '../components/button.react.js'; import Modal from '../modals/modal.react.js'; import { useSelector } from '../redux/redux-utils.js'; type Props = { +inviteLink: InviteLink, }; function ViewInviteLinkModal(props: Props): React.Node { const { inviteLink } = props; const threadInfo = useSelector( state => threadInfoSelector(state)[inviteLink.communityID], ); const resolvedThreadInfo = useResolvedThreadInfo(threadInfo); const { popModal } = useModalContext(); + const url = inviteLinkUrl(inviteLink.name); + const copyLink = React.useCallback(() => { + navigator.clipboard.writeText(url); + }, [url]); + return (
Use this public link to invite your friends into the community!
Public link
-
{inviteLinkUrl(inviteLink.name)}
-
); } export default ViewInviteLinkModal;