esp8266-react-framework/interface/src/containers/ManageUsers.js

34 lines
934 B
JavaScript
Raw Normal View History

2019-05-21 22:34:48 +00:00
import React, { Component } from 'react';
2019-05-27 20:21:05 +00:00
import { SECURITY_SETTINGS_ENDPOINT } from '../constants/Endpoints';
import { restComponent } from '../components/RestComponent';
2019-05-21 22:34:48 +00:00
import ManageUsersForm from '../forms/ManageUsersForm';
import SectionContent from '../components/SectionContent';
2019-05-21 22:34:48 +00:00
class ManageUsers extends Component {
componentDidMount() {
this.props.loadData();
2019-05-21 22:34:48 +00:00
}
render() {
const { data, fetched, errorMessage } = this.props;
return (
<SectionContent title="Manage Users">
<ManageUsersForm
userData={data}
userDataFetched={fetched}
errorMessage={errorMessage}
onSubmit={this.props.saveData}
onReset={this.props.loadData}
setData={this.props.setData}
handleValueChange={this.props.handleValueChange}
/>
</SectionContent>
2019-05-21 22:34:48 +00:00
)
}
}
2019-05-27 20:21:05 +00:00
export default restComponent(SECURITY_SETTINGS_ENDPOINT, ManageUsers);