aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/ui/overlay.tsx
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-11-12 05:11:10 +0800
committerFabio Berger <me@fabioberger.com>2018-11-12 05:11:10 +0800
commit0391f93490cffdc69f6cb32f11762d174ed04e37 (patch)
tree3a8b30a04de1193aa21e5b84bd572db24979a8bf /packages/instant/src/components/ui/overlay.tsx
parent399a7d5fec9af4f3491a77f0c2d46738f3d8ffa7 (diff)
parent397b4e289015f9bb0831c1a0ce6fee601670b487 (diff)
downloaddexon-0x-contracts-0391f93490cffdc69f6cb32f11762d174ed04e37.tar.gz
dexon-0x-contracts-0391f93490cffdc69f6cb32f11762d174ed04e37.tar.zst
dexon-0x-contracts-0391f93490cffdc69f6cb32f11762d174ed04e37.zip
merge development
Diffstat (limited to 'packages/instant/src/components/ui/overlay.tsx')
-rw-r--r--packages/instant/src/components/ui/overlay.tsx39
1 files changed, 39 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..f67d6fb2f
--- /dev/null
+++ b/packages/instant/src/components/ui/overlay.tsx
@@ -0,0 +1,39 @@
+import * as _ from 'lodash';
+
+import { generateMediaWrapper, ScreenWidths } from '../../style/media';
+import { generateOverlayBlack, styled } from '../../style/theme';
+import { zIndex } from '../../style/z_index';
+
+export interface OverlayProps {
+ zIndex?: number;
+ backgroundColor?: string;
+ width?: string;
+ height?: string;
+ showMaxWidth?: ScreenWidths;
+}
+
+export const Overlay =
+ styled.div <
+ OverlayProps >
+ `
+ && {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: ${props => props.zIndex}
+ background-color: ${props => props.backgroundColor};
+ ${props => props.width && `width: ${props.width};`}
+ ${props => props.height && `height: ${props.height};`}
+ display: ${props => (props.showMaxWidth ? 'none' : 'block')};
+ ${props => props.showMaxWidth && generateMediaWrapper(props.showMaxWidth)`display: block;`}
+ }
+`;
+
+Overlay.defaultProps = {
+ zIndex: zIndex.overlayDefault,
+ backgroundColor: generateOverlayBlack(0.6),
+};
+
+Overlay.displayName = 'Overlay';