-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
74 lines (66 loc) · 2.2 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import { MuiThemeProvider } from '@material-ui/core/styles';
import { createMuiTheme } from '@material-ui/core/styles';
import { green, red } from '@material-ui/core/colors';
import Register from './pages/Register';
import Login from './pages/Login';
import Progress from './pages/Progress';
import Video from './pages/Video';
import Store from './pages/Store';
import CultureAdd from './pages/CultureAdd';
import CultureView from './pages/CultureView';
import MyStore from './pages/MyStore';
import Layout from './components/Layout';
import registerServiceWorker from './registerServiceWorker';
import './index.css';
const theme = createMuiTheme({
palette: {
primary: green,
secondary: red,
},
});
const ProgressPage = (props) => (
<Layout title="Minhas Culturas" bottomBar menu {...props}>
<Progress />
</Layout>
);
const StorePage = (props) => (
<Layout title="Loja" bottomBar menu>
<Store {...props} />
</Layout>
);
const MyStorePage = ({ history }) => (
<Layout title="Minha loja" back={() => history.goBack()}>
<MyStore />
</Layout>
);
const KnowMorePage = ({ history }) => (
<Layout title="Agricultura sintrópica" back={() => history.goBack()}>
<Video />
</Layout>
);
const ProdutoPage = ({ history }) => (
<Layout title="Cadastrar Cultura" back={() => history.goBack()}>
<CultureAdd />
</Layout>
);
const App = () => (
<MuiThemeProvider theme={theme}>
<Router>
<Switch>
<Route exact path="/" component={Login} />
<Route exact path="/cadastro" component={Register} />
<Route exact path="/cultura" component={ProgressPage} />
<Route exact path="/cultura/:cultureName" component={CultureView} />
<Route exact path="/loja" component={StorePage} />
<Route exact path="/minha-loja" component={MyStorePage} />
<Route exact path="/saiba-mais" component={KnowMorePage} />
<Route exact path="/cadastro-produto" component={ProdutoPage} />
</Switch>
</Router>
</MuiThemeProvider>
);
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();