UNPKG

apeman-react-list

Version:
56 lines (46 loc) 1.02 kB
/** * @class ApListMoreButton */ 'use strict' import React, {PropTypes as types} from 'react' import classnames from 'classnames' import {ApPureMixin} from 'apeman-react-mixin-pure' import {ApTouchMixin} from 'apeman-react-mixin-touch' const ApListMoreButton = React.createClass({ // -------------------- // Specs // -------------------- propTypes: { text: types.string, enabled: types.bool }, mixins: [ ApTouchMixin, ApPureMixin ], statics: {}, getInitialState () { return {} }, getDefaultProps () { return { text: 'Load More', enabled: false } }, render () { const s = this let { state, props } = s let className = classnames('ap-list-more-button', { 'ap-list-more-button-enabled': props.enabled }, props.className) return ( <a className={ className } style={ Object.assign({}, props.style) }> { props.text } { props.children } </a> ) } }) export default ApListMoreButton