WordClockESP/interface/src/containers/NTPSettings.js

33 lines
892 B
JavaScript
Raw Normal View History

import React, { Component } from 'react';
import { NTP_SETTINGS_ENDPOINT } from '../constants/Endpoints';
2018-03-04 17:36:04 +00:00
import {restComponent} from '../components/RestComponent';
import SectionContent from '../components/SectionContent';
import NTPSettingsForm from '../forms/NTPSettingsForm';
class NTPSettings extends Component {
componentDidMount() {
2018-03-04 17:36:04 +00:00
this.props.loadData();
}
render() {
2018-03-04 17:36:04 +00:00
const { data, fetched, errorMessage } = this.props;
return (
<SectionContent title="NTP Settings">
2018-03-04 17:36:04 +00:00
<NTPSettingsForm
ntpSettings={data}
ntpSettingsFetched={fetched}
errorMessage={errorMessage}
onSubmit={this.props.saveData}
onReset={this.props.loadData}
handleValueChange={this.props.handleValueChange}
/>
</SectionContent>
)
}
}
2018-03-04 17:36:04 +00:00
export default restComponent(NTP_SETTINGS_ENDPOINT, NTPSettings);