Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 2 additions & 27 deletions src/js/common/components/Settings/CompleteYourProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
import React, { Component, Suspense } from 'react';
import SupportActions from '../../../actions/SupportActions';
import VoterActions from '../../../actions/VoterActions';
import ByContinuingNotice from '../../../components/Widgets/ByContinuingNotice';
import VoterPhotoUpload from './VoterPhotoUpload';
import DelayedLoad from '../Widgets/DelayedLoad';
import { renderLog } from '../../utils/logging';
Expand All @@ -22,10 +23,7 @@ import CandidateStore from '../../../stores/CandidateStore';
import RepresentativeStore from '../../../stores/RepresentativeStore';
import { validateEmail } from '../../../utils/regex-checks';

const OpenExternalWebSite = React.lazy(() => import(/* webpackChunkName: 'OpenExternalWebSite' */ '../Widgets/OpenExternalWebSite'));
const SignInButton = React.lazy(() => import(/* webpackChunkName: 'SignInButton' */ '../Navigation/SignInButton'));
// const SignInModalController = React.lazy(() => import(/* webpackChunkName: 'SignInModalController' */ './SignInModalController'));
// const SignInModal = React.lazy(() => import(/* webpackChunkName: 'SignInModal' */ '../SignIn/SignInModal'));

class CompleteYourProfile extends Component {
constructor (props) {
Expand Down Expand Up @@ -367,30 +365,7 @@ class CompleteYourProfile extends Component {
</CompleteYourProfileButtonWrapper>
<Suspense fallback={<></>}>
<FinePrint outerMarginsOff={outerMarginsOff}>
By continuing, you accept WeVote.US&apos;s
{' '}
<OpenExternalWebSite
linkIdAttribute="termsOfService"
url="/terms"
target="_blank"
body={(
<span>Terms of Service</span>
)}
className={classes.link}
/>
{' '}
and
{' '}
<OpenExternalWebSite
linkIdAttribute="privacyPolicy"
url="/privacy"
target="_blank"
body={(
<span>Privacy Policy</span>
)}
className={classes.link}
/>
{' '}
<ByContinuingNotice cordovaClose={this.closeVerifyModal} />
and agree to receive occasional emails about this campaign and upcoming elections. You can unsubscribe at any time. We will never sell your email address.
</FinePrint>
</Suspense>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ class SettingsVerifySecretCode extends Component {
const secretCodeVerificationStatus = VoterStore.getSecretCodeVerificationStatus();
const { incorrectSecretCodeEntered, numberOfTriesRemaining, secretCodeVerified, voterMustRequestNewCode, voterSecretCodeRequestsLocked } = secretCodeVerificationStatus;
// console.log(`onVoterStoreChange secretCodeVerified: ${secretCodeVerified}`);
// console.log(`onVoterStoreChange secretCodeVerificationStatus: ${JSON.stringify(secretCodeVerificationStatus)}`);
if (secretCodeVerified) {
// console.log('SettingsVerifySecretCode -- onVoterStoreChange secretCodeVerified: yes');
this.closeSignInModalLocal();
Expand All @@ -244,6 +245,7 @@ class SettingsVerifySecretCode extends Component {
errorToDisplay = true;
errorMessageToDisplay = 'You\'ve reached the maximum number of tries.';
} else if (incorrectSecretCodeEntered || numberOfTriesRemaining <= 4) {
// console.log('onVoterStoreChange DISPLAYING Incorrect code entered.');
errorToDisplay = true;
errorMessageToDisplay = 'Incorrect code entered.';
}
Expand Down
50 changes: 9 additions & 41 deletions src/js/common/components/SignIn/SignInOptionsPanel.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Facebook, X as Twitter } from '@mui/icons-material';
import PropTypes from 'prop-types';
import React, { Component, Suspense } from 'react';
import TagManager from 'react-gtm-module';
import React, { Component } from 'react';
import Button from 'react-bootstrap/Button';
import TagManager from 'react-gtm-module';
import styled from 'styled-components';
import AnalyticsActions from '../../../actions/AnalyticsActions';
import TwitterActions from '../../../actions/TwitterActions';
Expand All @@ -14,11 +14,13 @@ import VoterEmailAddressEntry from '../../../components/Settings/VoterEmailAddre
import VoterPhoneVerificationEntry from '../../../components/Settings/VoterPhoneVerificationEntry';
import TwitterSignIn from '../../../components/Twitter/TwitterSignIn';
import BrowserPushMessage from '../../../components/Widgets/BrowserPushMessage';
import ByContinuingNotice from '../../../components/Widgets/ByContinuingNotice.jsx';
import webAppConfig from '../../../config';
import FacebookStore from '../../../stores/FacebookStore';
import VoterStore from '../../../stores/VoterStore';
import initializeAppleSDK from '../../../utils/initializeAppleSDK';
import initializeFacebookSDK from '../../../utils/initializeFacebookSDK';
import lookupPageNameAndPageTypeDict, { getPageDetails } from '../../../utils/lookupPageNameAndPageTypeDict';
import AppObservableStore, { messageService } from '../../stores/AppObservableStore';
import { isIPhone4in, isIPhone4p7in, restoreStylesAfterCordovaKeyboard } from '../../utils/cordovaUtils';
import { normalizedHref } from '../../utils/hrefUtils';
Expand All @@ -29,9 +31,7 @@ import stringContains from '../../utils/stringContains';
import LoadingWheel from '../Widgets/LoadingWheel';
import signInModalGlobalState from '../Widgets/signInModalGlobalState';
import SnackNotifier, { openSnackbar } from '../Widgets/SnackNotifier';
import lookupPageNameAndPageTypeDict, { getPageDetails } from '../../../utils/lookupPageNameAndPageTypeDict';

const OpenExternalWebSite = React.lazy(() => import(/* webpackChunkName: 'OpenExternalWebSite' */ '../Widgets/OpenExternalWebSite'));
/* global $ */

const debugMode = false;
Expand Down Expand Up @@ -61,6 +61,7 @@ export default class SignInOptionsPanel extends Component {
this.toggleTwitterDisconnectOpen = this.toggleTwitterDisconnectOpen.bind(this);
this.voterSplitIntoTwoAccounts = this.voterSplitIntoTwoAccounts.bind(this);
this.hideDialogForCordovaLocal = this.hideDialogForCordovaLocal.bind(this);
this.closeSignInModalLocal = this.closeSignInModalLocal.bind(this);
}

// See https://reactjs.org/docs/error-boundaries.html
Expand Down Expand Up @@ -429,8 +430,6 @@ export default class SignInOptionsPanel extends Component {
// 'hideFacebookSignInButton', hideFacebookSignInButton, 'hideDialogForCordova', hideDialogForCordova,
// '\nisOnFacebookSupportedDomainUrl', isOnFacebookSupportedDomainUrl, 'isOnWeVoteRootUrl', isOnWeVoteRootUrl);

const termsOfServiceURL = `${webAppConfig.WE_VOTE_URL_PROTOCOL + webAppConfig.WE_VOTE_HOSTNAME}/more/terms`;
const privacyPolicyURL = `${webAppConfig.WE_VOTE_URL_PROTOCOL + webAppConfig.WE_VOTE_HOSTNAME}/privacy`;
const isTinyScreen = isIPhone4in() || isIPhone4p7in() || window.innerWidth <= 375;

return (
Expand Down Expand Up @@ -628,40 +627,9 @@ export default class SignInOptionsPanel extends Component {
<br />
</div>
)}
<TermsWrapper id="terms_Wrapper">
By continuing, you accept WeVote.US’s
{' '}
<Suspense fallback={<></>}>
<OpenExternalWebSite
className="open-web-site"
body={(
<span>
Terms of Service
</span>
)}
linkIdAttribute="openTermsOfService"
target="_blank"
url={termsOfServiceURL}
/>
</Suspense>
{' '}
and
{' '}
<Suspense fallback={<></>}>
<OpenExternalWebSite
linkIdAttribute="openPrivacyPolicy"
url={privacyPolicyURL}
target="_blank"
className="open-web-site open-web-site__no-right-padding"
body={(
<span>
Privacy Policy
</span>
)}
/>
</Suspense>
.
</TermsWrapper>
<SignInOptionsTermsWrapper id="terms_Wrapper">
<ByContinuingNotice cordovaClose={this.closeSignInModalLocal} />
</SignInOptionsTermsWrapper>
</Main>
</SignInOptionsPanelWrapper>
</>
Expand All @@ -688,7 +656,7 @@ const OrWrapper = styled('div')(({ theme }) => (`
}
`));

const TermsWrapper = styled('div')(({ theme }) => (`
const SignInOptionsTermsWrapper = styled('div')(({ theme }) => (`
margin-top: 30px;
// font-weight: 600;
// ${theme.breakpoints.down('sm')} {
Expand Down
10 changes: 3 additions & 7 deletions src/js/common/utils/isMobileScreenSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ export function isSmallTablet () {
return innerWidth > tabMin && innerWidth < tabMdMin;
}

export function isMedOrLgTablet () {
const { innerWidth, muiThemeGlobal: { breakpoints: { values: { tabMdMin, tabMax } } } } = window;
return innerWidth > tabMdMin && innerWidth < tabMax;
}

export function isSmallerThanTablet () {
const { innerWidth, muiThemeGlobal: { breakpoints: { values: { tabMin } } } } = window;
return innerWidth < tabMin;
Expand Down Expand Up @@ -80,11 +75,12 @@ was .u-show-desktop then this function was uShowDesktop
*/

export function getDesktopBreakpointValue () {
const { innerWidth, muiThemeGlobal: { breakpoints: { values: { tabMax } } } } = window;
return tabMax
const { muiThemeGlobal: { breakpoints: { values: { tabMax } } } } = window;
return tabMax;
}

export function displayNoneIfSmallerThanDesktop () {
const { innerWidth } = window;
const tabMax = getDesktopBreakpointValue;
if ((isWebApp() && innerWidth < 991) || (!isWebApp() && innerWidth < tabMax)) {
return 'display: none !important;';
Expand Down
43 changes: 43 additions & 0 deletions src/js/components/Widgets/ByContinuingNotice.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { isCordova, isWebApp } from '../../common/utils/isCordovaOrWebApp';



const ByContinuingNotice = (params) => {
const { cordovaClose } = params;

const closeModal = () => {
if (isCordova() && cordovaClose) {
cordovaClose();
}
}

return (
<>
By continuing, you accept WeVote.US&apos;s
<br />
{' '}
<Link className="open-web-site"
id="ByContinuingNoticeTerms"
to="/more/terms"
onClick={closeModal}
target={isWebApp() ? "_blank" : ""}>
<span className="u-no-break">Terms of Service</span>
</Link>
{' '}
and
{' '}
<Link className="open-web-site"
id="ByContinuingNoticePrivacy"
to="/privacy"
onClick={closeModal}
target={isWebApp() ? "_blank" : ""}>
<span className="u-no-break">Privacy Policy</span>
</Link>
.
</>
)
}

export default ByContinuingNotice;
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ import styled, { createGlobalStyle } from 'styled-components';
import AppObservableStore from '../../../common/stores/AppObservableStore';
import VoterStore from '../../../stores/VoterStore';
import PositionPublicToggle from '../../PositionItem/PositionPublicToggle';
import webAppConfig from '../../../config';
import ByContinuingNotice from '../ByContinuingNotice';
import ModalDisplayTemplateB from '../ModalDisplayTemplateB';

const OpenExternalWebSite = React.lazy(() => import(/* webpackChunkName: 'OpenExternalWebSite' */ '../../../common/components/Widgets/OpenExternalWebSite'));

const termsOfServiceURL = `${webAppConfig.WE_VOTE_URL_PROTOCOL + webAppConfig.WE_VOTE_HOSTNAME}/more/terms`;
const privacyPolicyURL = `${webAppConfig.WE_VOTE_URL_PROTOCOL + webAppConfig.WE_VOTE_HOSTNAME}/privacy`;


class ChooseOrOpposeIntroModal extends Component {
constructor (props) {
Expand Down Expand Up @@ -151,41 +146,9 @@ class ChooseOrOpposeIntroModal extends Component {
<HelperText>
Signing in is optional. Takes about 30 seconds. Free forever.
</HelperText>
<TermsWrapper id="terms_Wrapper">
By continuing, you accept WeVote.US’s
<br />
{' '}
<Suspense fallback={<></>}>
<OpenExternalWebSite
className="open-web-site"
body={(
<span>
Terms of Service
</span>
)}
linkIdAttribute="openTermsOfService"
target="_blank"
url={termsOfServiceURL}
/>
</Suspense>
{' '}
and
{' '}
<Suspense fallback={<></>}>
<OpenExternalWebSite
linkIdAttribute="openPrivacyPolicy"
url={privacyPolicyURL}
target="_blank"
className="open-web-site open-web-site__no-right-padding"
body={(
<span>
Privacy Policy
</span>
)}
/>
</Suspense>
.
</TermsWrapper>
<TermsWrapperChooseOrOppose id="terms_Wrapper">
<ByContinuingNotice cordovaClose={this.props.onClose} />
</TermsWrapperChooseOrOppose>
</>
</Suspense>
);
Expand Down Expand Up @@ -394,7 +357,7 @@ const SubTitleText = styled('div')`
color: #4B4B4B;
`;

const TermsWrapper = styled('div')(({ theme }) => (`
const TermsWrapperChooseOrOppose = styled('div')(({ theme }) => (`
margin-top: 30px;
font-size: 13px;
font-weight: 400;
Expand Down
44 changes: 4 additions & 40 deletions src/js/components/Widgets/ItemActionBar/MakePublicGateModal.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { Button } from '@mui/material';
import withStyles from '@mui/styles/withStyles';
import PropTypes from 'prop-types';
import React, { Suspense, useCallback, useEffect, useRef } from 'react';
import React, { useCallback, useEffect, useRef } from 'react';
import TagManager from 'react-gtm-module';
import styled from 'styled-components';
import ModalDisplayTemplateA from '../ModalDisplayTemplateA';
import AppObservableStore from '../../../common/stores/AppObservableStore';
import PoliticianStore from '../../../common/stores/PoliticianStore';
import VoterStore from '../../../stores/VoterStore';
import lookupPageNameAndPageTypeDict, { getPageDetails } from '../../../utils/lookupPageNameAndPageTypeDict';
import webAppConfig from '../../../config';

const OpenExternalWebSite = React.lazy(() => import(/* webpackChunkName: 'OpenExternalWebSite' */ '../../../common/components/Widgets/OpenExternalWebSite'));
import ByContinuingNotice from '../ByContinuingNotice';
import ModalDisplayTemplateA from '../ModalDisplayTemplateA';

const termsOfServiceURL = `${webAppConfig.WE_VOTE_URL_PROTOCOL + webAppConfig.WE_VOTE_HOSTNAME}/more/terms`;
const privacyPolicyURL = `${webAppConfig.WE_VOTE_URL_PROTOCOL + webAppConfig.WE_VOTE_HOSTNAME}/privacy`;

function MakePublicGateModal ({ classes, politicianWeVoteId }) {
const campaignXWeVoteIdRef = useRef('');
Expand Down Expand Up @@ -136,39 +132,7 @@ function MakePublicGateModal ({ classes, politicianWeVoteId }) {
Signing in is optional. Takes about 30 seconds. Free forever.
</HelperText>
<TermsWrapper id="terms_Wrapper">
By continuing, you accept WeVote.US’s
<br />
{' '}
<Suspense fallback={<></>}>
<OpenExternalWebSite
className="open-web-site"
body={(
<span>
Terms of Service
</span>
)}
linkIdAttribute="openTermsOfService"
target="_blank"
url={termsOfServiceURL}
/>
</Suspense>
{' '}
and
{' '}
<Suspense fallback={<></>}>
<OpenExternalWebSite
linkIdAttribute="openPrivacyPolicy"
url={privacyPolicyURL}
target="_blank"
className="open-web-site open-web-site__no-right-padding"
body={(
<span>
Privacy Policy
</span>
)}
/>
</Suspense>
.
<ByContinuingNotice cordovaClose={handleCloseMakePublicGateModal} />
</TermsWrapper>
</MakePublicGateModalContainer>
);
Expand Down
Loading