diff --git a/frontend/src/components/partnerMapswipeStats/contributionsHeatmap.js b/frontend/src/components/partnerMapswipeStats/contributionsHeatmap.js index 31b1c3245d..843254838a 100644 --- a/frontend/src/components/partnerMapswipeStats/contributionsHeatmap.js +++ b/frontend/src/components/partnerMapswipeStats/contributionsHeatmap.js @@ -5,8 +5,7 @@ import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; import 'mapbox-gl/dist/mapbox-gl.css'; -import { MAPBOX_TOKEN, MAP_STYLE } from '../../config'; -import { CHART_COLOURS } from '../../config'; +import { MAPBOX_TOKEN, MAP_STYLE, CHART_COLOURS } from '../../config'; import { ZoomPlusIcon, ZoomMinusIcon } from '../svgIcons'; import messages from './messages'; import './contributionsHeatmap.css'; @@ -164,14 +163,13 @@ export const ContributionsHeatmap = ({ contributionsByGeo = [] }) => { // Check if CTRL key is pressed event.originalEvent.preventDefault(); // Prevent chrome/firefox default behavior if (!map.current.scrollZoom._enabled) map.current.scrollZoom.enable(); // Enable zoom only if it's disabled - } else { - if (map.current.scrollZoom._enabled) map.current.scrollZoom.disable(); // Disable zoom only if it's enabled + } else if (map.current.scrollZoom._enabled) { + map.current.scrollZoom.disable(); // Disable zoom only if it's enabled } }); map.current.on('zoomend', () => { const currentZoom = map.current.getZoom(); - console.log(currentZoom, 'ZOOM'); const h3ResBasedOnZoom = currentZoom >= 1 ? zoomToH3ResMapping[parseInt(currentZoom)] ?? Math.floor((currentZoom - 2) * 0.7) @@ -200,7 +198,7 @@ export const ContributionsHeatmap = ({ contributionsByGeo = [] }) => { } }; - const shouldDisableZoomOut = zoom === '0.75' || zoom === 0.75; + const shouldDisableZoomOut = zoom === 0.75; return (
diff --git a/frontend/src/components/partnerMapswipeStats/groupMembers.js b/frontend/src/components/partnerMapswipeStats/groupMembers.js index f33b8f898f..1894c04fb0 100644 --- a/frontend/src/components/partnerMapswipeStats/groupMembers.js +++ b/frontend/src/components/partnerMapswipeStats/groupMembers.js @@ -72,7 +72,7 @@ export const GroupMembers = () => { const rows = 10; - const { isLoading, isError, data, isFetching, isPreviousData } = useQuery({ + const { isLoading, isError, data, isFetching } = useQuery({ queryKey: ['partners-mapswipe-statistics-group-members', partnerPermalink, pageNumber], queryFn: async () => { const response = await fetchLocalJSONAPI( diff --git a/frontend/src/components/partnerMapswipeStats/swipesByOrganisation.js b/frontend/src/components/partnerMapswipeStats/swipesByOrganisation.js index ecfc2b5721..91d60ba050 100644 --- a/frontend/src/components/partnerMapswipeStats/swipesByOrganisation.js +++ b/frontend/src/components/partnerMapswipeStats/swipesByOrganisation.js @@ -76,6 +76,7 @@ export const SwipesByOrganisation = ({ contributionsByOrganization = [] }) => { chartInstance.current.destroy(); } }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( diff --git a/frontend/src/components/partnerMapswipeStats/swipesByProjectType.js b/frontend/src/components/partnerMapswipeStats/swipesByProjectType.js index ab207f7a08..00b4c8a3f2 100644 --- a/frontend/src/components/partnerMapswipeStats/swipesByProjectType.js +++ b/frontend/src/components/partnerMapswipeStats/swipesByProjectType.js @@ -85,6 +85,7 @@ export const SwipesByProjectType = ({ contributionsByProjectType = [] }) => { chartInstance.current.destroy(); } }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( diff --git a/frontend/src/components/statsCard.js b/frontend/src/components/statsCard.js index 9eae2c5deb..cba58debd9 100644 --- a/frontend/src/components/statsCard.js +++ b/frontend/src/components/statsCard.js @@ -1,4 +1,6 @@ import { FormattedNumber } from 'react-intl'; +import PropTypes from 'prop-types'; + import shortNumber from 'short-number'; export const StatsCard = ({ icon, description, value, className, invertColors = false }) => { @@ -26,7 +28,7 @@ export const StatsCardWithFooter = ({ className, delta, invertColors = false, - style + style, }) => { return (
(

{value}

@@ -65,18 +77,20 @@ export const StatsCardContent = ({ value, label, className, invertColors = false
); -export const StatsCardWithFooterContent = ({ - value, - label, - className, - invertColors = false, -}: Object) => ( +export const StatsCardWithFooterContent = ({ value, label, className, invertColors = false }) => (

{value}

{label}
); +StatsCardWithFooterContent.propTypes = { + value: PropTypes.node, + label: PropTypes.node, + className: PropTypes.string, + invertColors: PropTypes.bool, +}; + function getFormattedNumber(num) { if (typeof num !== 'number') return '-'; const value = shortNumber(num); diff --git a/frontend/src/components/svgIcons/swipe.js b/frontend/src/components/svgIcons/swipe.js index 147e76f53c..0d313f154f 100644 --- a/frontend/src/components/svgIcons/swipe.js +++ b/frontend/src/components/svgIcons/swipe.js @@ -12,8 +12,8 @@ export class SwipeIcon extends PureComponent { {...this.props} aria-label="Swipe" > - - + +