mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-28 00:04:31 +02:00
Guillermo/Ivan - Frontend - Add edit-email form [skip ci]
This commit is contained in:
parent
aa30cd1718
commit
e85f38fbde
@ -1,14 +1,47 @@
|
|||||||
import React from 'react';
|
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 {
|
class DashboardEditProfilePage extends React.Component {
|
||||||
|
|
||||||
|
state = {
|
||||||
|
loading: false
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="edit-profile-page">
|
||||||
DASHBOARD EDIT PROFILE
|
<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>
|
</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;
|
export default DashboardEditProfilePage;
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
@import '../../../../scss/vars';
|
||||||
|
|
||||||
|
.edit-profile-page {
|
||||||
|
&__title {
|
||||||
|
color: $dark-grey;
|
||||||
|
font-size: 20px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
@ -104,6 +104,16 @@ module.exports = [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/user/edit-email',
|
||||||
|
time: 1000,
|
||||||
|
response: function () {
|
||||||
|
return {
|
||||||
|
status: 'success',
|
||||||
|
data: {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/user/get',
|
path: '/user/get',
|
||||||
time: 100,
|
time: 100,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user