-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from TechnologyAdvice/feature/container-classe…
…s-props Classes & Props: Container/Grid/Row/Column
- Loading branch information
Showing
4 changed files
with
17 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |