forked from levelopers/Ecommerce-Reactjs
-
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.
add redux actions, complete header component and dashboard component,…
… start product-overview ,
- Loading branch information
1 parent
dbd8b44
commit 8dedcb9
Showing
23 changed files
with
678 additions
and
122 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -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); |
Oops, something went wrong.