diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-13 06:35:20 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-13 07:26:26 +0800 |
commit | 0aef2c8ade2b0ae7b7ab7fef25ee4e8644a8b6c4 (patch) | |
tree | deb42bc8917bc88d036d0f00efe9807c22423caf /packages/instant/src/components/sliding_error.tsx | |
parent | 7102a23b0a3a502f250071576821ce385a761f4d (diff) | |
download | dexon-0x-contracts-0aef2c8ade2b0ae7b7ab7fef25ee4e8644a8b6c4.tar.gz dexon-0x-contracts-0aef2c8ade2b0ae7b7ab7fef25ee4e8644a8b6c4.tar.zst dexon-0x-contracts-0aef2c8ade2b0ae7b7ab7fef25ee4e8644a8b6c4.zip |
feat(instant): add sliding error
Diffstat (limited to 'packages/instant/src/components/sliding_error.tsx')
-rw-r--r-- | packages/instant/src/components/sliding_error.tsx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/packages/instant/src/components/sliding_error.tsx b/packages/instant/src/components/sliding_error.tsx new file mode 100644 index 000000000..2e6decbad --- /dev/null +++ b/packages/instant/src/components/sliding_error.tsx @@ -0,0 +1,36 @@ +import * as React from 'react'; + +import { ColorOption } from '../style/theme'; + +import { SlideUpAndDownAnimationComponent } from './animations/slide_up_and_down_animation'; + +import { Container, Text } from './ui'; + +export interface ErrorProps { + icon: string; + message: string; +} + +export const Error: React.StatelessComponent<ErrorProps> = props => ( + <Container + padding="10px" + border={`1px solid ${ColorOption.darkOrange}`} + backgroundColor={ColorOption.lightOrange} + width="100%" + borderRadius="6px" + marginBottom="10px" + > + <Container marginRight="5px" display="inline"> + {props.icon} + </Container> + <Text fontWeight="500" fontColor={ColorOption.darkOrange}> + {props.message} + </Text> + </Container> +); + +export const SlidingError: React.StatelessComponent<ErrorProps> = props => ( + <SlideUpAndDownAnimationComponent downY="120px" delayMs={5000}> + <Error icon={props.icon} message={props.message} /> + </SlideUpAndDownAnimationComponent> +); |