aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-31 06:21:58 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-31 06:21:58 +0800
commita49bf353f85c22a029db3085a620f3c031b52d73 (patch)
tree305a18cbdb2b2c5eca2d73598a8024ec6b87dfc7 /packages/instant/src/containers
parentd0a0af51306bf5e5b46fd8982c70b271212af42f (diff)
downloaddexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar
dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar.gz
dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar.bz2
dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar.lz
dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar.xz
dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar.zst
dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.zip
feat: refactor animation code
Diffstat (limited to 'packages/instant/src/containers')
-rw-r--r--packages/instant/src/containers/latest_error.tsx9
-rw-r--r--packages/instant/src/containers/selected_erc20_asset_amount_input.ts1
2 files changed, 6 insertions, 4 deletions
diff --git a/packages/instant/src/containers/latest_error.tsx b/packages/instant/src/containers/latest_error.tsx
index 45ca09673..2a8d232da 100644
--- a/packages/instant/src/containers/latest_error.tsx
+++ b/packages/instant/src/containers/latest_error.tsx
@@ -2,6 +2,7 @@ import * as React from 'react';
import { connect } from 'react-redux';
+import { SlideAnimationPhase } from '../components/animations/slide_animations';
import { SlidingError } from '../components/sliding_error';
import { State } from '../redux/reducer';
import { Asset, DisplayStatus } from '../types';
@@ -9,26 +10,26 @@ import { Asset, DisplayStatus } from '../types';
export interface LatestErrorComponentProps {
asset?: Asset;
latestErrorMessage?: string;
- slidingDirection: 'down' | 'up';
+ slidingPhase: SlideAnimationPhase;
}
export const LatestErrorComponent: React.StatelessComponent<LatestErrorComponentProps> = props => {
if (!props.latestErrorMessage) {
return <div />;
}
- return <SlidingError direction={props.slidingDirection} icon="😢" message={props.latestErrorMessage} />;
+ return <SlidingError phase={props.slidingPhase} icon="😢" message={props.latestErrorMessage} />;
};
interface ConnectedState {
asset?: Asset;
latestErrorMessage?: string;
- slidingDirection: 'down' | 'up';
+ slidingPhase: SlideAnimationPhase;
}
export interface LatestErrorProps {}
const mapStateToProps = (state: State, _ownProps: LatestErrorProps): ConnectedState => ({
asset: state.selectedAsset,
latestErrorMessage: state.latestErrorMessage,
- slidingDirection: state.latestErrorDisplayStatus === DisplayStatus.Present ? 'up' : 'down',
+ slidingPhase: state.latestErrorDisplayStatus === DisplayStatus.Present ? 'slideIn' : 'slideOut',
});
export const LatestError = connect(mapStateToProps)(LatestErrorComponent);
diff --git a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
index 4767b15d4..4df7faab9 100644
--- a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
+++ b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
@@ -19,6 +19,7 @@ import { errorFlasher } from '../util/error_flasher';
export interface SelectedERC20AssetAmountInputProps {
fontColor?: ColorOption;
startingFontSizePx: number;
+ onSymbolClick?: (asset?: ERC20Asset) => void;
}
interface ConnectedState {