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.

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