diff --git a/.eslintignore b/.eslintignore index 2db218e1..f01dc4e7 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ scripts/* bower_components/* generator-bulbs-elements +examples/* diff --git a/examples/component.js b/examples/component.js index fec9a925..9746488e 100644 --- a/examples/component.js +++ b/examples/component.js @@ -1,24 +1,279 @@ -/* eslint react/no-unknown-property: "off" */ -/* eslint-disable react/prop-types, react/no-danger */ - import React from 'react'; +import { browserHistory } from 'react-router'; import examples from './element-examples'; -class Component extends React.Component { +const DEVICES = { + desktop: { + width: '1000px', + }, + tablet: { + width: '600px', + }, + mobile: { + width: '320px', + }, +}; + +function Checkerboard () { + let gridSize = 8; + let gridColor = '#fafafa'; + return ( + + + + + + + + + + ); +} + +class ExampleViewport extends React.Component { + constructor (props) { + super(props); + this.state = { + scale: 1, + workspace: 1, + }; + } + + setDevice (device) { + let segments = [ + 'example', + this.props.params.element, + this.props.params.example, + device, + ]; + + console.log('/' + segments.join('/'), {}); + browserHistory.push('/' + segments.join('/'), {}); + } + + setScale(event) { + this.setState({ + scale: event.target.value, + }); + } + + setWorkspace(event) { + this.setState({ + workspace: event.target.value, + }); + } + + render () { + return ( +
+
+ + + + + + + + + + +
+
+ +
+ { + this.props.params.device.split(',').map((device) => { + return ( +