@@ -40,6 +40,7 @@ import { cordovaFriendsWrapper } from '../../utils/cordovaOffsets';
4040import displayFriendsTabs from '../../utils/displayFriendsTabs' ;
4141import sortFriendListByMutualFriends from '../../utils/friendFunctions' ;
4242import { SectionDescription } from '../../components/Style/friendStyles' ;
43+ import webAppConfig from '../../config' ;
4344
4445const AddContactsFromGoogleButton = React . lazy ( ( ) => import ( /* webpackChunkName: 'AddContactsFromGoogleButton' */ '../../components/SetUpAccount/AddContactsFromGoogleButton' ) ) ;
4546const ContactsImportedPreview = React . lazy ( ( ) => import ( /* webpackChunkName: 'ContactsImportedPreview' */ '../../components/Friends/ContactsImportedPreview' ) ) ;
@@ -48,8 +49,10 @@ const FirstAndLastNameRequiredAlert = React.lazy(() => import(/* webpackChunkNam
4849const RemindContactsStart = React . lazy ( ( ) => import ( /* webpackChunkName: 'RemindContactsStart' */ '../../components/Remind/RemindContactsStart' ) ) ;
4950const SuggestedContacts = React . lazy ( ( ) => import ( /* webpackChunkName: 'SuggestedContacts' */ '../../components/Friends/SuggestedContacts' ) ) ;
5051
52+ const facebookEnabled = webAppConfig . ENABLE_FACEBOOK === undefined ? false : webAppConfig . ENABLE_FACEBOOK ;
5153const testimonialPhoto = '../../../img/global/photos/Dale_McGrew-48x48.jpg' ; // DON'T COPY this pattern, we should be using normalizedImagePath()
5254const testimonialAuthor = 'Dale M., Oakland, California' ;
55+ const twitterEnabled = ( webAppConfig . ENABLE_TWITTER && webAppConfig . ENABLE_TWITTER_AS_VOTER_SIGN_IN_OPTION ) ;
5356const imageUrl = normalizedImagePath ( testimonialPhoto ) ;
5457const testimonial = 'Instead of searching through emails and social media for recommendations, I can see how my friends are voting on WeVote.' ;
5558
@@ -323,12 +326,12 @@ class Friends extends Component {
323326 </ div >
324327 < div className = "col-sm-12 col-md-4" >
325328 < SignInOptionsWrapper >
326- { voter . signed_in_twitter ? null : (
329+ { ( twitterEnabled && ! voter . signed_in_twitter ) && (
327330 < TwitterSignInWrapper >
328331 < TwitterSignInCard />
329332 </ TwitterSignInWrapper >
330333 ) }
331- { voter . signed_in_facebook ? null : (
334+ { ( facebookEnabled && ! voter . signed_in_facebook ) && (
332335 < FacebookSignInWrapper >
333336 < FacebookSignInCard />
334337 </ FacebookSignInWrapper >
@@ -365,12 +368,12 @@ class Friends extends Component {
365368 </ FindYourContactsWrapper >
366369 < InviteByEmail />
367370 < SignInOptionsWrapper >
368- { voter . signed_in_twitter ? null : (
371+ { ( twitterEnabled && ! voter . signed_in_twitter ) && (
369372 < TwitterSignInWrapper >
370373 < TwitterSignInCard />
371374 </ TwitterSignInWrapper >
372375 ) }
373- { voter . signed_in_facebook ? null : (
376+ { ( facebookEnabled && ! voter . signed_in_facebook ) && (
374377 < FacebookSignInWrapper >
375378 < FacebookSignInCard />
376379 </ FacebookSignInWrapper >
@@ -535,12 +538,12 @@ class Friends extends Component {
535538 </ div >
536539 ) }
537540 < SignInOptionsWrapper >
538- { voter . signed_in_twitter ? null : (
541+ { ( twitterEnabled && ! voter . signed_in_twitter ) && (
539542 < TwitterSignInWrapper >
540543 < TwitterSignInCard />
541544 </ TwitterSignInWrapper >
542545 ) }
543- { voter . signed_in_facebook ? null : (
546+ { ( facebookEnabled && ! voter . signed_in_facebook ) && (
544547 < FacebookSignInWrapper >
545548 < FacebookSignInCard />
546549 </ FacebookSignInWrapper >
@@ -596,12 +599,12 @@ class Friends extends Component {
596599 </ InviteFriendsMobileWrapper >
597600 </ >
598601 < SignInOptionsWrapper >
599- { voter . signed_in_twitter ? null : (
602+ { ( twitterEnabled && ! voter . signed_in_twitter ) && (
600603 < TwitterSignInWrapper >
601604 < TwitterSignInCard />
602605 </ TwitterSignInWrapper >
603606 ) }
604- { voter . signed_in_facebook ? null : (
607+ { ( facebookEnabled && ! voter . signed_in_facebook ) && (
605608 < FacebookSignInWrapper >
606609 < FacebookSignInCard />
607610 </ FacebookSignInWrapper >
0 commit comments