diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-18 04:26:18 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-18 05:44:40 +0800 |
commit | 187bbc7fc14ccc0385981a38602334de65e2506c (patch) | |
tree | 79e2ad1cdd6a922c0cd5563dd4445317f8534bbd /packages/instant/src/containers | |
parent | d46b28873385a8d6521d36f2a529451e1f725b26 (diff) | |
download | dexon-sol-tools-187bbc7fc14ccc0385981a38602334de65e2506c.tar dexon-sol-tools-187bbc7fc14ccc0385981a38602334de65e2506c.tar.gz dexon-sol-tools-187bbc7fc14ccc0385981a38602334de65e2506c.tar.bz2 dexon-sol-tools-187bbc7fc14ccc0385981a38602334de65e2506c.tar.lz dexon-sol-tools-187bbc7fc14ccc0385981a38602334de65e2506c.tar.xz dexon-sol-tools-187bbc7fc14ccc0385981a38602334de65e2506c.tar.zst dexon-sol-tools-187bbc7fc14ccc0385981a38602334de65e2506c.zip |
latestErrorDismissed -> latestErrorDisplay enum
Diffstat (limited to 'packages/instant/src/containers')
-rw-r--r-- | packages/instant/src/containers/latest_error.tsx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/instant/src/containers/latest_error.tsx b/packages/instant/src/containers/latest_error.tsx index 5272d9610..7f36d3bf8 100644 --- a/packages/instant/src/containers/latest_error.tsx +++ b/packages/instant/src/containers/latest_error.tsx @@ -3,34 +3,33 @@ import * as React from 'react'; import { connect } from 'react-redux'; import { SlidingError } from '../components/sliding_error'; -import { State } from '../redux/reducer'; +import { LatestErrorDisplay, State } from '../redux/reducer'; import { errorDescription } from '../util/error_description'; export interface LatestErrorComponentProps { assetData?: string; latestError?: any; - latestErrorDismissed?: boolean; + slidingDirection: 'down' | 'up'; } export const LatestErrorComponent: React.StatelessComponent<LatestErrorComponentProps> = props => { if (!props.latestError) { return <div />; } - const slidingDirection = props.latestErrorDismissed ? 'down' : 'up'; const { icon, message } = errorDescription(props.latestError, props.assetData); - return <SlidingError direction={slidingDirection} icon={icon} message={message} />; + return <SlidingError direction={props.slidingDirection} icon={icon} message={message} />; }; interface ConnectedState { assetData?: string; latestError?: any; - latestErrorDismissed?: boolean; + slidingDirection: 'down' | 'up'; } export interface LatestErrorProps {} const mapStateToProps = (state: State, _ownProps: LatestErrorProps): ConnectedState => ({ assetData: state.selectedAssetData, latestError: state.latestError, - latestErrorDismissed: state.latestErrorDismissed, + slidingDirection: state.latestErrorDisplay === LatestErrorDisplay.Present ? 'up' : 'down', }); export const LatestError = connect(mapStateToProps)(LatestErrorComponent); |