forked from rstormsf/multisender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
47 lines (45 loc) · 1.49 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
35
36
37
38
39
40
41
42
43
44
45
46
47
import React, { Component } from 'react';
import { Header, FirstStep, SecondStep, ThirdStep, FourthStep, FifthStep, Retry, Welcome } from './components';
import { Route, Redirect } from 'react-router-dom';
import { inject } from "mobx-react";
import './assets/stylesheets/application.css';
const PrivateRoute = ({ component: Component, startedUrl, ...rest }) => (
<Route
{...rest}
render={props =>
startedUrl === '#/' || startedUrl === '#/1' ? (
<Component {...props} />
) : (
<Redirect
to={{
pathname: "/"
}}
/>
)
}
/>
);
@inject("UiStore")
export class App extends React.Component {
constructor(props){
super(props);
this.web3Store = props.UiStore.web3Store;
}
render(){
let startedUrl = this.web3Store.startedUrl;
console.log('fix reset');
return (
<div>
<Header />
<Route exact path="/" component={FirstStep}/>
<Route exact path="/1" component={FirstStep}/>
<PrivateRoute path="/2" component={SecondStep} startedUrl={startedUrl} />
<PrivateRoute exact path="/2" component={SecondStep} startedUrl={startedUrl}/>
<PrivateRoute exact path="/3" component={ThirdStep} startedUrl={startedUrl}/>
<PrivateRoute exact path="/4" component={FourthStep} startedUrl={startedUrl}/>
<PrivateRoute exact path="/5" component={FifthStep} startedUrl={startedUrl}/>
{/* <Route exact path="/retry" component={Retry}/> */}
</div>
);
}
}