(fix) home routing path

This commit is contained in:
Gabriel Rodriguez Alsina 2019-01-04 12:54:46 -03:00
parent 8277bf45fd
commit 703334890b
2 changed files with 24 additions and 14 deletions

View File

@ -1,11 +1,11 @@
import React, { Component } from 'react'
import swal from 'sweetalert2'
import { Header, Ballots, NewBallot, Settings, Footer, Loading, BaseLoader, SearchBar, MainTitle } from './components'
import { Route } from 'react-router-dom'
import { Route, Redirect } from 'react-router-dom'
import { constants } from './utils/constants'
import { getNetworkBranch } from './utils/utils'
import { inject, observer } from 'mobx-react'
import { messages } from './utils/messages'
import { getNetworkBranch } from './utils/utils'
import './assets/stylesheets/index.css'
@ -119,7 +119,17 @@ class App extends Component {
this.state.showMobileMenu ? 'lo-App_Content-mobile-menu-open' : ''
}`}
>
<Route exact path={`/`} render={this.onBallotsRender} />
<Route
exact
path={`/`}
render={props => (
<Redirect
to={{
pathname: `${commonStore.rootPath}/`
}}
/>
)}
/>
<Route exact path={`${commonStore.rootPath}/`} render={this.onBallotsRender} />
<Route exact path={`${commonStore.rootPath}/active`} render={this.onActiveBallotsRender} />
<Route exact path={`${commonStore.rootPath}/tofinalize`} render={this.onToFinalizeBallotsRender} />

View File

@ -1,21 +1,21 @@
import 'babel-polyfill'
import App from './App'
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import { Router, Route } from 'react-router-dom'
import App from './App'
import registerServiceWorker from './utils/registerServiceWorker'
import { Provider } from 'mobx-react'
import { RouterStore, syncHistoryWithStore } from 'mobx-react-router'
import commonStore from './stores/CommonStore'
import validatorStore from './stores/ValidatorStore'
import ballotStore from './stores/BallotStore'
import ballotsStore from './stores/BallotsStore'
import commonStore from './stores/CommonStore'
import contractsStore from './stores/ContractsStore'
import { getContractsAddresses } from './contracts/addresses'
import swal from 'sweetalert2'
import getWeb3 from './utils/getWeb3'
import 'babel-polyfill'
import createBrowserHistory from 'history/createBrowserHistory'
import getWeb3 from './utils/getWeb3'
import registerServiceWorker from './utils/registerServiceWorker'
import swal from 'sweetalert2'
import validatorStore from './stores/ValidatorStore'
import { Provider } from 'mobx-react'
import { Router, Route } from 'react-router-dom'
import { RouterStore, syncHistoryWithStore } from 'mobx-react-router'
import { constants } from './utils/constants'
import { getContractsAddresses } from './contracts/addresses'
const browserHistory = createBrowserHistory()
const routingStore = new RouterStore()