aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-tools-pages/ts/components/ui/container.tsx
diff options
context:
space:
mode:
authorRemco Bloemen <remco@wicked.ventures>2018-11-09 01:32:40 +0800
committerRemco Bloemen <remco@wicked.ventures>2018-11-09 01:32:40 +0800
commitd71362af993d3797dbdbfcac245ad57f0086bce3 (patch)
tree888826fe23c2d06d6c9191fb3a238e14f9fe4aac /packages/dev-tools-pages/ts/components/ui/container.tsx
parenta5665a68756c905637c551fc48c9b7011a55c237 (diff)
parentf6abc007ffb249e4bbf85b8a7a77309d43e0a147 (diff)
downloaddexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar
dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar.gz
dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar.bz2
dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar.lz
dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar.xz
dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar.zst
dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.zip
Merge remote-tracking branch 'origin/development' into feature/utils/prettybignum
Diffstat (limited to 'packages/dev-tools-pages/ts/components/ui/container.tsx')
-rw-r--r--packages/dev-tools-pages/ts/components/ui/container.tsx55
1 files changed, 55 insertions, 0 deletions
diff --git a/packages/dev-tools-pages/ts/components/ui/container.tsx b/packages/dev-tools-pages/ts/components/ui/container.tsx
new file mode 100644
index 000000000..f2ae68b70
--- /dev/null
+++ b/packages/dev-tools-pages/ts/components/ui/container.tsx
@@ -0,0 +1,55 @@
+import * as React from 'react';
+
+type StringOrNum = string | number;
+
+export type ContainerTag = 'div' | 'span';
+
+export interface ContainerProps {
+ marginTop?: StringOrNum;
+ marginBottom?: StringOrNum;
+ marginRight?: StringOrNum;
+ marginLeft?: StringOrNum;
+ padding?: StringOrNum;
+ paddingTop?: StringOrNum;
+ paddingBottom?: StringOrNum;
+ paddingRight?: StringOrNum;
+ paddingLeft?: StringOrNum;
+ backgroundColor?: string;
+ borderRadius?: StringOrNum;
+ maxWidth?: StringOrNum;
+ maxHeight?: StringOrNum;
+ width?: StringOrNum;
+ height?: StringOrNum;
+ minWidth?: StringOrNum;
+ minHeight?: StringOrNum;
+ isHidden?: boolean;
+ className?: string;
+ position?: 'absolute' | 'fixed' | 'relative' | 'unset';
+ display?: 'inline-block' | 'block' | 'inline-flex' | 'inline';
+ top?: string;
+ left?: string;
+ right?: string;
+ bottom?: string;
+ zIndex?: number;
+ Tag?: ContainerTag;
+ cursor?: string;
+ id?: string;
+ onClick?: (event: React.MouseEvent<HTMLElement>) => void;
+ overflowX?: 'scroll' | 'hidden' | 'auto' | 'visible';
+}
+
+export const Container: React.StatelessComponent<ContainerProps> = props => {
+ const { children, className, Tag, isHidden, id, onClick, ...style } = props;
+ const visibility = isHidden ? 'hidden' : undefined;
+ return (
+ <Tag id={id} style={{ ...style, visibility }} className={className} onClick={onClick}>
+ {children}
+ </Tag>
+ );
+};
+
+Container.defaultProps = {
+ Tag: 'div',
+};
+
+Container.displayName = 'Container';