diff --git a/src/js/components/Widgets/ShowMoreItems.jsx b/src/js/components/Widgets/ShowMoreItems.jsx
index 1e2431b88..ef698aab1 100644
--- a/src/js/components/Widgets/ShowMoreItems.jsx
+++ b/src/js/components/Widgets/ShowMoreItems.jsx
@@ -2,6 +2,8 @@ import styled from 'styled-components';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
+const MINIMUM_DENOMINATOR = 6;
+
class ShowMoreItems extends Component {
constructor (props) {
super(props);
@@ -11,7 +13,7 @@ class ShowMoreItems extends Component {
render () {
const { hideShowMoreLink, loadingMoreItemsNow, numberOfItemsDisplayed, numberOfItemsTotal } = this.props;
- if (numberOfItemsDisplayed === 0) {
+ if (numberOfItemsDisplayed < MINIMUM_DENOMINATOR) {
return null;
}
diff --git a/src/js/components/Widgets/TooltipIcon.jsx b/src/js/components/Widgets/TooltipIcon.jsx
index e52a65182..1e7713146 100644
--- a/src/js/components/Widgets/TooltipIcon.jsx
+++ b/src/js/components/Widgets/TooltipIcon.jsx
@@ -3,17 +3,20 @@ import { Tooltip } from '@mui/material';
import styled from 'styled-components';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
+import isMobileScreenSize from '../../common/utils/isMobileScreenSize';
class TooltipIcon extends Component {
render () {
return (
-
-
-
+ {isMobileScreenSize() ? () : (
+
+
+
+ )}
);
}
diff --git a/src/js/pages/Ballot/Ballot.jsx b/src/js/pages/Ballot/Ballot.jsx
index 39e1da4be..3c9938998 100644
--- a/src/js/pages/Ballot/Ballot.jsx
+++ b/src/js/pages/Ballot/Ballot.jsx
@@ -596,7 +596,7 @@ class Ballot extends Component {
if (voter && voter.is_signed_in) {
// console.log('onVoterStoreChange, about to historyPush(pathname):', pathname);
// Return to the same page without the 'voter_refresh_timer_on' variable
- historyPush(pathname, true);
+ historyPush(pathname, true);
} else if (numberOfVoterRetrieveAttempts < 3) {
// console.log('About to startTimerToRetrieveVoter');
this.startTimerToRetrieveVoter();
@@ -604,7 +604,7 @@ class Ballot extends Component {
// We have exceeded the number of allowed attempts and want to 'turn off' the request to refresh the voter object
// Return to the same page without the 'voter_refresh_timer_on' variable
// console.log('Exiting voterRefreshTimerOn');
- historyPush(pathname, true);
+ historyPush(pathname, true);
}
} else {
// console.log('Ballot.jsx onVoterStoreChange VoterStore.getVoter: ', VoterStore.getVoter());
diff --git a/src/js/pages/Campaigns/CampaignsHome.jsx b/src/js/pages/Campaigns/CampaignsHome.jsx
index 1b770583d..83bf66bd8 100644
--- a/src/js/pages/Campaigns/CampaignsHome.jsx
+++ b/src/js/pages/Campaigns/CampaignsHome.jsx
@@ -572,7 +572,7 @@ class CampaignsHome extends Component {
const newPathname = this.getStateNamePathnameFromStateCode(e.target.value);
const { location: { pathname } } = window;
if (pathname !== newPathname) {
- historyPush(newPathname);
+ historyPush(newPathname);
} else {
this.setState({ stateCode: e.target.value });
}
@@ -624,7 +624,7 @@ class CampaignsHome extends Component {
render () {
renderLog('CampaignsHome'); // Set LOG_RENDER_EVENTS to log all renders
- const {
+ const {
campaignList, campaignListTimeStampOfChange,
campaignsShowing,
candidateListOther, candidateListTimeStampOfChange,
diff --git a/src/js/pages/Campaigns/CampaignsHomeLoader.jsx b/src/js/pages/Campaigns/CampaignsHomeLoader.jsx
index 29789e3ed..a9be24551 100644
--- a/src/js/pages/Campaigns/CampaignsHomeLoader.jsx
+++ b/src/js/pages/Campaigns/CampaignsHomeLoader.jsx
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React, { Component, Suspense } from 'react';
import { Helmet } from 'react-helmet-async';
import styled from 'styled-components';
-import { convertStateCodeToStateText, convertStateTextToStateCode } from '../../common/utils/addressFunctions';
+import { convertStateCodeToStateText, convertStateTextToStateCode, isValidStateCode } from '../../common/utils/addressFunctions';
import historyPush from '../../common/utils/historyPush';
import { isWebApp } from '../../common/utils/isCordovaOrWebApp';
import { renderLog } from '../../common/utils/logging';
@@ -117,10 +117,18 @@ class CampaignsHomeLoader extends Component {
}
getStateNamePathnameFromStateCode = (stateCode) => {
- const stateName = convertStateCodeToStateText(stateCode);
- const stateNamePhrase = `${stateName}-candidates`;
- const stateNamePhraseLowerCase = stateNamePhrase.replaceAll(/\s+/g, '-').toLowerCase();
- return `/${stateNamePhraseLowerCase}/cs/`;
+ if (isValidStateCode(stateCode)) {
+ const stateName = convertStateCodeToStateText(stateCode);
+ if (stateName) {
+ const stateNamePhrase = `${stateName}-candidates`;
+ const stateNamePhraseLowerCase = stateNamePhrase.replaceAll(/\s+/g, '-').toLowerCase();
+ return `/${stateNamePhraseLowerCase}/cs/`;
+ } else {
+ return '/cs';
+ }
+ } else {
+ return '/cs';
+ }
}
getTopPadding = () => {
diff --git a/src/js/pages/Friends/Friends.jsx b/src/js/pages/Friends/Friends.jsx
index d2fd24f6b..12e2571ac 100755
--- a/src/js/pages/Friends/Friends.jsx
+++ b/src/js/pages/Friends/Friends.jsx
@@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
import React, { Component, Suspense } from 'react';
import { Helmet } from 'react-helmet-async';
import styled from 'styled-components';
+import isMobileScreenSize from '../../common/utils/isMobileScreenSize';
import FriendsCurrent from './FriendsCurrent';
import FriendInvitationsSentByMe from './FriendInvitationsSentByMe';
import InviteByEmail from './InviteByEmail';
@@ -523,7 +524,11 @@ class Friends extends Component {
Invite Friends
-
+ <>
+ {isMobileScreenSize() ? () : (
+
+ )}
+ >
diff --git a/src/js/pages/Friends/InviteByEmail.jsx b/src/js/pages/Friends/InviteByEmail.jsx
index d9b43be61..6922448d0 100644
--- a/src/js/pages/Friends/InviteByEmail.jsx
+++ b/src/js/pages/Friends/InviteByEmail.jsx
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import styled from 'styled-components';
import AnalyticsActions from '../../actions/AnalyticsActions';
+import isMobileScreenSize from '../../common/utils/isMobileScreenSize';
import { renderLog } from '../../common/utils/logging';
import AddFriendsByEmail from '../../components/Friends/AddFriendsByEmail';
import VoterStore from '../../stores/VoterStore';
@@ -26,7 +27,9 @@ export default class InviteByEmail extends Component {
Invite Friends
-
+ {isMobileScreenSize() ? () : (
+
+ )}
diff --git a/src/js/pages/Settings/HamburgerMenu.jsx b/src/js/pages/Settings/HamburgerMenu.jsx
index d308b9eb2..0afdf1d9f 100644
--- a/src/js/pages/Settings/HamburgerMenu.jsx
+++ b/src/js/pages/Settings/HamburgerMenu.jsx
@@ -308,7 +308,7 @@ export default class HamburgerMenu extends Component {
- this.deviceTableVisibilityOn()} style={{ color: 'black', opacity: '0.7', fontSize: '10px' }}>
+ this.deviceTableVisibilityOn()} style={{ color: 'black', opacity: '0.7', fontSize: '15px' }}>
Device Information
diff --git a/src/js/utils/initializeFacebookSDK.js b/src/js/utils/initializeFacebookSDK.js
index e0a35a723..be480c964 100644
--- a/src/js/utils/initializeFacebookSDK.js
+++ b/src/js/utils/initializeFacebookSDK.js
@@ -27,17 +27,18 @@ const initializeFacebookSDK = () => {
const { FB } = window;
console.log('const { FB } = window ------------ FB:', FB);
- FB.init({
- appId: webAppConfig.FACEBOOK_APP_ID,
- autoLogAppEvents: true,
- xfbml: true,
- version: 'v15.0', // Facebook JavaScript SDK - Facebook Version
- status: true, // set this status to true, this will fix the popup blocker issue
- });
-
- console.log('initializeFacebookSDK FB.init has been called');
- // This initial call simply pre-loads the current facebook login status to local FacebookSignedInData object
- FacebookSignedInData.setConnectedStatus(false, false, false, null);
+ if (webAppConfig.ENABLE_FACEBOOK) {
+ FB.init({
+ appId: webAppConfig.FACEBOOK_APP_ID,
+ autoLogAppEvents: true,
+ xfbml: true,
+ version: 'v15.0', // Facebook JavaScript SDK - Facebook Version
+ status: true, // set this status to true, this will fix the popup blocker issue
+ });
+ console.log('initializeFacebookSDK FB.init has been called');
+ // This initial call simply pre-loads the current facebook login status to local FacebookSignedInData object
+ FacebookSignedInData.setConnectedStatus(false, false, false, null);
+ }
};
}
};
|