aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/pages/shared/markdown_section.tsx
diff options
context:
space:
mode:
authorTom Schmidt <imtomhschmidt@gmail.com>2018-03-10 07:22:59 +0800
committerGitHub <noreply@github.com>2018-03-10 07:22:59 +0800
commit47af38ecb8d59789af9db2079e18ee0b6e589786 (patch)
treeabd75e02d19d7c2e9c7b8df1ebe7152e2d364a40 /packages/website/ts/pages/shared/markdown_section.tsx
parent654c790c3df3ee857952a1023761f186bb9c777d (diff)
parent7116f100ee194f46d0e34782afa8f680791adc9c (diff)
downloaddexon-0x-contracts-47af38ecb8d59789af9db2079e18ee0b6e589786.tar
dexon-0x-contracts-47af38ecb8d59789af9db2079e18ee0b6e589786.tar.gz
dexon-0x-contracts-47af38ecb8d59789af9db2079e18ee0b6e589786.tar.bz2
dexon-0x-contracts-47af38ecb8d59789af9db2079e18ee0b6e589786.tar.lz
dexon-0x-contracts-47af38ecb8d59789af9db2079e18ee0b6e589786.tar.xz
dexon-0x-contracts-47af38ecb8d59789af9db2079e18ee0b6e589786.tar.zst
dexon-0x-contracts-47af38ecb8d59789af9db2079e18ee0b6e589786.zip
Merge branch 'development' into feature/website/web3-logging
Diffstat (limited to 'packages/website/ts/pages/shared/markdown_section.tsx')
-rw-r--r--packages/website/ts/pages/shared/markdown_section.tsx85
1 files changed, 0 insertions, 85 deletions
diff --git a/packages/website/ts/pages/shared/markdown_section.tsx b/packages/website/ts/pages/shared/markdown_section.tsx
deleted file mode 100644
index 7253072d9..000000000
--- a/packages/website/ts/pages/shared/markdown_section.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import * as _ from 'lodash';
-import RaisedButton from 'material-ui/RaisedButton';
-import * as React from 'react';
-import * as ReactMarkdown from 'react-markdown';
-import { Element as ScrollElement } from 'react-scroll';
-import { AnchorTitle } from 'ts/pages/shared/anchor_title';
-import { MarkdownCodeBlock } from 'ts/pages/shared/markdown_code_block';
-import { MarkdownLinkBlock } from 'ts/pages/shared/markdown_link_block';
-import { HeaderSizes } from 'ts/types';
-import { colors } from 'ts/utils/colors';
-import { utils } from 'ts/utils/utils';
-
-interface MarkdownSectionProps {
- sectionName: string;
- markdownContent: string;
- headerSize?: HeaderSizes;
- githubLink?: string;
-}
-
-interface MarkdownSectionState {
- shouldShowAnchor: boolean;
-}
-
-export class MarkdownSection extends React.Component<MarkdownSectionProps, MarkdownSectionState> {
- public static defaultProps: Partial<MarkdownSectionProps> = {
- headerSize: HeaderSizes.H3,
- };
- constructor(props: MarkdownSectionProps) {
- super(props);
- this.state = {
- shouldShowAnchor: false,
- };
- }
- public render() {
- const sectionName = this.props.sectionName;
- const id = utils.getIdFromName(sectionName);
- return (
- <div
- className="md-px1 sm-px2 overflow-hidden"
- onMouseOver={this._setAnchorVisibility.bind(this, true)}
- onMouseOut={this._setAnchorVisibility.bind(this, false)}
- >
- <ScrollElement name={id}>
- <div className="clearfix pt3">
- <div className="col lg-col-8 md-col-8 sm-col-12">
- <span style={{ textTransform: 'capitalize', color: colors.grey700 }}>
- <AnchorTitle
- headerSize={this.props.headerSize}
- title={sectionName}
- id={id}
- shouldShowAnchor={this.state.shouldShowAnchor}
- />
- </span>
- </div>
- <div className="col col-4 sm-hide xs-hide right-align pr3" style={{ height: 28 }}>
- {!_.isUndefined(this.props.githubLink) && (
- <a
- href={this.props.githubLink}
- target="_blank"
- style={{ color: colors.linkBlue, textDecoration: 'none', lineHeight: 2.1 }}
- >
- Edit on Github
- </a>
- )}
- </div>
- </div>
- <hr style={{ border: `1px solid ${colors.lightestGrey}` }} />
- <ReactMarkdown
- source={this.props.markdownContent}
- escapeHtml={false}
- renderers={{
- code: MarkdownCodeBlock,
- link: MarkdownLinkBlock,
- }}
- />
- </ScrollElement>
- </div>
- );
- }
- private _setAnchorVisibility(shouldShowAnchor: boolean) {
- this.setState({
- shouldShowAnchor,
- });
- }
-}