aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/auth
diff options
context:
space:
mode:
authorLibravatar haraldox <hnaumann+github@gmail.com>2018-02-08 12:26:57 +0100
committerLibravatar haraldox <hnaumann+github@gmail.com>2018-02-08 12:26:57 +0100
commitab33c44bbb4ffad2cdfcad76d3cd26f1444e27cd (patch)
tree4b11cce45e15fb25a3148454e905872105d937da /src/components/auth
parentREMOVE presentational stuff from smart container (diff)
downloadferdium-app-ab33c44bbb4ffad2cdfcad76d3cd26f1444e27cd.tar.gz
ferdium-app-ab33c44bbb4ffad2cdfcad76d3cd26f1444e27cd.tar.zst
ferdium-app-ab33c44bbb4ffad2cdfcad76d3cd26f1444e27cd.zip
feat(App) Feature Invite Friends in Settings
- MOVE form creation to `componentWillMount()` - focus input field on `componentDidMount()`
Diffstat (limited to 'src/components/auth')
-rw-r--r--src/components/auth/Invite.js56
1 files changed, 31 insertions, 25 deletions
diff --git a/src/components/auth/Invite.js b/src/components/auth/Invite.js
index dfe6a00b7..f1c16986b 100644
--- a/src/components/auth/Invite.js
+++ b/src/components/auth/Invite.js
@@ -64,32 +64,38 @@ export default class Invite extends Component {
64 64
65 state = { showSuccessInfo: false }; 65 state = { showSuccessInfo: false };
66 66
67 handlers = { 67 componentWillMount() {
68 onChange: () => { 68 const handlers = {
69 this.setState({ showSuccessInfo: false }); 69 onChange: () => {
70 }, 70 this.setState({ showSuccessInfo: false });
71 }; 71 },
72 72 };
73 form = new Form({ 73
74 fields: { 74 this.form = new Form({
75 invite: [...Array(3).fill({ 75 fields: {
76 fields: { 76 invite: [...Array(3).fill({
77 name: { 77 fields: {
78 label: this.context.intl.formatMessage(messages.nameLabel), 78 name: {
79 placeholder: this.context.intl.formatMessage(messages.nameLabel), 79 label: this.context.intl.formatMessage(messages.nameLabel),
80 handlers: this.handlers, 80 placeholder: this.context.intl.formatMessage(messages.nameLabel),
81 // related: ['invite.0.email'], // path accepted but does not work 81 handlers,
82 }, 82 // related: ['invite.0.email'], // path accepted but does not work
83 email: { 83 },
84 label: this.context.intl.formatMessage(messages.emailLabel), 84 email: {
85 placeholder: this.context.intl.formatMessage(messages.emailLabel), 85 label: this.context.intl.formatMessage(messages.emailLabel),
86 handlers: this.handlers, 86 placeholder: this.context.intl.formatMessage(messages.emailLabel),
87 validators: [email], 87 handlers,
88 validators: [email],
89 },
88 }, 90 },
89 }, 91 })],
90 })], 92 },
91 }, 93 }, this.context.intl);
92 }, this.context.intl); 94 }
95
96 componentDidMount() {
97 document.querySelector('input:first-child').focus();
98 }
93 99
94 submit(e) { 100 submit(e) {
95 e.preventDefault(); 101 e.preventDefault();