aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-shared
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-16 23:43:43 +0800
committerFabio Berger <me@fabioberger.com>2018-10-16 23:43:43 +0800
commit55a3bc8cb6772802672f60f22c5ed5c7e1b2dfdd (patch)
treedeeb3a2f4bd0ae5b29098a2b7948ea9dfda4df9a /packages/react-shared
parente6e883e05a6e9518bb769db555f0c3e3324d24d3 (diff)
downloaddexon-0x-contracts-55a3bc8cb6772802672f60f22c5ed5c7e1b2dfdd.tar
dexon-0x-contracts-55a3bc8cb6772802672f60f22c5ed5c7e1b2dfdd.tar.gz
dexon-0x-contracts-55a3bc8cb6772802672f60f22c5ed5c7e1b2dfdd.tar.bz2
dexon-0x-contracts-55a3bc8cb6772802672f60f22c5ed5c7e1b2dfdd.tar.lz
dexon-0x-contracts-55a3bc8cb6772802672f60f22c5ed5c7e1b2dfdd.tar.xz
dexon-0x-contracts-55a3bc8cb6772802672f60f22c5ed5c7e1b2dfdd.tar.zst
dexon-0x-contracts-55a3bc8cb6772802672f60f22c5ed5c7e1b2dfdd.zip
chore: don't use Container in react-shared, react-docs yet
Diffstat (limited to 'packages/react-shared')
-rw-r--r--packages/react-shared/src/components/container.tsx55
-rw-r--r--packages/react-shared/src/components/markdown_section.tsx14
-rw-r--r--packages/react-shared/src/index.ts1
-rw-r--r--packages/react-shared/tsconfig.json1
4 files changed, 10 insertions, 61 deletions
diff --git a/packages/react-shared/src/components/container.tsx b/packages/react-shared/src/components/container.tsx
deleted file mode 100644
index f2ae68b70..000000000
--- a/packages/react-shared/src/components/container.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-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';
diff --git a/packages/react-shared/src/components/markdown_section.tsx b/packages/react-shared/src/components/markdown_section.tsx
index d5de324c3..e6a7d80d5 100644
--- a/packages/react-shared/src/components/markdown_section.tsx
+++ b/packages/react-shared/src/components/markdown_section.tsx
@@ -8,7 +8,6 @@ import { colors } from '../utils/colors';
import { utils } from '../utils/utils';
import { AnchorTitle } from './anchor_title';
-import { Container } from './container';
import { Link } from './link';
import { MarkdownCodeBlock } from './markdown_code_block';
import { MarkdownLinkBlock } from './markdown_link_block';
@@ -57,7 +56,7 @@ export class MarkdownSection extends React.Component<MarkdownSectionProps, Markd
onMouseOut={this._setAnchorVisibility.bind(this, false)}
>
<ScrollElement name={id} style={{ paddingBottom: 20 }}>
- <Container className="clearfix" paddingTop="30px" paddingBottom="20px">
+ <div className="clearfix" style={{ paddingTop: 30, paddingBottom: 20 }}>
<div className="col lg-col-8 md-col-8 sm-col-12">
<span style={{ color: colors.grey700 }}>
<AnchorTitle
@@ -77,7 +76,7 @@ export class MarkdownSection extends React.Component<MarkdownSectionProps, Markd
</div>
)}
</div>
- </Container>
+ </div>
<ReactMarkdown
source={markdownContent}
escapeHtml={false}
@@ -87,7 +86,14 @@ export class MarkdownSection extends React.Component<MarkdownSectionProps, Markd
paragraph: MarkdownParagraphBlock,
}}
/>
- <Container width={'100%'} height={'1px'} backgroundColor={colors.grey300} marginTop={'32px'} />
+ <div
+ style={{
+ width: '100%',
+ height: 1,
+ backgroundColor: colors.grey300,
+ marginTop: 32,
+ }}
+ />
</ScrollElement>
</div>
);
diff --git a/packages/react-shared/src/index.ts b/packages/react-shared/src/index.ts
index 2ab9b393e..e33b09f19 100644
--- a/packages/react-shared/src/index.ts
+++ b/packages/react-shared/src/index.ts
@@ -5,7 +5,6 @@ export { MarkdownSection } from './components/markdown_section';
export { NestedSidebarMenu } from './components/nested_sidebar_menu';
export { SectionHeader } from './components/section_header';
export { Link } from './components/link';
-export { Container } from './components/container';
export { HeaderSizes, Styles, EtherscanLinkSuffixes, Networks, ALink } from './types';
diff --git a/packages/react-shared/tsconfig.json b/packages/react-shared/tsconfig.json
index 9fd1b04cf..5abe0ab4e 100644
--- a/packages/react-shared/tsconfig.json
+++ b/packages/react-shared/tsconfig.json
@@ -4,7 +4,6 @@
"outDir": "lib",
"rootDir": "src",
"jsx": "react",
- "strictNullChecks": false,
"baseUrl": ".",
"paths": {
"*": ["node_modules/@types/*", "*"]