-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
34 lines (30 loc) · 1.02 KB
/
App.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
import React, { Component } from "react";
import { connect } from "react-redux";
import { BrowserRouter, Route } from "react-router-dom";
import LandingPage from "./LandingPage/LandingPage";
import DashboardPage from "./Dashboard/DashboardPage";
import SinglePage from "./SinglePage/SinglePageDisplay";
import Header from "./Header";
import * as actions from "../actions";
class App extends Component {
componentDidMount() {
this.props.getAllTags();
this.props.getAllAssets();
this.props.getAllSubTags();
}
render() {
return (
<BrowserRouter>
<div>
<Header />
<Route exact path="/" component={LandingPage} />
<Route exact path="/Dashboard" component={DashboardPage} />
<Route exact path="/Dashboard/:id" component={SinglePage} />
</div>
</BrowserRouter>
);
}
}
const mapStateToProps = ({ assets }) => ({ assets });
export default connect(mapStateToProps, actions)(App);
// in the props of app we can have access to the actions or the state