apeman-react-button
Version:
apeman react package for button component.
61 lines (46 loc) • 1.18 kB
JSX
/**
* Cell button component.
* @constructor ApCellButton
*/
;
import React, {PropTypes as types} from 'react';
import classnames from 'classnames';
import ApButton from './ap_button';
import {ApPureMixin} from 'apeman-react-mixins';
/** @lends ApCellButton */
let ApCellButton = React.createClass({
//--------------------
// Specs
//--------------------
propTypes: {
disabled: types.bool,
onTap: types.func,
text: types.string
},
mixins: [
ApPureMixin
],
getInitialState() {
return {};
},
getDefaultProps() {
return {
disabled: false,
onTap: null,
text: null
}
},
render() {
let s = this;
let props = s.props;
return (
<ApButton className={classnames('ap-cell-button', props.className)}
wide={false}
{...props}>
<span className="ap-cell-button-aligner"> </span>
<span className="ap-cell-button-text">{props.text}</span>
</ApButton>
);
}
});
module.exports = ApCellButton;