diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-20 00:18:43 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-20 00:19:37 +0800 |
commit | 6f2217570f0dd7060cf208da32b18c52c9798871 (patch) | |
tree | 0bd34b345ef58cc6156f700b93b44cd5f32ea420 /packages/instant/src/components/sliding_error.tsx | |
parent | 91ca80b248ac75b0d8258dd4dfc7a6e0c36c572b (diff) | |
parent | 669ea191a5e34ec704851377ee5eedb03c2d1538 (diff) | |
download | dexon-0x-contracts-6f2217570f0dd7060cf208da32b18c52c9798871.tar.gz dexon-0x-contracts-6f2217570f0dd7060cf208da32b18c52c9798871.tar.zst dexon-0x-contracts-6f2217570f0dd7060cf208da32b18c52c9798871.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/discharge
Diffstat (limited to 'packages/instant/src/components/sliding_error.tsx')
-rw-r--r-- | packages/instant/src/components/sliding_error.tsx | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/packages/instant/src/components/sliding_error.tsx b/packages/instant/src/components/sliding_error.tsx index 0237fb7e9..3865a8797 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'; @@ -20,8 +20,8 @@ export const Error: React.StatelessComponent<ErrorProps> = props => ( borderRadius="6px" marginBottom="10px" > - <Container marginRight="5px" display="inline"> - {props.icon} + <Container marginRight="5px" display="inline" top="3px" position="relative"> + <Text fontSize="20px">{props.icon}</Text> </Container> <Text fontWeight="500" fontColor={ColorOption.darkOrange}> {props.message} @@ -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> + ); +}; |