UNPKG

792 BJSXView Raw
1/**
2 * Icon for font awesome.
3 * @class ApFaIcon
4 */
5
6'use strict'
7
8import React, {PropTypes as types} from 'react'
9import classnames from 'classnames'
10
11import ApIcon from './ap_icon'
12
13/** @lends ApFaIcon */
14const ApFaIcon = React.createClass({
15
16 // --------------------
17 // Specs
18 // --------------------
19
20 propTypes: {
21 type: types.string.isRequired
22 },
23
24 mixins: [],
25
26 statics: {},
27
28 getInitialState () {
29 return {}
30 },
31
32 getDefaultProps () {
33 return {
34 type: null
35 }
36 },
37
38 render () {
39 const s = this
40 let { props } = s
41 return (
42 <ApIcon className={ classnames('ap-fa-icon', 'fa', props.className,
43 `fa-${props.type}`) }
44 style={ Object.assign({}, props.style) }>
45 </ApIcon>
46 )
47 }
48
49})
50
51export default ApFaIcon