diff --git a/apps/dashboard/src/components/add-member-modal.tsx b/apps/dashboard/src/components/add-member-modal.tsx index 6fd5ed9a..e6f85d6b 100644 --- a/apps/dashboard/src/components/add-member-modal.tsx +++ b/apps/dashboard/src/components/add-member-modal.tsx @@ -45,6 +45,12 @@ export default function AddMemberModal({ setValue: setClientLink, onCopy } = useClipboard("") + const { + hasCopied: hasCopiedInviteCode, + value: inviteCode, + setValue: setInviteCode, + onCopy: onCopyInviteCode + } = useClipboard("") const { data: signer } = useSigner() useEffect(() => { @@ -154,7 +160,10 @@ ${memberIds.join("\n")} } setClientLink(inviteLink) - }, [group, setClientLink]) + const index = inviteLink.lastIndexOf("=") + const inviteCodeLink = inviteLink.substring(index + 1) + setInviteCode(inviteCodeLink) + }, [group, setClientLink, setInviteCode]) return ( + {!group.credentials && ( + <> + + Share invite code + + + + + + + + e.preventDefault() + } + icon={ + + } + /> + + + + + )} + {!group.credentials ? "Share invite link" diff --git a/apps/dashboard/src/pages/group.tsx b/apps/dashboard/src/pages/group.tsx index fa37b0c5..9845298c 100644 --- a/apps/dashboard/src/pages/group.tsx +++ b/apps/dashboard/src/pages/group.tsx @@ -464,7 +464,6 @@ ${memberIds.join("\n")} - (