-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e45b1ac
commit cf05529
Showing
34 changed files
with
926 additions
and
771 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2020: true, | ||
}, | ||
extends: ["eslint:recommended", "plugin:react/recommended"], | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 12, | ||
sourceType: "module", | ||
}, | ||
plugins: ["react"], | ||
rules: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Ignore artifacts: | ||
build | ||
coverage | ||
|
||
# Ignore all HTML files: | ||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# smarthome | ||
|
||
Application for home automation that turns lights on and off and controls temperature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
"@babel/preset-env", | ||
{ | ||
targets: { | ||
node: 'current', | ||
node: "current", | ||
}, | ||
}, | ||
], | ||
'@babel/preset-react', | ||
"@babel/preset-react", | ||
], | ||
|
||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from '../client/App'; | ||
import store from '../client/store'; | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import App from "../client/App"; | ||
import store from "../client/store"; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render(<App store={store}/>, div); | ||
}); | ||
it("renders without crashing", () => { | ||
const div = document.createElement("div"); | ||
ReactDOM.render(<App store={store} />, div); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,39 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Provider } from 'react-redux'; | ||
import store from './reducer/store'; | ||
import {BrowserRouter as Router, Route, Switch} from 'react-router-dom'; | ||
import { createMuiTheme, ThemeProvider } from '@material-ui/core'; | ||
import teal from '@material-ui/core/colors/teal'; | ||
import { CssBaseline } from '@material-ui/core'; | ||
import Home from './layouts/Home'; | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import { Provider } from "react-redux"; | ||
import { BrowserRouter as Router, Route, Switch } from "react-router-dom"; | ||
import { createMuiTheme, ThemeProvider } from "@material-ui/core"; | ||
import teal from "@material-ui/core/colors/teal"; | ||
import { CssBaseline } from "@material-ui/core"; | ||
import Home from "./layouts/Home"; | ||
|
||
const myColor = teal; | ||
const myColor = teal; | ||
|
||
const theme = createMuiTheme({ | ||
palette: { | ||
primary: myColor, | ||
secondary: myColor, | ||
type: 'dark', | ||
} | ||
}) | ||
type: "dark", | ||
}, | ||
}); | ||
|
||
// Return the App, rendering the MainContainer within it | ||
const App = ({store}) => { | ||
|
||
return( | ||
const App = ({ store }) => { | ||
return ( | ||
<Provider store={store}> | ||
<ThemeProvider theme={theme}> | ||
{/* works the same as a CSS-reset */} | ||
{/* works the same as a CSS-reset */} | ||
<CssBaseline /> | ||
{/* could be made into a component and stored on routes folder */} | ||
<Router> | ||
<Switch> | ||
<Route exact path="/" component={Home}/> | ||
<Route exact path="/" component={Home} /> | ||
</Switch> | ||
</Router> | ||
</ThemeProvider> | ||
</Provider> | ||
) | ||
); | ||
}; | ||
App.propTypes = {store: PropTypes.object.isRequired}; | ||
App.propTypes = { store: PropTypes.object.isRequired }; | ||
|
||
export default App; | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,44 @@ | ||
import React from 'react'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import BottomNavigation from '@material-ui/core/BottomNavigation'; | ||
import BottomNavigationAction from '@material-ui/core/BottomNavigationAction'; | ||
import SpeedIcon from '@material-ui/icons/Speed'; | ||
import EmojiObjectsIcon from '@material-ui/icons/EmojiObjects'; | ||
import Button from '@material-ui/core/Button'; | ||
/* eslint-disable react/prop-types */ | ||
import React from "react"; | ||
import { makeStyles } from "@material-ui/core/styles"; | ||
import { BottomNavigation, BottomNavigationAction } from "@material-ui/core"; | ||
import SpeedIcon from "@material-ui/icons/Speed"; | ||
import EmojiObjectsIcon from "@material-ui/icons/EmojiObjects"; | ||
|
||
const useStyles = makeStyles({ | ||
root: { | ||
width: '100%', | ||
position: 'fixed', | ||
width: "100%", | ||
position: "fixed", | ||
bottom: 0, | ||
background: 'black' | ||
background: "black", | ||
}, | ||
button: { | ||
width: '100%', | ||
width: "100%", | ||
}, | ||
}); | ||
|
||
export default function BottomBar({view, setView}) { | ||
export default function BottomBar({ view, setView }) { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<BottomNavigation | ||
value={view} | ||
onChange={(event, newValue) => { | ||
setView(newValue); | ||
|
||
}} | ||
showLabels | ||
className={classes.root} | ||
> | ||
<BottomNavigationAction | ||
className={classes.button} label="Temperature Panel" icon={<SpeedIcon />} /> | ||
<BottomNavigationAction | ||
className={classes.button} | ||
label="Light Panel" icon={<EmojiObjectsIcon />} /> | ||
<BottomNavigationAction | ||
className={classes.button} | ||
label="Temperature Panel" | ||
icon={<SpeedIcon />} | ||
/> | ||
<BottomNavigationAction | ||
className={classes.button} | ||
label="Light Panel" | ||
icon={<EmojiObjectsIcon />} | ||
/> | ||
</BottomNavigation> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.