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

38 lines
1.1 KiB
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-08-09 17:21:28 +00:00
import LoadingNotification from '../components/LoadingNotification';
import SectionContent from '../components/SectionContent';
2019-08-09 17:21:28 +00:00
import ManageUsersForm from '../forms/ManageUsersForm';
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() {
2019-08-09 17:21:28 +00:00
const { fetched, errorMessage, data, saveData, loadData, setData, handleValueChange } = this.props;
2019-05-21 22:34:48 +00:00
return (
2019-07-06 22:56:30 +00:00
<SectionContent title="Manage Users" titleGutter>
2019-08-09 17:21:28 +00:00
<LoadingNotification
onReset={loadData}
fetched={fetched}
errorMessage={errorMessage}>
<ManageUsersForm
userData={data}
onSubmit={saveData}
onReset={loadData}
setData={setData}
handleValueChange={handleValueChange}
/>
</LoadingNotification>
</SectionContent>
2019-05-21 22:34:48 +00:00
)
}
}
2019-05-27 20:21:05 +00:00
export default restComponent(SECURITY_SETTINGS_ENDPOINT, ManageUsers);