apeman-react-button
Version:
apeman react package for button component.
69 lines (54 loc) • 1.38 kB
JSX
/**
* Big button component.
* @constructor ApBigButton
*/
;
import React, {PropTypes as types} from 'react';
import classnames from 'classnames';
import ApButton from './ap_button';
import {ApPureMixin} from 'apeman-react-mixins';
/** @lends ApBigButton */
let ApBigButton = React.createClass({
//--------------------
// Specs
//--------------------
propTypes: {
disabled: types.bool,
onTap: types.func,
text: types.string,
size: types.number
},
mixins: [
ApPureMixin
],
getInitialState() {
return {};
},
getDefaultProps() {
return {
disabled: false,
onTap: null,
text: null,
size: 94
}
},
render() {
let s = this;
let {props} = s,
{size} = props;
return (
<ApButton className={classnames('ap-big-button', props.className)}
wide={false}
style={Object.assign({
width:size, height:size
}, props.style)}
{...props}>
<span className="ap-big-button-text">
{props.text}
</span>
{props.children}
</ApButton>
);
}
});
module.exports = ApBigButton;