diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-02 07:13:43 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-02 07:13:43 +0800 |
commit | 695d1453ac941fd7ef79ff1c4a255630eb76c764 (patch) | |
tree | 8e18b543df236ce7ef00d33770ed71f91e6b7d67 /packages/instant/src/components/ui/overlay.tsx | |
parent | ce19ec207b07696a675bdadf71ea39d933ea2715 (diff) | |
parent | 7c30fd4b2da83c9522f9137f4d18e6c308f2b66f (diff) | |
download | dexon-0x-contracts-695d1453ac941fd7ef79ff1c4a255630eb76c764.tar.gz dexon-0x-contracts-695d1453ac941fd7ef79ff1c4a255630eb76c764.tar.zst dexon-0x-contracts-695d1453ac941fd7ef79ff1c4a255630eb76c764.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/maker-asset-datas-interface
Diffstat (limited to 'packages/instant/src/components/ui/overlay.tsx')
-rw-r--r-- | packages/instant/src/components/ui/overlay.tsx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/packages/instant/src/components/ui/overlay.tsx b/packages/instant/src/components/ui/overlay.tsx new file mode 100644 index 000000000..c5258b031 --- /dev/null +++ b/packages/instant/src/components/ui/overlay.tsx @@ -0,0 +1,38 @@ +import * as _ from 'lodash'; +import * as React from 'react'; + +import { overlayBlack, styled } from '../../style/theme'; + +import { Container } from './container'; +import { Flex } from './flex'; +import { Icon } from './icon'; + +export interface OverlayProps { + className?: string; + onClose?: () => void; + zIndex?: number; +} + +const PlainOverlay: React.StatelessComponent<OverlayProps> = ({ children, className, onClose }) => ( + <Flex height="100vh" className={className}> + <Container position="absolute" top="0px" right="0px"> + <Icon height={18} width={18} color="white" icon="closeX" onClick={onClose} padding="2em 2em" /> + </Container> + <div>{children}</div> + </Flex> +); +export const Overlay = styled(PlainOverlay)` + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: ${props => props.zIndex} + background-color: ${overlayBlack}; +`; + +Overlay.defaultProps = { + zIndex: 100, +}; + +Overlay.displayName = 'Overlay'; |