Guillermo/Ivan - Frontend - Add edit-email form [skip ci]

This commit is contained in:
ivan 2016-09-14 20:03:15 -03:00
parent aa30cd1718
commit e85f38fbde
3 changed files with 54 additions and 2 deletions

View File

@ -1,14 +1,47 @@
import React from 'react';
import API from 'lib-app/api-call';
import Header from 'core-components/header';
import Form from 'core-components/form';
import FormField from 'core-components/form-field';
import SubmitButton from 'core-components/submit-button';
class DashboardEditProfilePage extends React.Component {
state = {
loading: false
};
render() {
return (
<div>
DASHBOARD EDIT PROFILE
<div className="edit-profile-page">
<Header title="Edit Profile" description="adsfasdfasdfasdfasdf asdfa" />
<div className="edit-profile-page__title">Edit Email</div>
<Form loading={this.state.loading} onSubmit={this.onSubmit.bind(this)}>
<FormField name="newEmail" label="New Email" field="input" validation="EMAIL" required/>
<SubmitButton>CHANGE EMAIL</SubmitButton>
</Form>
</div>
);
}
onSubmit(formState) {
this.setState({
loading: true
});
API.call({
path: "/user/edit-email",
data: {
newEmail: formState.newEmail
}
}).then(function () {
this.setState({
loading: false
});
}.bind(this));
}
}
export default DashboardEditProfilePage;

View File

@ -0,0 +1,9 @@
@import '../../../../scss/vars';
.edit-profile-page {
&__title {
color: $dark-grey;
font-size: 20px;
text-align: left;
}
}

View File

@ -104,6 +104,16 @@ module.exports = [
}
}
},
{
path: '/user/edit-email',
time: 1000,
response: function () {
return {
status: 'success',
data: {}
};
}
},
{
path: '/user/get',
time: 100,