@@ -11,66 +11,62 @@ import Circle from './custom/Circle'
1111
1212class ContentLoader extends Component {
1313
14- constructor ( props ) {
15- super ( props )
16-
17- this . state = {
18- style : props . style ,
19- type : props . type || 'facebook' ,
20- speed : props . speed || 2 ,
21- height : props . height || 130 ,
22- primaryColor : props . primaryColor || '#f0f0f0' ,
23- secondaryColor : props . secondaryColor || '#e0e0e0'
14+ constructor ( props ) {
15+ super ( props )
16+
17+ this . state = {
18+ style : props . style ,
19+ type : props . type || 'facebook' ,
20+ speed : props . speed || 2 ,
21+ height : props . height || 130 ,
22+ primaryColor : props . primaryColor || '#f0f0f0' ,
23+ secondaryColor : props . secondaryColor || '#e0e0e0'
24+ }
2425 }
25- }
2626
27- render ( ) {
27+ render ( ) {
2828
29- if ( this . props . children ) {
29+ if ( this . props . children ) {
3030
31- return (
32- < Wrap { ...this . state } >
33- { this . props . children }
34- </ Wrap >
35- )
31+ return (
32+ < Wrap { ...this . state } >
33+ { this . props . children }
34+ </ Wrap >
35+ )
3636
37- } else {
37+ }
38+ if ( ! this . props . children ) {
3839
39- switch ( this . state . type . toLowerCase ( ) ) {
40+ switch ( this . state . type . toLowerCase ( ) ) {
4041
41- case 'instagram' :
42- return < InstagramStyle { ...this . state } />
43- break
42+ case 'instagram' :
43+ return < InstagramStyle { ...this . state } />
44+ break
4445
45- case 'code' :
46- return < CodeStyle { ...this . state } />
47- break
46+ case 'code' :
47+ return < CodeStyle { ...this . state } />
48+ break
4849
49- default :
50- case 'facebook' :
51- return < FacebookStyle { ...this . state } />
52- break
53- }
50+ default :
51+ case 'facebook' :
52+ return < FacebookStyle { ...this . state } />
53+ break
5454
55- }
55+ }
56+
57+ }
5658
57- }
59+ }
5860}
5961
6062ContentLoader . propTypes = {
61- style : React . PropTypes . object ,
62- type : React . PropTypes . string ,
63- speed : React . PropTypes . number ,
64- height : React . PropTypes . number ,
65- primaryColor : React . PropTypes . string ,
66- secondaryColor : React . PropTypes . string
63+ style : React . PropTypes . object ,
64+ type : React . PropTypes . string ,
65+ speed : React . PropTypes . number ,
66+ height : React . PropTypes . number ,
67+ primaryColor : React . PropTypes . string ,
68+ secondaryColor : React . PropTypes . string
6769}
6870
6971export default ContentLoader
70- export { Rect , Circle }
71-
72-
73-
74-
75-
76-
72+ export { Rect , Circle }
0 commit comments