Skip to content

Commit bf6c2fa

Browse files
authored
Merge pull request wevote#4612 from DaleMcGrew/Dale_WebApp_Nov20-2025
Turn off Facebook and Twitter (X) sign in buttons.
2 parents eaccddc + db850e3 commit bf6c2fa

4 files changed

Lines changed: 18 additions & 12 deletions

File tree

src/js/components/Friends/AddFriendsByEmail.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class AddFriendsByEmail extends Component {
5454
FriendActions.friendListsAll();
5555
FriendActions.friendListInvitationsWaitingForVerification();
5656
}
57-
if (this.emailInputRef.current) {
57+
if (this.emailInputRef && this.emailInputRef.current) {
5858
this.emailInputRef.current.focus();
5959
}
6060
}

src/js/pages/Activity/News.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import AppObservableStore from '../../common/stores/AppObservableStore';
3535
import BallotStore from '../../stores/BallotStore';
3636
import OrganizationStore from '../../stores/OrganizationStore';
3737
import VoterStore from '../../stores/VoterStore';
38+
import webAppConfig from '../../config';
3839
import { cordovaSimplePageContainerTopOffset } from '../../utils/cordovaCalculatedOffsets';
3940
// Lint is not smart enough to know that lazyPreloadPages will not attempt to preload/reload this page
4041
// eslint-disable-next-line import/no-cycle
@@ -50,6 +51,8 @@ const SignInOptionsPanel = React.lazy(() => import(/* webpackChunkName: 'SignInO
5051
const ShowMoreItems = React.lazy(() => import(/* webpackChunkName: 'ShowMoreItems' */ '../../components/Widgets/ShowMoreItems'));
5152

5253
const STARTING_NUMBER_OF_ACTIVITY_TIDBITS_TO_DISPLAY = 10;
54+
const facebookEnabled = webAppConfig.ENABLE_FACEBOOK === undefined ? false : webAppConfig.ENABLE_FACEBOOK;
55+
const twitterEnabled = (webAppConfig.ENABLE_TWITTER && webAppConfig.ENABLE_TWITTER_AS_VOTER_SIGN_IN_OPTION);
5356

5457

5558
class News extends Component {
@@ -483,7 +486,7 @@ class News extends Component {
483486
</div>
484487
{voterIsSignedIn && (
485488
<SignInSmallOptionsWrapper>
486-
{!voterSignedInTwitter && (
489+
{(twitterEnabled && !voterSignedInTwitter) && (
487490
<div className="card">
488491
<div className="card-main">
489492
<TwitterSignInWrapper>
@@ -492,7 +495,7 @@ class News extends Component {
492495
</div>
493496
</div>
494497
)}
495-
{!voterSignedInFacebook && (
498+
{(facebookEnabled && !voterSignedInFacebook) && (
496499
<div className="card">
497500
<div className="card-main">
498501
<FacebookSignInWrapper>

src/js/pages/Friends/Friends.jsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import { cordovaFriendsWrapper } from '../../utils/cordovaOffsets';
4040
import displayFriendsTabs from '../../utils/displayFriendsTabs';
4141
import sortFriendListByMutualFriends from '../../utils/friendFunctions';
4242
import { SectionDescription } from '../../components/Style/friendStyles';
43+
import webAppConfig from '../../config';
4344

4445
const AddContactsFromGoogleButton = React.lazy(() => import(/* webpackChunkName: 'AddContactsFromGoogleButton' */ '../../components/SetUpAccount/AddContactsFromGoogleButton'));
4546
const ContactsImportedPreview = React.lazy(() => import(/* webpackChunkName: 'ContactsImportedPreview' */ '../../components/Friends/ContactsImportedPreview'));
@@ -48,8 +49,10 @@ const FirstAndLastNameRequiredAlert = React.lazy(() => import(/* webpackChunkNam
4849
const RemindContactsStart = React.lazy(() => import(/* webpackChunkName: 'RemindContactsStart' */ '../../components/Remind/RemindContactsStart'));
4950
const SuggestedContacts = React.lazy(() => import(/* webpackChunkName: 'SuggestedContacts' */ '../../components/Friends/SuggestedContacts'));
5051

52+
const facebookEnabled = webAppConfig.ENABLE_FACEBOOK === undefined ? false : webAppConfig.ENABLE_FACEBOOK;
5153
const testimonialPhoto = '../../../img/global/photos/Dale_McGrew-48x48.jpg'; // DON'T COPY this pattern, we should be using normalizedImagePath()
5254
const testimonialAuthor = 'Dale M., Oakland, California';
55+
const twitterEnabled = (webAppConfig.ENABLE_TWITTER && webAppConfig.ENABLE_TWITTER_AS_VOTER_SIGN_IN_OPTION);
5356
const imageUrl = normalizedImagePath(testimonialPhoto);
5457
const 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>

src/js/pages/More/Donate.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class Donate extends Component {
254254
donationDescriptionReadMore = (readMore, isC4Donation) => (
255255
<DonationDescriptionContainer>
256256
<DonationDescription id="donation_copy">
257-
Become a sustainer of WeVote! With 150+ active volunteers and 100,000+ voters, our hard costs are ~$4,000 per month.
257+
Become a sustainer of WeVote! With 150+ active volunteers and 150,000+ voters, our hard costs are ~$4,000 per month.
258258
Your donations go toward servers, data fees, collaboration tools, and other critical paid services we can&apos;t get for free.
259259
</DonationDescription>
260260
{readMore && (

0 commit comments

Comments
 (0)