merge router.jsx

This commit is contained in:
Kamen Stoykov 2019-05-16 19:25:35 +03:00
parent 1d60f6f6b6
commit 0a6db07355
1 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,45 @@
import React from 'react'
import PropTypes from 'prop-types'
import { Route, Switch } from 'react-router-dom'
import Home from '../Home'
import Filtered from '../Filtered'
import RecentlyAdded from '../RecentlyAdded'
import Profile from '../Profile'
import Dapps from '../Dapps'
import Vote from '../Vote'
import Submit from '../Submit'
import Terms from '../Terms/Terms'
import TransactionStatus from '../TransactionStatus'
import Alert from '../Alert'
import HowToSubmit from '../HowToSubmit'
class Router extends React.Component {
componentDidMount() {
const { fetchAllDapps } = this.props
fetchAllDapps()
}
render() {
return [
<Switch key={1}>
<Route exact path="/" component={Home} />
<Route path="/categories/:id" component={Filtered} />
<Route path="/all" component={Dapps} />
<Route path="/recently-added" component={RecentlyAdded} />
<Route path="/terms" component={Terms} />
<Route path="/:dapp_name" component={Profile} />
</Switch>,
<Vote key={2} />,
<Submit key={3} />,
<HowToSubmit key={4} />,
<TransactionStatus key={5} />,
<Alert key={6} />,
]
}
}
Router.propTypes = {
fetchAllDapps: PropTypes.func.isRequired,
}
export default Router