UNPKG

apeman-react-button

Version:
61 lines (46 loc) 1.18 kB
/** * Cell button component. * @constructor ApCellButton */ "use strict"; 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">&nbsp;</span> <span className="ap-cell-button-text">{props.text}</span> </ApButton> ); } }); module.exports = ApCellButton;