Skip to content

Commit

Permalink
Move AddDevice button to App Component instead of Devices
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentbitter committed Dec 9, 2019
1 parent 8c60ef1 commit be96ae3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions website/src/components/Devices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Device from './Device';
import AddDevice from './AddDevice';

class Devices extends React.Component {

componentDidMount() {
this.load();
}
Expand All @@ -20,9 +19,6 @@ class Devices extends React.Component {
render() {
return (
<Grid container spacing={3}>
<Grid item xs={12} sm={6} md={4} lg={3}>
<AddDevice />
</Grid>
{AppState.devices.map((device, i) =>
<Grid key={i} item xs={12} sm={6} md={4} lg={3}>
<Device device={device} />
Expand Down
2 changes: 2 additions & 0 deletions website/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import CssBaseline from '@material-ui/core/CssBaseline';
import Box from '@material-ui/core/Box';
import AddDevice from './components/AddDevice';
import Devices from './components/Devices';
import Navigation from './components/Navigation';
import { view } from 'react-easy-state';
Expand All @@ -14,6 +15,7 @@ const App = view(() => {
<Navigation />
<Box component="div" m={3}>
<Devices />
<AddDevice />
</Box>
</React.Fragment>
);
Expand Down

0 comments on commit be96ae3

Please sign in to comment.