import { AnchorTitle, HeaderSizes } from '@0xproject/react-shared'; import { Property, TypeDefinitionByName } from '@0xproject/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 { constructor(props: PropertyBlockProps) { super(props); this.state = { shouldShowAnchor: false, }; } public render(): React.ReactNode { const property = this.props.property; const sectionName = this.props.sectionName; return (
{(property as any).callPath} {property.name}:{' '} {property.source && ( )} {property.comment && }
); } private _setAnchorVisibility(shouldShowAnchor: boolean): void { this.setState({ shouldShowAnchor, }); } }