From 2e1885e6f31f5b73278790ddbd3de3c49a988307 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sat, 9 Jan 2016 00:11:24 +0100 Subject: [PATCH] [Docs] Clean up the Table docs --- .../app/components/CodeExample/CodeBlock.jsx | 2 +- .../pages/components/Table/ExampleSimple.jsx | 48 ++++++++----------- .../pages/components/Table/Page.jsx | 12 ++--- .../pages/components/Table/README.md | 3 +- src/table/table-header.jsx | 1 - 5 files changed, 28 insertions(+), 38 deletions(-) diff --git a/docs/src/app/components/CodeExample/CodeBlock.jsx b/docs/src/app/components/CodeExample/CodeBlock.jsx index 769d3844e272d2..aba628c4afd7af 100644 --- a/docs/src/app/components/CodeExample/CodeBlock.jsx +++ b/docs/src/app/components/CodeExample/CodeBlock.jsx @@ -5,7 +5,7 @@ import StylePropable from 'material-ui/lib/mixins/style-propable'; import FlatButton from 'material-ui/lib/flat-button'; import Transitions from 'material-ui/lib/styles/transitions'; -const LINE_MAX = 17; +const LINE_MAX = 7; const styles = { root: { diff --git a/docs/src/app/components/pages/components/Table/ExampleSimple.jsx b/docs/src/app/components/pages/components/Table/ExampleSimple.jsx index aae84658204c1c..dba81aaa85d44a 100644 --- a/docs/src/app/components/pages/components/Table/ExampleSimple.jsx +++ b/docs/src/app/components/pages/components/Table/ExampleSimple.jsx @@ -20,16 +20,6 @@ export default class TableExampleSimple extends React.Component { constructor(props) { super(props); - this._handleToggle = (event, toggled) => { - let state = {}; - state[event.target.name] = toggled; - this.setState(state); - }; - - this._onChange = (event) => { - this.setState({height: event.target.value}); - }; - this.state = { fixedHeader: true, fixedFooter: true, @@ -43,8 +33,17 @@ export default class TableExampleSimple extends React.Component { }; } - render() { + handleToggle = (event, toggled) => { + this.setState({ + [event.target.name]: toggled, + }); + }; + + handleChange = (event) => { + this.setState({height: event.target.value}); + }; + render() { return (
- + onChange={this.handleChange} /> - - - - - - - - ); diff --git a/docs/src/app/components/pages/components/Table/Page.jsx b/docs/src/app/components/pages/components/Table/Page.jsx index 7f27d778b2f3f5..157255d5e976d8 100644 --- a/docs/src/app/components/pages/components/Table/Page.jsx +++ b/docs/src/app/components/pages/components/Table/Page.jsx @@ -21,12 +21,12 @@ const TablePage = () => ( - - - - - - + + + + + + ); diff --git a/docs/src/app/components/pages/components/Table/README.md b/docs/src/app/components/pages/components/Table/README.md index 14df6ce310d518..9076a782c79d8b 100644 --- a/docs/src/app/components/pages/components/Table/README.md +++ b/docs/src/app/components/pages/components/Table/README.md @@ -1,5 +1,6 @@ ## Table -[Tables](https://www.google.com/design/spec/components/data-tables.html#) + +[Tables](https://www.google.com/design/spec/components/data-tables.html) are used to display data and to organize it. ### Examples diff --git a/src/table/table-header.jsx b/src/table/table-header.jsx index f75d51c9bd4042..88f7208631a075 100644 --- a/src/table/table-header.jsx +++ b/src/table/table-header.jsx @@ -123,7 +123,6 @@ const TableHeader = React.createClass({ if (!React.isValidElement(child)) continue; let props = { - displayRowCheckbox: false, key: 'sh' + index, rowNumber: index, };