diff options
author | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
---|---|---|
committer | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
commit | 7ae38906926dc09bc10670c361af0d2bf0050426 (patch) | |
tree | 5fb10ae366b987db09e4ddb4bc3ba0f75404ad08 /packages/react-docs/src/components/property_block.tsx | |
parent | b5fd3c72a08aaa6957917d74c333387a16edf66b (diff) | |
download | dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.gz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.bz2 dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.lz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.xz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.zst dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.zip |
Update dependency packages
Diffstat (limited to 'packages/react-docs/src/components/property_block.tsx')
-rw-r--r-- | packages/react-docs/src/components/property_block.tsx | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/packages/react-docs/src/components/property_block.tsx b/packages/react-docs/src/components/property_block.tsx deleted file mode 100644 index d0bd84802..000000000 --- a/packages/react-docs/src/components/property_block.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import { AnchorTitle, HeaderSizes } from '@0x/react-shared'; -import { Property, TypeDefinitionByName } from '@0x/types'; -import * as React from 'react'; - -import { DocsInfo } from '../docs_info'; -import { constants } from '../utils/constants'; - -import { Comment } from './comment'; -import { SourceLink } from './source_link'; -import { Type } from './type'; - -export interface PropertyBlockProps { - property: Property; - sectionName: string; - docsInfo: DocsInfo; - sourceUrl: string; - selectedVersion: string; - typeDefinitionByName: TypeDefinitionByName; -} - -export interface PropertyBlockState { - shouldShowAnchor: boolean; -} - -export class PropertyBlock extends React.Component<PropertyBlockProps, PropertyBlockState> { - constructor(props: PropertyBlockProps) { - super(props); - this.state = { - shouldShowAnchor: false, - }; - } - public render(): React.ReactNode { - const property = this.props.property; - const sectionName = this.props.sectionName; - return ( - <div - id={`${this.props.sectionName}-${property.name}`} - className="pb4 pt2" - key={`property-${property.name}-${property.type.name}`} - onMouseOver={this._setAnchorVisibility.bind(this, true)} - onMouseOut={this._setAnchorVisibility.bind(this, false)} - > - <div className="pb2" style={{ lineHeight: 1.3 }}> - <AnchorTitle - headerSize={HeaderSizes.H3} - title={property.name} - id={`${sectionName}-${property.name}`} - shouldShowAnchor={this.state.shouldShowAnchor} - /> - </div> - <code className={`hljs ${constants.TYPE_TO_SYNTAX[this.props.docsInfo.type]}`}> - {(property as any).callPath} - {property.name}:{' '} - <Type - type={property.type} - sectionName={sectionName} - docsInfo={this.props.docsInfo} - typeDefinitionByName={this.props.typeDefinitionByName} - isInPopover={false} - /> - </code> - {property.source && ( - <SourceLink - version={this.props.selectedVersion} - source={property.source} - sourceUrl={this.props.sourceUrl} - /> - )} - {property.comment && <Comment comment={property.comment} className="py2" />} - </div> - ); - } - private _setAnchorVisibility(shouldShowAnchor: boolean): void { - this.setState({ - shouldShowAnchor, - }); - } -} |