aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/ui/container.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-07 05:09:36 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-07 05:21:30 +0800
commit9669a4d1216b7d22107580daf3e2bff464eb2ade (patch)
treee408ae8281b8fc09ac253b7547027639e5f2943c /packages/website/ts/components/ui/container.tsx
parent7418926ebb156165f328a89cf58ec758737ee999 (diff)
downloaddexon-0x-contracts-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar
dexon-0x-contracts-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar.gz
dexon-0x-contracts-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar.bz2
dexon-0x-contracts-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar.lz
dexon-0x-contracts-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar.xz
dexon-0x-contracts-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar.zst
dexon-0x-contracts-9669a4d1216b7d22107580daf3e2bff464eb2ade.zip
Create Balance component and make token symbols smaller than token amounts
Diffstat (limited to 'packages/website/ts/components/ui/container.tsx')
-rw-r--r--packages/website/ts/components/ui/container.tsx14
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/website/ts/components/ui/container.tsx b/packages/website/ts/components/ui/container.tsx
index edbf8814b..427cc6cc7 100644
--- a/packages/website/ts/components/ui/container.tsx
+++ b/packages/website/ts/components/ui/container.tsx
@@ -2,6 +2,8 @@ import * as React from 'react';
type StringOrNum = string | number;
+export type ContainerTag = 'div' | 'span';
+
export interface ContainerProps {
marginTop?: StringOrNum;
marginBottom?: StringOrNum;
@@ -28,15 +30,21 @@ export interface ContainerProps {
right?: string;
bottom?: string;
zIndex?: number;
+ Tag?: ContainerTag;
}
-export const Container: React.StatelessComponent<ContainerProps> = ({ children, className, isHidden, ...style }) => {
+export const Container: React.StatelessComponent<ContainerProps> = props => {
+ const { children, className, Tag, isHidden, ...style } = props;
const visibility = isHidden ? 'hidden' : undefined;
return (
- <div style={{ ...style, visibility }} className={className}>
+ <Tag style={{ ...style, visibility }} className={className}>
{children}
- </div>
+ </Tag>
);
};
+Container.defaultProps = {
+ Tag: 'div',
+};
+
Container.displayName = 'Container';