diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-17 02:25:52 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-18 05:44:39 +0800 |
commit | db77cd10c550803c4f3fac585adc0a7f6ffa8999 (patch) | |
tree | d575b28199e32fd0ebdbac831e3839cc4fa2aa10 /packages/instant/src/components/sliding_error.tsx | |
parent | f36352be47a3caf92e16e3965c86b593bfc46fea (diff) | |
download | dexon-0x-contracts-db77cd10c550803c4f3fac585adc0a7f6ffa8999.tar.gz dexon-0x-contracts-db77cd10c550803c4f3fac585adc0a7f6ffa8999.tar.zst dexon-0x-contracts-db77cd10c550803c4f3fac585adc0a7f6ffa8999.zip |
feat(instant): Handle AssetBuyer errors
Diffstat (limited to 'packages/instant/src/components/sliding_error.tsx')
-rw-r--r-- | packages/instant/src/components/sliding_error.tsx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/packages/instant/src/components/sliding_error.tsx b/packages/instant/src/components/sliding_error.tsx index 0237fb7e9..ad87481c4 100644 --- a/packages/instant/src/components/sliding_error.tsx +++ b/packages/instant/src/components/sliding_error.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { ColorOption } from '../style/theme'; -import { SlideUpAndDownAnimation } from './animations/slide_up_and_down_animation'; +import { SlideDownAnimation, SlideUpAnimation } from './animations/slide_animations'; import { Container, Text } from './ui'; @@ -29,8 +29,16 @@ export const Error: React.StatelessComponent<ErrorProps> = props => ( </Container> ); -export const SlidingError: React.StatelessComponent<ErrorProps> = props => ( - <SlideUpAndDownAnimation downY="120px" delayMs={5000}> - <Error icon={props.icon} message={props.message} /> - </SlideUpAndDownAnimation> -); +export type SlidingDirection = 'up' | 'down'; +export interface SlidingErrorProps extends ErrorProps { + direction: SlidingDirection; +} +export const SlidingError: React.StatelessComponent<SlidingErrorProps> = props => { + const AnimationComponent = props.direction === 'up' ? SlideUpAnimation : SlideDownAnimation; + + return ( + <AnimationComponent downY="120px"> + <Error icon={props.icon} message={props.message} /> + </AnimationComponent> + ); +}; |