import * as _ from 'lodash'; import * as PropTypes from 'prop-types'; import * as React from 'react'; import { Header, Segment, Divider, ICSSInJSStyle } from '@fluentui/react-northstar'; import DocumentTitle from 'react-document-title'; import ComponentExampleTitle from './ComponentDoc/ComponentExample/ComponentExampleTitle'; import BehaviorDescription from './ComponentDoc/BehaviorDescription'; const behaviorMenuItems = require('../behaviorMenu'); class DocsBehaviorRoot extends React.Component { static propTypes = { children: PropTypes.node, match: PropTypes.shape({ params: PropTypes.shape({ name: PropTypes.string.isRequired, }), }), }; baseName(fileName: string) { const divided = _.startCase(fileName.replace(/Behavior\.ts$/, '')); return _.upperFirst(_.lowerCase(divided)); } render() { const exampleStyle: ICSSInJSStyle = { boxShadow: '0 1px 2px rgba(0, 0, 0, 0.2)', }; const { match } = this.props; const componentName = _.upperFirst(_.camelCase(match.params.name)); const pageTitle = `${componentName} accessibility behaviors`; return (
{behaviorMenuItems .find(behavior => behavior.displayName === componentName) .variations.map((variation, keyValue) => (
{variation.description && ( <> Description:
)} {variation.specification && ( <> {variation.description &&
} Specification:
)}

))} ); } } export default DocsBehaviorRoot;