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.

36 lines
1.0 KiB

  1. import React, { Component } from 'react';
  2. import MenuAppBar from '../components/MenuAppBar';
  3. import NTPSettings from './NTPSettings';
  4. import NTPStatus from './NTPStatus';
  5. import Tabs, { Tab } from 'material-ui/Tabs';
  6. class NTPConfiguration extends Component {
  7. constructor(props) {
  8. super(props);
  9. this.state = {
  10. selectedTab: "ntpStatus"
  11. };
  12. }
  13. handleTabChange = (event, selectedTab) => {
  14. this.setState({ selectedTab });
  15. };
  16. render() {
  17. const { selectedTab } = this.state;
  18. return (
  19. <MenuAppBar sectionTitle="NTP Configuration">
  20. <Tabs value={selectedTab} onChange={this.handleTabChange} indicatorColor="primary" textColor="primary" fullWidth centered scrollable>
  21. <Tab value="ntpStatus" label="NTP Status" />
  22. <Tab value="ntpSettings" label="NTP Settings" />
  23. </Tabs>
  24. {selectedTab === "ntpStatus" && <NTPStatus />}
  25. {selectedTab === "ntpSettings" && <NTPSettings />}
  26. </MenuAppBar>
  27. )
  28. }
  29. }
  30. export default NTPConfiguration