File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11import 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' ;
33
44class App extends Component {
55
Original file line number Diff line number Diff line change 4949 "webpack" : " 3.5.5"
5050 },
5151 "dependencies" : {
52+ "react-icons" : " ^2.2.5" ,
5253 "url-search-params-polyfill" : " ^2.0.0" ,
5354 "whatwg-fetch" : " 2.0.3"
5455 }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React, { Component } from 'react';
22import PropTypes from 'prop-types' ;
33import 'whatwg-fetch'
44import 'url-search-params-polyfill' ;
5+ import TwitterIcon from 'react-icons/lib/fa/twitter' ;
56
67
78class TwitterLogin extends Component {
@@ -90,14 +91,22 @@ class TwitterLogin extends Component {
9091 } ) ;
9192 }
9293
94+ getDefaultButtonContent ( ) {
95+ return (
96+ < span >
97+ < TwitterIcon color = '#00aced' size = { 25 } /> { this . props . text }
98+ </ span >
99+ ) ;
100+ }
101+
93102 render ( ) {
94103 const twitterButton = React . createElement (
95104 this . props . tag , {
96105 onClick : this . onButtonClick ,
97106 style : this . props . style ,
98107 disabled : this . props . disabled ,
99108 className : this . props . className ,
100- } , this . props . children ? this . props . children : this . props . text
109+ } , this . props . children ? this . props . children : this . getDefaultButtonContent ( )
101110 ) ;
102111 return twitterButton ;
103112 }
@@ -119,7 +128,7 @@ TwitterLogin.propTypes = {
119128
120129TwitterLogin . defaultProps = {
121130 tag : 'button' ,
122- text : 'Sign up with Twitter' ,
131+ text : 'Sign in with Twitter' ,
123132 disabled : false ,
124133 dialogWidth : 600 ,
125134 dialogHeight : 400
You can’t perform that action at this time.
0 commit comments