import React from 'react';
import ReactDOM from 'react-dom';
import { Button } from 'react-toolbox';
import Appbar from '../../../components/appbar';
import Markdown from '../../../components/markdown';
import Playground from './components/playground';
import MainNavigation from './components/navigation';
import BaseDocs from './modules/components.md';
import components from './modules/components.js';
import style from './style';
const LoadExampleButton = (props) => {
return (
);
};
class Main extends React.Component {
LOAD_EXAMPLE_CLASS = 'js-load-in-playground playground-button';
state = {
playground: false
};
componentDidMount () {
this.renderExampleLoaders();
}
componentDidUpdate () {
this.renderExampleLoaders();
}
handlePlayGroundClick = () => {
this.setState({ playground: !this.state.playground});
};
handlePlaygroundLoad = (code) => {
this.refs.playground.loadCode(code);
this.setState({playground: true});
};
renderExampleLoaders () {
const examples = document.getElementsByClassName(this.LOAD_EXAMPLE_CLASS);
Array.prototype.forEach.call(examples, (exampleNode, idx) => {
const exampleCode = components[this.props.params.component].examples[idx];
ReactDOM.render(