Skip to content

Commit 22cefee

Browse files
committed
fix: disable inputs
1 parent 93d1973 commit 22cefee

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

static/app/components/modals/inviteMembersModal/inviteMembersModalview.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ export default function InviteMembersModalView({
6464
willInvite,
6565
error,
6666
}: Props) {
67-
const disableInputs = sendingInvites || complete;
68-
6967
const inviteEmails = invites.map(inv => inv.email);
7068
const hasDuplicateEmails = inviteEmails.length !== new Set(inviteEmails).size;
7169
const isValidInvites = invites.length > 0 && !hasDuplicateEmails;
@@ -76,18 +74,27 @@ export default function InviteMembersModalView({
7674
</Alert>
7775
) : null;
7876

77+
const userEmails = member?.user?.emails;
78+
const isVerified = userEmails ? userEmails.some(element => element.is_verified) : false;
79+
80+
const disableInputs = sendingInvites || complete || !isVerified;
81+
7982
return (
8083
<Fragment>
8184
{errorAlert}
8285
<Heading>{t('Invite New Members')}</Heading>
83-
{willInvite ? (
84-
<Subtext>{t('Invite new members by email to join your organization.')}</Subtext>
85-
) : (
86+
{!isVerified ? (
87+
<Alert type="warning" showIcon>
88+
{t('Please verify your email before inviting other users.')}
89+
</Alert>
90+
) : !willInvite && isVerified ? (
8691
<Alert type="warning" showIcon>
8792
{t(
8893
'You can’t invite users directly, but we’ll forward your request to an org owner or manager for approval.'
8994
)}
9095
</Alert>
96+
) : (
97+
<Subtext>{t('Invite new members by email to join your organization.')}</Subtext>
9198
)}
9299

93100
{headerInfo}

0 commit comments

Comments
 (0)