diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-08 12:53:25 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-08 12:53:25 +0800 |
commit | 4181a040b5d5ca2335556948585278133ec63bd1 (patch) | |
tree | 8174e8817d9658f0d53b1ddd61fe0552de4630ed /packages/instant/src/components/zero_ex_instant_overlay.tsx | |
parent | c0d8ceca82a91a3a6c222e71ecb58f2cd95da62e (diff) | |
download | dexon-sol-tools-4181a040b5d5ca2335556948585278133ec63bd1.tar.gz dexon-sol-tools-4181a040b5d5ca2335556948585278133ec63bd1.tar.zst dexon-sol-tools-4181a040b5d5ca2335556948585278133ec63bd1.zip |
feat: refactor out overlay component and use it to implement click-outside
Diffstat (limited to 'packages/instant/src/components/zero_ex_instant_overlay.tsx')
-rw-r--r-- | packages/instant/src/components/zero_ex_instant_overlay.tsx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/packages/instant/src/components/zero_ex_instant_overlay.tsx b/packages/instant/src/components/zero_ex_instant_overlay.tsx index 3461600e1..d2b41d27f 100644 --- a/packages/instant/src/components/zero_ex_instant_overlay.tsx +++ b/packages/instant/src/components/zero_ex_instant_overlay.tsx @@ -1,5 +1,10 @@ import * as React from 'react'; +import { ColorOption, overlayBlack, styled } from '../style/theme'; + +import { Container } from './ui/container'; +import { Flex } from './ui/flex'; +import { Icon } from './ui/icon'; import { Overlay } from './ui/overlay'; import { ZeroExInstantContainer } from './zero_ex_instant_container'; import { ZeroExInstantProvider, ZeroExInstantProviderProps } from './zero_ex_instant_provider'; @@ -13,8 +18,20 @@ export const ZeroExInstantOverlay: React.StatelessComponent<ZeroExInstantOverlay const { onClose, zIndex, ...rest } = props; return ( <ZeroExInstantProvider {...rest}> - <Overlay onClose={onClose} zIndex={zIndex}> - <ZeroExInstantContainer /> + <Overlay zIndex={zIndex}> + <Flex height="100vh"> + <Container position="absolute" top="0px" right="0px"> + <Icon + height={18} + width={18} + color={ColorOption.white} + icon="closeX" + onClick={onClose} + padding="2em 2em" + /> + </Container> + <ZeroExInstantContainer /> + </Flex> </Overlay> </ZeroExInstantProvider> ); |