Minor interface tidyups:

Factor out app name
Tidy index.js
This commit is contained in:
Rick Watson 2019-05-14 22:20:08 +01:00
parent e63a8c4b75
commit 7f6fc0facc
3 changed files with 6 additions and 6 deletions

1
interface/.env Normal file
View File

@ -0,0 +1 @@
REACT_APP_NAME=ESP8266 React

View File

@ -22,6 +22,8 @@ import SystemUpdateIcon from '@material-ui/icons/SystemUpdate';
import AccessTimeIcon from '@material-ui/icons/AccessTime'; import AccessTimeIcon from '@material-ui/icons/AccessTime';
import SettingsInputAntennaIcon from '@material-ui/icons/SettingsInputAntenna'; import SettingsInputAntennaIcon from '@material-ui/icons/SettingsInputAntenna';
import { APP_NAME } from '../constants/App';
const drawerWidth = 290; const drawerWidth = 290;
const styles = theme => ({ const styles = theme => ({
@ -97,7 +99,7 @@ class MenuAppBar extends React.Component {
<div> <div>
<Toolbar> <Toolbar>
<Typography variant="title" color="primary"> <Typography variant="title" color="primary">
ESP8266 React {APP_NAME}
</Typography> </Typography>
<Divider absolute /> <Divider absolute />
</Toolbar> </Toolbar>

View File

@ -2,15 +2,12 @@ import React from 'react';
import { render } from 'react-dom'; import { render } from 'react-dom';
import history from './history'; import history from './history';
import { Router, Route, Redirect, Switch } from 'react-router'; import { Router } from 'react-router';
import App from './App'; import App from './App';
render(( render((
<Router history={history}> <Router history={history}>
<Switch> <App/>
<Redirect exact from='/' to='/home'/>
<Route path="/" component={App} />
</Switch>
</Router> </Router>
), document.getElementById("root")) ), document.getElementById("root"))