1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', {
|
4 | value: true
|
5 | });
|
6 |
|
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
8 |
|
9 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10 |
|
11 | var _react = require('react');
|
12 |
|
13 | var _react2 = _interopRequireDefault(_react);
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | exports['default'] = _react2['default'].createClass({
|
34 |
|
35 | displayName: 'FontAwesome',
|
36 |
|
37 | propTypes: {
|
38 | border: _react2['default'].PropTypes.bool,
|
39 | className: _react2['default'].PropTypes.string,
|
40 | fixedWidth: _react2['default'].PropTypes.bool,
|
41 | flip: _react2['default'].PropTypes.oneOf(['horizontal', 'vertical']),
|
42 | inverse: _react2['default'].PropTypes.bool,
|
43 | name: _react2['default'].PropTypes.string.isRequired,
|
44 | pulse: _react2['default'].PropTypes.bool,
|
45 | rotate: _react2['default'].PropTypes.oneOf([90, 180, 270]),
|
46 | size: _react2['default'].PropTypes.oneOf(['lg', '2x', '3x', '4x', '5x']),
|
47 | spin: _react2['default'].PropTypes.bool,
|
48 | stack: _react2['default'].PropTypes.oneOf(['1x', '2x'])
|
49 | },
|
50 |
|
51 | render: function render() {
|
52 | var className = 'fa fa-' + this.props.name;
|
53 |
|
54 | if (this.props.size) {
|
55 | className += ' fa-' + this.props.size;
|
56 | }
|
57 |
|
58 | if (this.props.spin) {
|
59 | className += ' fa-spin';
|
60 | }
|
61 |
|
62 | if (this.props.pulse) {
|
63 | className += ' fa-pulse';
|
64 | }
|
65 |
|
66 | if (this.props.border) {
|
67 | className += ' fa-border';
|
68 | }
|
69 |
|
70 | if (this.props.fixedWidth) {
|
71 | className += ' fa-fw';
|
72 | }
|
73 |
|
74 | if (this.props.inverse) {
|
75 | className += ' fa-inverse';
|
76 | }
|
77 |
|
78 | if (this.props.flip) {
|
79 | className += ' fa-flip-' + this.props.flip;
|
80 | }
|
81 |
|
82 | if (this.props.rotate) {
|
83 | className += ' fa-rotate-' + this.props.rotate;
|
84 | }
|
85 |
|
86 | if (this.props.stack) {
|
87 | className += ' fa-stack-' + this.props.stack;
|
88 | }
|
89 |
|
90 | if (this.props.className) {
|
91 | className += ' ' + this.props.className;
|
92 | }
|
93 |
|
94 | return _react2['default'].createElement('span', _extends({}, this.props, {
|
95 | className: className
|
96 | }));
|
97 | }
|
98 | });
|
99 | module.exports = exports['default'];
|