-
{ jumper }
import React from 'react';
import classNames from 'classnames';
import { Row, Col, Icon } from '../../../';
import Demo from '../Demo';
import * as utils from '../utils';
import demosList from '../../../_site/data/demos-list';
export default class ComponentDoc extends React.Component {
constructor(props) {
super(props);
this.state = {
expandAll: false,
};
}
handleExpandToggle() {
this.setState({
expandAll: !this.state.expandAll,
});
}
render() {
const { doc } = this.props;
const { description, meta } = doc;
const demos = demosList[meta.fileName] || [];
const expand = this.state.expandAll;
const parentId = meta.fileName.split('/').slice(0, 2).join('-');
const isSingleCol = meta.cols === '1';
const leftChildren = [];
const rightChildren = [];
demos.sort((a, b) => {
return a.order - b.order;
}).forEach((demoData, index) => {
if (index % 2 === 0 || isSingleCol) {
leftChildren.push(