Commit 10dc4e2d authored by Ross's avatar Ross

added ani

parent 33124d6f
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { BrowserRouter, Redirect, Route } from 'react-router-dom'; import { BrowserRouter, Redirect, Route, Switch } from 'react-router-dom';
import MediaQuery from 'react-responsive'; import MediaQuery from 'react-responsive';
import { AnimatedSwitch } from 'react-router-transition'; //import { AnimatedSwitch } from 'react-router-transition';
import { Web3Connect, startWatching, initialize } from '../ducks/web3connect'; import { Web3Connect, startWatching, initialize } from '../ducks/web3connect';
import { setAddresses } from '../ducks/addresses'; import { setAddresses } from '../ducks/addresses';
import Header from '../components/Header'; import Header from '../components/Header';
...@@ -45,19 +45,16 @@ class App extends Component { ...@@ -45,19 +45,16 @@ class App extends Component {
</MediaQuery> </MediaQuery>
<Web3Connect /> <Web3Connect />
<BrowserRouter> <BrowserRouter>
<AnimatedSwitch <Switch>
atEnter={{ opacity: 0 }} <div className="app__switch-wrapper">
atLeave={{ opacity: 0 }}
atActive={{ opacity: 1 }}
className="app__switch-wrapper"
>
<Route exact path="/swap" component={Swap} /> <Route exact path="/swap" component={Swap} />
<Route exact path="/send" component={Send} /> <Route exact path="/send" component={Send} />
<Route exact path="/add-liquidity" component={Pool} /> <Route exact path="/add-liquidity" component={Pool} />
<Route exact path="/remove-liquidity" component={Pool} /> <Route exact path="/remove-liquidity" component={Pool} />
<Route exact path="/create-exchange/:tokenAddress?" component={Pool} /> <Route exact path="/create-exchange/:tokenAddress?" component={Pool} />
<Redirect exact from="/" to="/swap" /> <Redirect exact from="/" to="/swap" />
</AnimatedSwitch> </div>
</Switch>
</BrowserRouter> </BrowserRouter>
</div> </div>
); );
......
...@@ -30,3 +30,24 @@ ...@@ -30,3 +30,24 @@
//max-width: 560px; //max-width: 560px;
} }
} }
@keyframes title_fade_in {
from {
opacity: 0;
top: -10px;
}
to {
opacity: 1;
top: 0px;
}
}
.ani_title_fade_in {
position: relative;
opacity: 0;
animation: title_fade_in cubic-bezier(0.23, 1, 0.32, 1) 1;
animation-fill-mode: forwards;
animation-duration: 1.2s;
animation-delay: 0s;
}
\ No newline at end of file
...@@ -511,6 +511,8 @@ class AddLiquidity extends Component { ...@@ -511,6 +511,8 @@ class AddLiquidity extends Component {
'header--inactive': !isConnected, 'header--inactive': !isConnected,
})} })}
/> />
<div className='ani_title_fade_in'>
{ {
this.isNewExchange() this.isNewExchange()
? ( ? (
...@@ -572,6 +574,7 @@ class AddLiquidity extends Component { ...@@ -572,6 +574,7 @@ class AddLiquidity extends Component {
</button> </button>
</div> </div>
</div> </div>
</div>
]; ];
} }
} }
......
...@@ -718,7 +718,7 @@ class Send extends Component { ...@@ -718,7 +718,7 @@ class Send extends Component {
const { inputError, outputError, isValid } = this.validate(); const { inputError, outputError, isValid } = this.validate();
return ( return (
<div className="send"> <div className="send ">
<MediaQuery query="(max-width: 767px)"> <MediaQuery query="(max-width: 767px)">
<Header /> <Header />
</MediaQuery> </MediaQuery>
...@@ -732,6 +732,8 @@ class Send extends Component { ...@@ -732,6 +732,8 @@ class Send extends Component {
'header--inactive': !this.props.isConnected, 'header--inactive': !this.props.isConnected,
})} })}
/> />
<div className='ani_title_fade_in'>
<CurrencyInputPanel <CurrencyInputPanel
title="Input" title="Input"
description={lastEditedField === OUTPUT ? estimatedText : ''} description={lastEditedField === OUTPUT ? estimatedText : ''}
...@@ -783,6 +785,8 @@ class Send extends Component { ...@@ -783,6 +785,8 @@ class Send extends Component {
</button> </button>
</div> </div>
</div> </div>
</div>
</div> </div>
); );
} }
......
...@@ -698,7 +698,6 @@ class Swap extends Component { ...@@ -698,7 +698,6 @@ class Swap extends Component {
const { inputError, outputError, isValid } = this.validate(); const { inputError, outputError, isValid } = this.validate();
return ( return (
<div className="swap"> <div className="swap">
<MediaQuery query="(max-width: 767px)"> <MediaQuery query="(max-width: 767px)">
...@@ -714,6 +713,8 @@ class Swap extends Component { ...@@ -714,6 +713,8 @@ class Swap extends Component {
'header--inactive': !this.props.isConnected, 'header--inactive': !this.props.isConnected,
})} })}
/> />
<div className='ani_title_fade_in'>
<CurrencyInputPanel <CurrencyInputPanel
title="Input" title="Input"
description={lastEditedField === OUTPUT ? estimatedText : ''} description={lastEditedField === OUTPUT ? estimatedText : ''}
...@@ -757,6 +758,7 @@ class Swap extends Component { ...@@ -757,6 +758,7 @@ class Swap extends Component {
</div> </div>
</div> </div>
</div> </div>
</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