diff options
author | Francesco Agosti <francesco.agosti93@gmail.com> | 2018-05-31 02:49:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-31 02:49:04 +0800 |
commit | e18d61b31a22519cd7d85ecffa62925ef7adc63d (patch) | |
tree | 166746953c94bdfd62cca909553f30d96d682bd8 /packages/website/ts/components/ui/overlay.tsx | |
parent | b20e40dd6fd9964876a0006efe8b879a9a1d2118 (diff) | |
parent | 61cd1ae5259c03e3ae1d1711d585e2222d8cfc34 (diff) | |
download | dexon-0x-contracts-e18d61b31a22519cd7d85ecffa62925ef7adc63d.tar.gz dexon-0x-contracts-e18d61b31a22519cd7d85ecffa62925ef7adc63d.tar.zst dexon-0x-contracts-e18d61b31a22519cd7d85ecffa62925ef7adc63d.zip |
Merge pull request #635 from 0xProject/feature/website/custom-onboarding-tooltip
Remove react-joyride and some more refactoring
Diffstat (limited to 'packages/website/ts/components/ui/overlay.tsx')
-rw-r--r-- | packages/website/ts/components/ui/overlay.tsx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/packages/website/ts/components/ui/overlay.tsx b/packages/website/ts/components/ui/overlay.tsx new file mode 100644 index 000000000..bb2ed8e59 --- /dev/null +++ b/packages/website/ts/components/ui/overlay.tsx @@ -0,0 +1,34 @@ +import { colors } from '@0xproject/react-shared'; +import * as _ from 'lodash'; +import * as React from 'react'; + +import { zIndex } from 'ts/utils/style'; + +export interface OverlayProps { + children?: React.ReactNode; + style?: React.CSSProperties; + onClick?: () => void; +} + +const style: React.CSSProperties = { + position: 'fixed', + top: 0, + right: 0, + bottom: 0, + left: 0, + zIndex: zIndex.overlay, + backgroundColor: 'rgba(0, 0, 0, 0.6)', +}; + +export const Overlay: React.StatelessComponent = (props: OverlayProps) => ( + <div style={{ ...style, ...props.style }} onClick={props.onClick}> + {props.children} + </div> +); + +Overlay.defaultProps = { + style: {}, + onClick: _.noop, +}; + +Overlay.displayName = 'Overlay'; |