UNPKG

react-zeanium-ui-ui

Version:

Zeanium UI Framework for React.js

38 lines (34 loc) 862 B
var React = require('react'); var Button = require('./Button'); module.exports = React.createClass({ displayName:'ButtonGroup', getDefaultProps: function () { return { className: '', float: '' } }, getInitialState: function(){ return { } }, componentDidMount: function(){ }, __onClick: function (props, event, btn){ this.props.onClick && this.props.onClick(props, event, btn); }, render:function(){ return ( <div className={"rt-button-group " + this.props.className + " float-" + this.props.float} style={this.props.style}> { this.props.items && this.props.items.map(function (item, index){ item.onClick = item.onClick || this.__onClick; item.float = item.float || this.props.float; return <Button key={item.text} {...item} />; }.bind(this)) } {this.props.children} </div> ); } });