Commit 14b70eeb authored by Chi Kei Chan's avatar Chi Kei Chan

Fix routes for assets path

parent 6b5621fe
......@@ -19,17 +19,13 @@ class NavigationTabs extends Component {
};
}
renderTab(name, path) {
renderTab(name, path, regex) {
const { push } = this.props.history;
const { selectedPath } = this.state;
return (
<Tab
text={name}
onClick={() => {
push(path);
this.setState({ selectedPath: path });
}}
isSelected={selectedPath.indexOf(path) > -1}
onClick={() => push(path)}
isSelected={regex.test(this.props.location.pathname)}
/>
)
}
......@@ -37,9 +33,9 @@ class NavigationTabs extends Component {
render() {
return (
<Tabs className={this.props.className}>
{ this.renderTab('Swap', '/swap') }
{ this.renderTab('Send', '/send') }
{ this.renderTab('Pool', '/pool') }
{ this.renderTab('Swap', '/swap', /swap/) }
{ this.renderTab('Send', '/send', /send/) }
{ this.renderTab('Pool', '/add-liquidity', /add-liquidity|remove-liquidity|create-exchange/) }
</Tabs>
);
}
......
......@@ -53,7 +53,8 @@ class App extends Component {
>
<Route exact path="/swap" component={Swap} />
<Route exact path="/send" component={Send} />
<Route path="/pool" component={Pool} />
<Route exact path="/add-liquidity" component={Pool} />
<Route exact path="/create-exchange" component={Pool} />
<Redirect exact from="/" to="/swap" />
</AnimatedSwitch>
</BrowserRouter>
......
......@@ -25,11 +25,11 @@ class ModeSelector extends Component {
switch (view) {
case ADD:
return history.push('/pool/add');
return history.push('/add-liquidity');
case REMOVE:
return history.push('/pool/remove');
return history.push('/remove-liquidity');
case CREATE:
return history.push('/pool/create');
return history.push('/create-exchange');
default:
return;
}
......
......@@ -15,10 +15,9 @@ class Pool extends Component {
<Header />
</MediaQuery>
<Switch>
<Route exact path="/pool/add" component={AddLiquidity} />
<Route exact path="/add-liquidity" component={AddLiquidity} />
{/*<Route exact path="/remove" component={Send} />*/}
<Route exact path="/pool/create" component={CreateExchange} />
<Redirect exact from="/pool" to="/pool/add" />
<Route exact path="/create-exchange" component={CreateExchange} />
</Switch>
</div>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment