Skip to content

Commit a903913

Browse files
Benjamín Thomas Kramm Pinojfcampos1
authored andcommitted
refactor: sign up screen (#8)
* feat: add SignUpForm component * feat: add working sign up screen * fix: remove alias webpack * feat: add sign in screen * fix: fix payload at submit * refactor: removed submit method * fix: removed submit method
1 parent 0f0c970 commit a903913

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

  • src/components/authentication/SignUpForm

src/components/authentication/SignUpForm/index.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class SignUpForm extends React.Component {
3434
this.onChangePasswordRepeat = this.onChangePasswordRepeat.bind(this)
3535

3636
this.getValidity = this.getValidity.bind(this)
37-
this.onSubmit = this.onSubmit.bind(this)
3837
}
3938

4039
onChangeName({ target: { value: name } }) {
@@ -100,18 +99,8 @@ class SignUpForm extends React.Component {
10099
return validity && this.state.password === this.state.passwordRepeat
101100
}
102101

103-
onSubmit() {
104-
this.props.onSubmit({
105-
name: this.state.name,
106-
lastName: this.state.lastname,
107-
email: this.state.email,
108-
phone: this.state.phoneNumber,
109-
password: this.state.password,
110-
passwordRepeat: this.state.passwordRepeat,
111-
})
112-
}
113-
114102
render() {
103+
const { onSubmit } = this.props
115104
const {
116105
name,
117106
lastname,
@@ -165,7 +154,19 @@ class SignUpForm extends React.Component {
165154
/>
166155
</FormControl>
167156

168-
<Button disabled={!this.getValidity()} onClick={this.onSubmit}>
157+
<Button
158+
disabled={!this.getValidity()}
159+
onClick={() =>
160+
onSubmit({
161+
name,
162+
lastname,
163+
email,
164+
phoneNumber,
165+
password,
166+
passwordRepeat,
167+
})
168+
}
169+
>
169170
Siguiente
170171
</Button>
171172
</FormControl>

0 commit comments

Comments
 (0)