UNPKG

apeman-react-list

Version:
59 lines (46 loc) 1.06 kB
/** * List item arrow icon component. * @class ApListItemArrowIcon */ 'use strict' import React, {PropTypes as types} from 'react' import classnames from 'classnames' import ApListItemIcon from './ap_list_item_icon' import {ApPureMixin} from 'apeman-react-mixin-pure' /** @lends ApListItemArrowIcon */ const ApListItemArrowIcon = React.createClass({ // -------------------- // Specs // -------------------- propTypes: { direction: types.oneOf([ 'up', 'down', 'right', 'left' ]) }, mixins: [ ApPureMixin ], statics: {}, getInitialState () { return {} }, getDefaultProps () { return { direction: 'right' } }, render () { const s = this let { props } = s let className = classnames('ap-list-item-arrow-icon', `fa fa-angle-${props.direction}`, props.className) return ( <ApListItemIcon className={ className } style={ Object.assign({}, props.style) }> </ApListItemIcon> ) } }) export default ApListItemArrowIcon