diff options
author | 2018-01-19 17:14:44 +0100 | |
---|---|---|
committer | 2018-01-19 17:14:44 +0100 | |
commit | 3692bd81a71d4caf094dc01b175df95519e796e8 (patch) | |
tree | d7df20d543ac17f2f2b32f8b75d7cdee957d1b36 /src/components/auth/Invite.js | |
parent | fix invite screen [object Object] value (diff) | |
download | ferdium-app-3692bd81a71d4caf094dc01b175df95519e796e8.tar.gz ferdium-app-3692bd81a71d4caf094dc01b175df95519e796e8.tar.zst ferdium-app-3692bd81a71d4caf094dc01b175df95519e796e8.zip |
implemented check for at least one email address
realized by leveraging `disabled` attribute of submit button
Diffstat (limited to 'src/components/auth/Invite.js')
-rw-r--r-- | src/components/auth/Invite.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/components/auth/Invite.js b/src/components/auth/Invite.js index dface4fe1..3eb1f2765 100644 --- a/src/components/auth/Invite.js +++ b/src/components/auth/Invite.js | |||
@@ -74,6 +74,10 @@ export default class Invite extends Component { | |||
74 | const { form } = this; | 74 | const { form } = this; |
75 | const { intl } = this.context; | 75 | const { intl } = this.context; |
76 | 76 | ||
77 | const atLeastOneEmailAddress = form.$('invite') | ||
78 | .map(invite => {return invite.$('email').value}) | ||
79 | .some(email => email.trim() !== '') | ||
80 | |||
77 | return ( | 81 | return ( |
78 | <div className="auth__container auth__container--signup"> | 82 | <div className="auth__container auth__container--signup"> |
79 | <form className="franz-form auth__form" onSubmit={e => this.submit(e)}> | 83 | <form className="franz-form auth__form" onSubmit={e => this.submit(e)}> |
@@ -96,6 +100,7 @@ export default class Invite extends Component { | |||
96 | <Button | 100 | <Button |
97 | type="submit" | 101 | type="submit" |
98 | className="auth__button" | 102 | className="auth__button" |
103 | disabled={!atLeastOneEmailAddress} | ||
99 | label={intl.formatMessage(messages.submitButtonLabel)} | 104 | label={intl.formatMessage(messages.submitButtonLabel)} |
100 | /> | 105 | /> |
101 | <Link | 106 | <Link |