Skip to content

Commit

Permalink
add redux actions, complete header component and dashboard component,…
Browse files Browse the repository at this point in the history
… start product-overview

,
  • Loading branch information
levelopers committed Apr 23, 2019
1 parent dbd8b44 commit 8dedcb9
Show file tree
Hide file tree
Showing 23 changed files with 678 additions and 122 deletions.
203 changes: 203 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
"private": true,
"dependencies": {
"axios": "^0.18.0",
"bootstrap": "^4.3.1",
"node-sass": "^4.11.0",
"react": "^16.8.6",
"react-bootstrap": "^1.0.0-beta.8",
"react-dom": "^16.8.6",
"react-redux": "^7.0.2",
"react-router-dom": "^5.0.0",
Expand Down
6 changes: 6 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"
/>
<title>React App</title>
</head>
<body>
Expand Down
24 changes: 20 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom';
import {connect } from 'react-redux'
import {insertToken} from './redux/action/tokenAction'
import Signin from './pages/loginsignin/Signin'
import LoginContainer from './pages/loginsignin/LoginContainer'
import SigninContainer from './pages/loginsignin/SigninContainer'
import Dashboard from './pages/dashboard/Dashboard'
import DashboardContainer from './pages/dashboard/DashboardContainer'
import ProductOverview from './pages/productOverview/ProductOverviewContainer'
import './App.css';

class App extends Component {
componentDidMount(){
this.props.insertToken()
}
render() {
return (
<div>
<Router>
<Switch>
<Route path="/signin" component={SigninContainer}/>
{this.props.token&&[
<Route key="dashboard" path="/dashboard" component={DashboardContainer}/>,
<Route key="productOverview" path="/product-overview" component={ProductOverview}/>

]}
<Route path="/login" component={LoginContainer}/>
<Route path="/dashboard" component={Dashboard}/>
<Route exact path="/" component={LoginContainer}/>
</Switch>
</Router>
</div>
);
}
}

export default App;
const mapStoreToProps=state=>({
token:state.token.user_token
})
const mapDispatchToProps={
insertToken
}
export default connect(mapStoreToProps,mapDispatchToProps)(App);
Loading

0 comments on commit 8dedcb9

Please sign in to comment.