Skip to content

Commit

Permalink
Merge pull request #34 from TechnologyAdvice/feature/container-classe…
Browse files Browse the repository at this point in the history
…s-props

Classes & Props: Container/Grid/Row/Column
  • Loading branch information
levithomason committed Oct 8, 2015
2 parents 6f715b4 + 5396a18 commit 0649315
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 29 deletions.
10 changes: 4 additions & 6 deletions src/components/Container/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import classNames from 'classnames';
* </Container>
*/

class Container extends Component {
export default class Container extends Component {
static propTypes = {
children: PropTypes.node,
className: PropTypes.string,
Expand All @@ -21,16 +21,14 @@ class Container extends Component {
render() {
let classes = classNames(
'sd-container',
this.props.className,
'ui',
'container'
this.props.className,
'container',
);
return (
<div className={classes}>
<div {...this.props} className={classes}>
{this.props.children}
</div>
);
}
}

export default Container;
7 changes: 3 additions & 4 deletions src/components/Grid/Column.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import classNames from 'classnames';
import React, {Component, PropTypes} from 'react';
import numberToWord from 'src/utils/numberToWord';

class Column extends Component {
export default class Column extends Component {
static propTypes = {
children: PropTypes.node,
className: PropTypes.string,
Expand All @@ -13,15 +13,14 @@ class Column extends Component {
render() {
let classes = classNames(
'sd-column',
this.props.className,
this.props.width && numberToWord(this.props.width) + ' wide',
'column'
);
return (
<div className={classes} style={this.props.style}>
<div {...this.props} className={classes}>
{this.props.children}
</div>
);
}
}

export default Column;
15 changes: 3 additions & 12 deletions src/components/Grid/Grid.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
import classNames from 'classnames';
import React, {Component, PropTypes} from 'react';

class Grid extends Component {
export default class Grid extends Component {
static propTypes = {
children: PropTypes.node,
className: PropTypes.string,
divided: PropTypes.bool,
padded: PropTypes.bool,
stretched: PropTypes.bool,
style: PropTypes.object,
};

render() {
let classes = classNames(
'sd-grid',
this.props.className,
'ui',
{padded: this.props.padded},
{'equal width': this.props.stretched},
{divided: this.props.divided},
this.props.className,
'grid',
);
return (
<div className={classes} style={this.props.style}>
<div {...this.props} className={classes}>
{this.props.children}
</div>
);
}
}

export default Grid;
14 changes: 7 additions & 7 deletions src/components/Grid/Row.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import classNames from 'classnames';
import React, {Component, PropTypes} from 'react';

class Row extends Component {
export default class Row extends Component {
static propTypes = {
children: PropTypes.node,
className: PropTypes.string,
stretched: PropTypes.bool,
style: PropTypes.object,
};

render() {
let classes = classNames('sd-row', this.props.className, {stretched: this.props.stretched}, 'row');
let classes = classNames(
'sd-row',
this.props.className,
'row'
);
return (
<div className={classes} style={this.props.style}>
<div {...this.props} className={classes}>
{this.props.children}
</div>
);
}
}

export default Row;

0 comments on commit 0649315

Please sign in to comment.