-
{ jumper }
import React from 'react';
import { Link } from 'react-router';
import classNames from 'classnames';
import { Row, Col, Icon, Affix } from '../../../';
import Demo from '../Demo';
import * as utils from '../utils';
import demosList from '../../../_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, location } = this.props;
const { description, meta } = doc;
const demos = demosList[meta.fileName] || [];
const expand = this.state.expandAll;
const isSingleCol = meta.cols === '1';
const leftChildren = [];
const rightChildren = [];
demos.sort((a, b) => {
return parseInt(a.meta.order, 10) - parseInt(b.meta.order, 10);
}).forEach((demoData, index) => {
if (index % 2 === 0 || isSingleCol) {
leftChildren.push(