import { AnchorTitle, HeaderSizes } from '@0xproject/react-shared'; import * as React from 'react'; import { DocsInfo } from '../docs_info'; import { Property } from '../types'; import { constants } from '../utils/constants'; import { Comment } from './comment'; import { Type } from './type'; import { SourceLink } from './source_link'; export interface PropertyBlockProps { property: Property; sectionName: string; docsInfo: DocsInfo; sourceUrl: string; selectedVersion: string; } 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.name}:{' '} {property.source && ( )} {property.comment && }
); } private _setAnchorVisibility(shouldShowAnchor: boolean): void { this.setState({ shouldShowAnchor, }); } }