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
Showing
10 changed files
with
212 additions
and
59 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
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from "react"; | ||
import "./App.css"; | ||
import {Row} from "react-flexbox-grid"; | ||
import MuiThemeProvider from "material-ui/styles/MuiThemeProvider"; | ||
import getMuiTheme from 'material-ui/styles/getMuiTheme'; | ||
import {AppBar, MenuItem, IconMenu, IconButton} from "material-ui"; | ||
import MoreVertIcon from "material-ui/svg-icons/navigation/more-vert"; | ||
import SpicyMenu from "./menus/SpicyMenu"; | ||
import foodItems from "./data/food"; | ||
|
||
const AppMenu = () => { | ||
return ( | ||
<IconMenu | ||
iconButtonElement={<IconButton><MoreVertIcon /></IconButton>} | ||
anchorOrigin={{horizontal: 'right', vertical: 'top'}} | ||
targetOrigin={{horizontal: 'right', vertical: 'top'}}> | ||
<MenuItem primaryText="Menus"/> | ||
<MenuItem primaryText="Summary"/> | ||
</IconMenu> | ||
); | ||
}; | ||
|
||
|
||
const muiTheme = getMuiTheme({ | ||
appBar: { | ||
color: '#16a085', | ||
}, | ||
}); | ||
const App = () => ( | ||
<MuiThemeProvider muiTheme={muiTheme}> | ||
<div> | ||
<div> | ||
<Row around="lg"> | ||
<AppBar | ||
title="spicyveggie" | ||
showMenuIconButton={false} | ||
iconElementRight={<AppMenu />} | ||
/> | ||
</Row> | ||
</div> | ||
<div id="content-root"> | ||
<SpicyMenu foodItems={foodItems}/> | ||
</div> | ||
</div> | ||
</MuiThemeProvider> | ||
); | ||
|
||
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,48 +1,53 @@ | ||
import React from "react"; | ||
import "./App.css"; | ||
import {Row} from "react-flexbox-grid"; | ||
import MuiThemeProvider from "material-ui/styles/MuiThemeProvider"; | ||
import getMuiTheme from 'material-ui/styles/getMuiTheme'; | ||
import {AppBar, MenuItem, IconMenu, IconButton} from "material-ui"; | ||
import MoreVertIcon from "material-ui/svg-icons/navigation/more-vert"; | ||
import SpicyMenu from "./menus/SpicyMenu"; | ||
import foodItems from "./data/food"; | ||
import {AppBar, MenuItem, Drawer} from "material-ui"; | ||
import Link from 'react-router-dom'; | ||
|
||
const AppMenu = () => { | ||
return ( | ||
<IconMenu | ||
iconButtonElement={<IconButton><MoreVertIcon /></IconButton>} | ||
anchorOrigin={{horizontal: 'right', vertical: 'top'}} | ||
targetOrigin={{horizontal: 'right', vertical: 'top'}}> | ||
<MenuItem primaryText="Menus"/> | ||
<MenuItem primaryText="Summary"/> | ||
</IconMenu> | ||
); | ||
}; | ||
class App extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
open: false | ||
} | ||
} | ||
|
||
const muiTheme = getMuiTheme({ | ||
appBar: { | ||
color: '#16a085', | ||
}, | ||
}); | ||
const App = () => ( | ||
<MuiThemeProvider muiTheme={muiTheme}> | ||
<div> | ||
toggleDrawer = () => this.setState({open: !this.state.open}) | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<Row around="lg"> | ||
<AppBar | ||
title="spicyveggie" | ||
showMenuIconButton={false} | ||
iconElementRight={<AppMenu />} | ||
<AppBar | ||
title="SpicyVeggie" | ||
iconClassNameRight="muidocs-icon-navigation-expand-more" | ||
onLeftIconButtonTouchTap={this.toggleDrawer} | ||
/> | ||
|
||
<Drawer | ||
docked={false} | ||
width={300} | ||
onRequestChange={this.toggleDrawer} | ||
open={this.state.open} | ||
> | ||
<MenuItem | ||
primaryText="Menu" | ||
containerElement={<Link to="/menu"/>} | ||
onTouchTap={() => { | ||
console.log('going home') | ||
this.toggleDrawer() | ||
}} | ||
/> | ||
</Row> | ||
</div> | ||
<div id="content-root"> | ||
<SpicyMenu foodItems={foodItems}/> | ||
<MenuItem | ||
primaryText="Summary" | ||
containerElement={<Link to="/summary"/>} | ||
onTouchTap={() => { | ||
console.log('going summary') | ||
this.toggleDrawer() | ||
}} | ||
/> | ||
</Drawer> | ||
</div> | ||
</div> | ||
</MuiThemeProvider> | ||
); | ||
); | ||
} | ||
} | ||
|
||
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
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,7 @@ | ||
import React from 'react'; | ||
|
||
const Menu = () => { | ||
return <h1>Menu</h1>; | ||
}; | ||
|
||
export default Menu; |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
const Summary = () => { | ||
return <h1>Summary</h1>; | ||
}; | ||
|
||
export default Summary; |
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,12 +1,36 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import MuiThemeProvider from "material-ui/styles/MuiThemeProvider"; | ||
import getMuiTheme from 'material-ui/styles/getMuiTheme'; | ||
import injectTapEventPlugin from 'react-tap-event-plugin'; | ||
import App from './App' | ||
import './index.css'; | ||
|
||
import App from './App'; | ||
import Summary from './components/summary/Summary'; | ||
import Menu from './components/menus/Menu'; | ||
|
||
import { | ||
BrowserRouter as Router, | ||
Route, | ||
Link, | ||
Switch, | ||
browserHistory | ||
} from 'react-router-dom'; | ||
|
||
// Needed for onTouchTap | ||
// http://stackoverflow.com/a/34015469/988941 | ||
injectTapEventPlugin(); | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); | ||
|
||
const Root = () => ( | ||
<MuiThemeProvider> | ||
<Router history={browserHistory}> | ||
<Switch> | ||
<Route exact path="/" component={App}/> | ||
<Route path="/menu" component={Menu}/> | ||
<Route path="/summary" component={Summary}/> | ||
</Switch> | ||
</Router> | ||
</MuiThemeProvider> | ||
); | ||
|
||
|
||
ReactDOM.render(<Root />, document.getElementById('root')); |
Oops, something went wrong.