diff options
author | 2018-02-02 13:50:45 +0100 | |
---|---|---|
committer | 2018-02-02 13:50:45 +0100 | |
commit | d62fba7515c65c9c4f3154dc778be322291a500b (patch) | |
tree | 72d297a829f84ae2e0c23f1d67c5908b19da4c91 /src/components/auth | |
parent | Merge branch 'develop' into move-subscription-folders (diff) | |
parent | Merge pull request #630 from meetfranz/fix-invite-screen (diff) | |
download | ferdium-app-d62fba7515c65c9c4f3154dc778be322291a500b.tar.gz ferdium-app-d62fba7515c65c9c4f3154dc778be322291a500b.tar.zst ferdium-app-d62fba7515c65c9c4f3154dc778be322291a500b.zip |
Merge branch 'develop' into move-subscription-folders
Diffstat (limited to 'src/components/auth')
-rw-r--r-- | src/components/auth/Invite.js | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/components/auth/Invite.js b/src/components/auth/Invite.js index a420f98a2..c6dca3a65 100644 --- a/src/components/auth/Invite.js +++ b/src/components/auth/Invite.js | |||
@@ -45,16 +45,16 @@ export default class Invite extends Component { | |||
45 | form = new Form({ | 45 | form = new Form({ |
46 | fields: { | 46 | fields: { |
47 | invite: [...Array(3).fill({ | 47 | invite: [...Array(3).fill({ |
48 | name: { | 48 | fields: { |
49 | label: this.context.intl.formatMessage(messages.nameLabel), | 49 | name: { |
50 | // value: '', | 50 | label: this.context.intl.formatMessage(messages.nameLabel), |
51 | placeholder: this.context.intl.formatMessage(messages.nameLabel), | 51 | placeholder: this.context.intl.formatMessage(messages.nameLabel), |
52 | }, | 52 | }, |
53 | email: { | 53 | email: { |
54 | label: this.context.intl.formatMessage(messages.emailLabel), | 54 | label: this.context.intl.formatMessage(messages.emailLabel), |
55 | // value: '', | 55 | placeholder: this.context.intl.formatMessage(messages.emailLabel), |
56 | validators: [email], | 56 | validators: [email], |
57 | placeholder: this.context.intl.formatMessage(messages.emailLabel), | 57 | }, |
58 | }, | 58 | }, |
59 | })], | 59 | })], |
60 | }, | 60 | }, |
@@ -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 => invite.$('email').value) | ||
79 | .some(emailValue => emailValue.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 |