Skip to content

Commit

Permalink
[Docs] Clean up the Table docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jan 9, 2016
1 parent b9b03b7 commit 2e1885e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 38 deletions.
2 changes: 1 addition & 1 deletion docs/src/app/components/CodeExample/CodeBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
48 changes: 19 additions & 29 deletions docs/src/app/components/pages/components/Table/ExampleSimple.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 (
<div>
<Table
Expand Down Expand Up @@ -125,56 +124,47 @@ export default class TableExampleSimple extends React.Component {
<TextField
floatingLabelText="Table Body Height"
defaultValue={this.state.height}
onChange={this._onChange} />

onChange={this.handleChange} />
<Toggle
name="fixedHeader"
label="Fixed Header"
onToggle={this._handleToggle}
onToggle={this.handleToggle}
defaultToggled={this.state.fixedHeader} />

<Toggle
name="fixedFooter"
label="Fixed Footer"
onToggle={this._handleToggle}
onToggle={this.handleToggle}
defaultToggled={this.state.fixedFooter} />

<Toggle
name="stripedRows"
label="Stripe Rows"
onToggle={this._handleToggle}
onToggle={this.handleToggle}
defaultToggled={this.state.stripedRows} />

<Toggle
name="showRowHover"
label="Show Row Hover"
onToggle={this._handleToggle}
onToggle={this.handleToggle}
defaultToggled={this.state.showRowHover} />

<Toggle
name="selectable"
label="Selectable"
onToggle={this._handleToggle}
onToggle={this.handleToggle}
defaultToggled={this.state.selectable} />

<Toggle
name="multiSelectable"
label="Multi-Selectable"
onToggle={this._handleToggle}
onToggle={this.handleToggle}
defaultToggled={this.state.multiSelectable} />

<Toggle
name="enableSelectAll"
label="Enable Select All"
onToggle={this._handleToggle}
onToggle={this.handleToggle}
defaultToggled={this.state.enableSelectAll} />

<Toggle
name="deselectOnClickaway"
label="Deselect On Clickaway"
onToggle={this._handleToggle}
onToggle={this.handleToggle}
defaultToggled={this.state.deselectOnClickaway} />

</div>
</div>
);
Expand Down
12 changes: 6 additions & 6 deletions docs/src/app/components/pages/components/Table/Page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ const TablePage = () => (
<TableExampleSimple />
</CodeExample>
<PropTypeDescription code={tableCode} header="### Table Properties"/>
<PropTypeDescription code={tableBodyCode} header="### Table Body Properties"/>
<PropTypeDescription code={tableFooterCode} header="### Table Footer Properties"/>
<PropTypeDescription code={tableHeaderColumnCode} header="### Table Header Column Properties"/>
<PropTypeDescription code={tableHeaderCode} header="### Table Header Properties"/>
<PropTypeDescription code={tableRowColumnCode} header="### Table Row Column Properties"/>
<PropTypeDescription code={tableRowCode} header="### Table Row Properties"/>
<PropTypeDescription code={tableBodyCode} header="### TableBody Properties"/>
<PropTypeDescription code={tableFooterCode} header="### TableFooter Properties"/>
<PropTypeDescription code={tableHeaderColumnCode} header="### TableHeaderColumn Properties"/>
<PropTypeDescription code={tableHeaderCode} header="### TableHeader Properties"/>
<PropTypeDescription code={tableRowColumnCode} header="### TableRowColumn Properties"/>
<PropTypeDescription code={tableRowCode} header="### TableRow Properties"/>
</div>
);

Expand Down
3 changes: 2 additions & 1 deletion docs/src/app/components/pages/components/Table/README.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion src/table/table-header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ const TableHeader = React.createClass({
if (!React.isValidElement(child)) continue;

let props = {
displayRowCheckbox: false,
key: 'sh' + index,
rowNumber: index,
};
Expand Down

0 comments on commit 2e1885e

Please sign in to comment.