1+ ( function ( global , factory ) {
2+ if ( typeof define === "function" && define . amd ) {
3+ define ( [ 'exports' , 'react' , 'prop-types' , './Wrap' , './stylized/FacebookStyle' , './stylized/InstagramStyle' , './stylized/CodeStyle' , './custom/Rect' , './custom/Circle' ] , factory ) ;
4+ } else if ( typeof exports !== "undefined" ) {
5+ factory ( exports , require ( 'react' ) , require ( 'prop-types' ) , require ( './Wrap' ) , require ( './stylized/FacebookStyle' ) , require ( './stylized/InstagramStyle' ) , require ( './stylized/CodeStyle' ) , require ( './custom/Rect' ) , require ( './custom/Circle' ) ) ;
6+ } else {
7+ var mod = {
8+ exports : { }
9+ } ;
10+ factory ( mod . exports , global . react , global . propTypes , global . Wrap , global . FacebookStyle , global . InstagramStyle , global . CodeStyle , global . Rect , global . Circle ) ;
11+ global . index = mod . exports ;
12+ }
13+ } ) ( this , function ( exports , _react , _propTypes , _Wrap , _FacebookStyle , _InstagramStyle , _CodeStyle , _Rect , _Circle ) {
14+ 'use strict' ;
15+
16+ Object . defineProperty ( exports , "__esModule" , {
17+ value : true
18+ } ) ;
19+ exports . Circle = exports . Rect = undefined ;
20+
21+ var _react2 = _interopRequireDefault ( _react ) ;
22+
23+ var _propTypes2 = _interopRequireDefault ( _propTypes ) ;
24+
25+ var _Wrap2 = _interopRequireDefault ( _Wrap ) ;
26+
27+ var _FacebookStyle2 = _interopRequireDefault ( _FacebookStyle ) ;
28+
29+ var _InstagramStyle2 = _interopRequireDefault ( _InstagramStyle ) ;
30+
31+ var _CodeStyle2 = _interopRequireDefault ( _CodeStyle ) ;
32+
33+ var _Rect2 = _interopRequireDefault ( _Rect ) ;
34+
35+ var _Circle2 = _interopRequireDefault ( _Circle ) ;
36+
37+ function _interopRequireDefault ( obj ) {
38+ return obj && obj . __esModule ? obj : {
39+ default : obj
40+ } ;
41+ }
42+
43+ function _classCallCheck ( instance , Constructor ) {
44+ if ( ! ( instance instanceof Constructor ) ) {
45+ throw new TypeError ( "Cannot call a class as a function" ) ;
46+ }
47+ }
48+
49+ var _createClass = function ( ) {
50+ function defineProperties ( target , props ) {
51+ for ( var i = 0 ; i < props . length ; i ++ ) {
52+ var descriptor = props [ i ] ;
53+ descriptor . enumerable = descriptor . enumerable || false ;
54+ descriptor . configurable = true ;
55+ if ( "value" in descriptor ) descriptor . writable = true ;
56+ Object . defineProperty ( target , descriptor . key , descriptor ) ;
57+ }
58+ }
59+
60+ return function ( Constructor , protoProps , staticProps ) {
61+ if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ;
62+ if ( staticProps ) defineProperties ( Constructor , staticProps ) ;
63+ return Constructor ;
64+ } ;
65+ } ( ) ;
66+
67+ function _possibleConstructorReturn ( self , call ) {
68+ if ( ! self ) {
69+ throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ;
70+ }
71+
72+ return call && ( typeof call === "object" || typeof call === "function" ) ? call : self ;
73+ }
74+
75+ function _inherits ( subClass , superClass ) {
76+ if ( typeof superClass !== "function" && superClass !== null ) {
77+ throw new TypeError ( "Super expression must either be null or a function, not " + typeof superClass ) ;
78+ }
79+
80+ subClass . prototype = Object . create ( superClass && superClass . prototype , {
81+ constructor : {
82+ value : subClass ,
83+ enumerable : false ,
84+ writable : true ,
85+ configurable : true
86+ }
87+ } ) ;
88+ if ( superClass ) Object . setPrototypeOf ? Object . setPrototypeOf ( subClass , superClass ) : subClass . __proto__ = superClass ;
89+ }
90+
91+ var ContentLoader = function ( _Component ) {
92+ _inherits ( ContentLoader , _Component ) ;
93+
94+ function ContentLoader ( props ) {
95+ _classCallCheck ( this , ContentLoader ) ;
96+
97+ var _this = _possibleConstructorReturn ( this , ( ContentLoader . __proto__ || Object . getPrototypeOf ( ContentLoader ) ) . call ( this , props ) ) ;
98+
99+ _this . state = {
100+ style : props . style ,
101+ type : props . type || 'facebook' ,
102+ speed : props . speed || 2 ,
103+ height : props . height || 130 ,
104+ width : props . width || 400 ,
105+ primaryColor : props . primaryColor || '#f0f0f0' ,
106+ secondaryColor : props . secondaryColor || '#e0e0e0'
107+ } ;
108+ return _this ;
109+ }
110+
111+ _createClass ( ContentLoader , [ {
112+ key : 'render' ,
113+ value : function render ( ) {
114+
115+ if ( this . props . children ) {
116+
117+ return _react2 . default . createElement (
118+ _Wrap2 . default ,
119+ this . state ,
120+ this . props . children
121+ ) ;
122+ }
123+
124+ if ( ! this . props . children ) {
125+
126+ switch ( this . state . type . toLowerCase ( ) ) {
127+
128+ case 'instagram' :
129+ return _react2 . default . createElement ( _InstagramStyle2 . default , this . state ) ;
130+ break ;
131+
132+ case 'code' :
133+ return _react2 . default . createElement ( _CodeStyle2 . default , this . state ) ;
134+ break ;
135+
136+ default :
137+ case 'facebook' :
138+ return _react2 . default . createElement ( _FacebookStyle2 . default , this . state ) ;
139+ break ;
140+
141+ }
142+ }
143+ }
144+ } ] ) ;
145+
146+ return ContentLoader ;
147+ } ( _react . Component ) ;
148+
149+ ContentLoader . propTypes = {
150+ style : _propTypes2 . default . object ,
151+ type : _propTypes2 . default . string ,
152+ speed : _propTypes2 . default . number ,
153+ height : _propTypes2 . default . number ,
154+ primaryColor : _propTypes2 . default . string ,
155+ secondaryColor : _propTypes2 . default . string
156+ } ;
157+
158+ exports . default = ContentLoader ;
159+ exports . Rect = _Rect2 . default ;
160+ exports . Circle = _Circle2 . default ;
161+ } ) ;
0 commit comments