Fork of the excellent esp8266-react - https://github.com/rjwats/esp8266-react
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
808 B

  1. import React, { Component } from 'react';
  2. import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
  3. import { NTP_SETTINGS_ENDPOINT } from '../api';
  4. import NTPSettingsForm from './NTPSettingsForm';
  5. import { NTPSettings } from './types';
  6. type NTPSettingsControllerProps = RestControllerProps<NTPSettings>;
  7. class NTPSettingsController extends Component<NTPSettingsControllerProps> {
  8. componentDidMount() {
  9. this.props.loadData();
  10. }
  11. render() {
  12. return (
  13. <SectionContent title="NTP Settings" titleGutter>
  14. <RestFormLoader
  15. {...this.props}
  16. render={formProps => <NTPSettingsForm {...formProps} />}
  17. />
  18. </SectionContent>
  19. )
  20. }
  21. }
  22. export default restController(NTP_SETTINGS_ENDPOINT, NTPSettingsController);