From 18a63f57910d88cb0f9071ea5524dd855274110b Mon Sep 17 00:00:00 2001 From: Shanthi Tammana Date: Fri, 22 Nov 2024 13:14:51 -0800 Subject: [PATCH] Added id's to footer links and Ready page web elements --- .../components/Widgets/SnackNotifier.jsx | 5 ++++- .../Intro/FriendInvitationOnboardingIntro.jsx | 4 ++-- .../FriendInvitationOnboardingValues.jsx | 2 +- .../Navigation/FooterCandidateList.jsx | 4 ++-- .../Navigation/FooterMainWeVote.jsx | 4 ++-- .../Navigation/SettingsSectionFooter.jsx | 10 ++++----- src/js/components/Ready/ReadyFinePrint.jsx | 18 +++++++-------- src/js/components/Ready/ReadyIntroduction.jsx | 22 +++++++++---------- src/js/components/Values/IssueCard.jsx | 11 +++++----- .../Values/IssueFollowToggleButton.jsx | 13 ++++++++--- .../components/Values/IssueImageDisplay.jsx | 2 +- src/js/components/Widgets/ShowMoreButtons.jsx | 2 +- 12 files changed, 54 insertions(+), 43 deletions(-) diff --git a/src/js/common/components/Widgets/SnackNotifier.jsx b/src/js/common/components/Widgets/SnackNotifier.jsx index 397411a23..997cc3822 100644 --- a/src/js/common/components/Widgets/SnackNotifier.jsx +++ b/src/js/common/components/Widgets/SnackNotifier.jsx @@ -34,7 +34,7 @@ class SnackNotifier extends Component { }); }; - openSnackbar = ({ message, severity, duration }) => { + openSnackbar = ({ id, message, severity, duration }) => { const autoHideDuration = duration || 3000; if (!message) { // eslint-disable-next-line no-param-reassign @@ -42,6 +42,9 @@ class SnackNotifier extends Component { if (message && message.length === 0) { return; } + if (id) { + return; + } } AppObservableStore.setPendingSnackMessage(''); if (!severity) { diff --git a/src/js/components/Intro/FriendInvitationOnboardingIntro.jsx b/src/js/components/Intro/FriendInvitationOnboardingIntro.jsx index f23e1c799..de8265f7c 100644 --- a/src/js/components/Intro/FriendInvitationOnboardingIntro.jsx +++ b/src/js/components/Intro/FriendInvitationOnboardingIntro.jsx @@ -153,7 +153,7 @@ class FriendInvitationOnboardingIntro extends Component { )} - + WeVote helps you: @@ -184,7 +184,7 @@ class FriendInvitationOnboardingIntro extends Component { Make a plan for casting your vote. See your entire ballot. Find your polling location. ) : ( - + {showCountDownDays ? ( <> There are diff --git a/src/js/components/Intro/FriendInvitationOnboardingValues.jsx b/src/js/components/Intro/FriendInvitationOnboardingValues.jsx index 02c10e8b8..b35c8d167 100644 --- a/src/js/components/Intro/FriendInvitationOnboardingValues.jsx +++ b/src/js/components/Intro/FriendInvitationOnboardingValues.jsx @@ -62,7 +62,7 @@ class FriendInvitationOnboardingValues extends Component { Opinions will be highlighted on your ballot based on what you follow. Follow as many values/issues... {' '} ( - + show more ) diff --git a/src/js/components/Navigation/FooterCandidateList.jsx b/src/js/components/Navigation/FooterCandidateList.jsx index 89a384eea..69837f862 100644 --- a/src/js/components/Navigation/FooterCandidateList.jsx +++ b/src/js/components/Navigation/FooterCandidateList.jsx @@ -11,7 +11,7 @@ export default function FooterCandidateList () { let stateNamePhraseLowerCase; return ( - + Who's running for office? {stateNameList.map((stateName) => { @@ -21,7 +21,7 @@ export default function FooterCandidateList () { // console.log('tempStateCode:', tempStateCode, ', stateAlreadySelected:', stateAlreadySelected); return ( - + {stateName} {' '} candidates diff --git a/src/js/components/Navigation/FooterMainWeVote.jsx b/src/js/components/Navigation/FooterMainWeVote.jsx index dc6e1f23d..ae42dc5f6 100644 --- a/src/js/components/Navigation/FooterMainWeVote.jsx +++ b/src/js/components/Navigation/FooterMainWeVote.jsx @@ -103,7 +103,7 @@ class FooterMainWeVote extends Component { {isWebApp() ? ( <> - + About & FAQ @@ -159,7 +159,7 @@ class FooterMainWeVote extends Component { - + WeVote diff --git a/src/js/components/Navigation/SettingsSectionFooter.jsx b/src/js/components/Navigation/SettingsSectionFooter.jsx index 1549238e3..32045d2b8 100644 --- a/src/js/components/Navigation/SettingsSectionFooter.jsx +++ b/src/js/components/Navigation/SettingsSectionFooter.jsx @@ -73,9 +73,9 @@ class SettingsSectionFooter extends Component { return ( - How It Works + How It Works - About & FAQ + About & FAQ - Privacy + Privacy - Terms + Terms {(isWebApp() && !inPrivateLabelMode) && ( @@ -122,7 +122,7 @@ class SettingsSectionFooter extends Component { )} {(isCordova() || !inPrivateLabelMode) && ( - + WeVote does not support or oppose any political candidate or party. )} diff --git a/src/js/components/Ready/ReadyFinePrint.jsx b/src/js/components/Ready/ReadyFinePrint.jsx index 63fa803b3..81fc581b3 100644 --- a/src/js/components/Ready/ReadyFinePrint.jsx +++ b/src/js/components/Ready/ReadyFinePrint.jsx @@ -55,14 +55,14 @@ class ReadyFinePrint extends Component { return ( - + The fine print: - a - You cannot cast your vote electronically + a + You cannot cast your vote electronically {contentUnfurled && ( @@ -72,8 +72,8 @@ class ReadyFinePrint extends Component { )} - b - WeVote does not represent a government entity + b + WeVote does not represent a government entity {contentUnfurled && ( @@ -96,8 +96,8 @@ class ReadyFinePrint extends Component { {(contentUnfurled || showStep3WhenCompressed) && ( - c - Please make sure you are registered to vote + c + Please make sure you are registered to vote )} {contentUnfurled && ( @@ -111,8 +111,8 @@ class ReadyFinePrint extends Component { {(contentUnfurled || showStep3WhenCompressed) && ( - d - How your data is used & protected + d + How your data is used & protected )} {contentUnfurled && ( diff --git a/src/js/components/Ready/ReadyIntroduction.jsx b/src/js/components/Ready/ReadyIntroduction.jsx index bd13e8e92..4f266e1c1 100644 --- a/src/js/components/Ready/ReadyIntroduction.jsx +++ b/src/js/components/Ready/ReadyIntroduction.jsx @@ -95,31 +95,31 @@ class ReadyIntroduction extends Component { return ( - + WeVote helps you: - 1 - Be ready to vote + 1 + Be ready to vote {contentUnfurled && (   {' '} to find out when your next election is, and {' '} - preview your ballot + preview your ballot . {' '} How are {' '} - your friends + your friends {' '} planning to vote? @@ -127,8 +127,8 @@ class ReadyIntroduction extends Component { )} - 2 - Be confident in your choices + 2 + Be confident in your choices {contentUnfurled && ( @@ -154,8 +154,8 @@ class ReadyIntroduction extends Component { )} {(contentUnfurled || showStep3WhenCompressed) && ( - 3 - Help friends & amplify your impact + 3 + Help friends & amplify your impact )} {contentUnfurled && ( @@ -163,7 +163,7 @@ class ReadyIntroduction extends Component {   {isWebApp() || isCordova() ? ( - Invite your friends + Invite your friends ) : ( <>Invite your friends )} diff --git a/src/js/components/Values/IssueCard.jsx b/src/js/components/Values/IssueCard.jsx index 810a68980..9c111a6c4 100755 --- a/src/js/components/Values/IssueCard.jsx +++ b/src/js/components/Values/IssueCard.jsx @@ -197,7 +197,7 @@ class IssueCard extends Component { const issueTooltip = isMobileScreenSize() ? () : ( -
+
Follow {' '} {issueDisplayName} @@ -267,7 +267,7 @@ class IssueCard extends Component { ); const issueNameAndCount = ( - + {`${issueDisplayName} `} {!hideAdvocatesCount && ( @@ -305,7 +305,7 @@ class IssueCard extends Component { )} {!!(linkedOrganizationCount) && ( - + {numberAbbreviate(linkedOrganizationCount)} @@ -342,7 +342,8 @@ class IssueCard extends Component { {!turnOffIssueImage && ( {includeLinkToIssue ? ( - @@ -416,7 +417,7 @@ class IssueCard extends Component { - + {!!(issueFollowersCount) && ( <> {numberAbbreviate(issueFollowersCount)} diff --git a/src/js/components/Values/IssueFollowToggleButton.jsx b/src/js/components/Values/IssueFollowToggleButton.jsx index 73113f8e6..d4b95250a 100644 --- a/src/js/components/Values/IssueFollowToggleButton.jsx +++ b/src/js/components/Values/IssueFollowToggleButton.jsx @@ -108,7 +108,7 @@ class IssueFollowToggleButton extends Component { if (this.props.onIssueFollowFunction) { this.props.onIssueFollowFunction(issueWeVoteId); } - openSnackbar({ message: `Now following ${this.props.issueName}!` }); + openSnackbar({ id: `${this.props.issueName}_follow`, message: `Now following ${this.props.issueName}!` }); this.setState({ isFollowing: true, @@ -133,7 +133,13 @@ class IssueFollowToggleButton extends Component { if (this.props.onIssueStopFollowingFunction) { this.props.onIssueStopFollowingFunction(issueWeVoteId); } - openSnackbar({ message: `You've stopped following ${issueName}.`, severity: 'success' }); + // openSnackbar({id: `${issueName}_unfollow, message: `You've stopped following ${issueName}.`, severity: 'success' }); + openSnackbar({ + id: `${issueName}_unfollow`, + message: `You've stopped following ${issueName}.`, + severity: 'success', + }); + if (currentBallotIdInUrl !== ballotItemWeVoteId) { historyPush(`${urlWithoutHash}#${ballotItemWeVoteId}`); } @@ -171,6 +177,7 @@ class IssueFollowToggleButton extends Component { {isFollowing ? ( <> }>{issueImage}; + return }>{issueImage}; } } IssueImageDisplay.propTypes = { diff --git a/src/js/components/Widgets/ShowMoreButtons.jsx b/src/js/components/Widgets/ShowMoreButtons.jsx index ea8782276..a1f7b015a 100644 --- a/src/js/components/Widgets/ShowMoreButtons.jsx +++ b/src/js/components/Widgets/ShowMoreButtons.jsx @@ -21,7 +21,7 @@ class ShowMoreButtons extends React.Component { return ( - + { showMoreText } {' '} {showMoreButtonWasClicked ? (