File tree 3 files changed +13
-3
lines changed
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
- import TwitterLogin from 'react-twitter-auth/lib/react-twitter-login -component.js' ;
2
+ import TwitterLogin from 'react-twitter-auth/lib/react-twitter-auth -component.js' ;
3
3
4
4
class App extends Component {
5
5
Original file line number Diff line number Diff line change 49
49
"webpack" : " 3.5.5"
50
50
},
51
51
"dependencies" : {
52
+ "react-icons" : " ^2.2.5" ,
52
53
"url-search-params-polyfill" : " ^2.0.0" ,
53
54
"whatwg-fetch" : " 2.0.3"
54
55
}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React, { Component } from 'react';
2
2
import PropTypes from 'prop-types' ;
3
3
import 'whatwg-fetch'
4
4
import 'url-search-params-polyfill' ;
5
+ import TwitterIcon from 'react-icons/lib/fa/twitter' ;
5
6
6
7
7
8
class TwitterLogin extends Component {
@@ -90,14 +91,22 @@ class TwitterLogin extends Component {
90
91
} ) ;
91
92
}
92
93
94
+ getDefaultButtonContent ( ) {
95
+ return (
96
+ < span >
97
+ < TwitterIcon color = '#00aced' size = { 25 } /> { this . props . text }
98
+ </ span >
99
+ ) ;
100
+ }
101
+
93
102
render ( ) {
94
103
const twitterButton = React . createElement (
95
104
this . props . tag , {
96
105
onClick : this . onButtonClick ,
97
106
style : this . props . style ,
98
107
disabled : this . props . disabled ,
99
108
className : this . props . className ,
100
- } , this . props . children ? this . props . children : this . props . text
109
+ } , this . props . children ? this . props . children : this . getDefaultButtonContent ( )
101
110
) ;
102
111
return twitterButton ;
103
112
}
@@ -119,7 +128,7 @@ TwitterLogin.propTypes = {
119
128
120
129
TwitterLogin . defaultProps = {
121
130
tag : 'button' ,
122
- text : 'Sign up with Twitter' ,
131
+ text : 'Sign in with Twitter' ,
123
132
disabled : false ,
124
133
dialogWidth : 600 ,
125
134
dialogHeight : 400
You can’t perform that action at this time.
0 commit comments