From 25be46529751fb8a3edc4fd07cf4674cfdedb5c7 Mon Sep 17 00:00:00 2001 From: Uchi Uchibeke Date: Sun, 27 Oct 2024 10:46:39 +0200 Subject: [PATCH] Fix linter issues --- open-giving/src/components/DonationForm.js | 5 +- open-giving/src/components/Header.js | 3 +- open-giving/src/components/Layout.js | 7 +- open-giving/src/components/NonProfitDialog.js | 18 +- .../src/components/TestModeSwitcher.js | 2 +- .../src/components/landingpage/Hero.js | 1 + .../src/components/landingpage/Orgs.js | 7 +- .../landingpage/SelectDonationMethod.js | 3 +- .../components/landingpage/donateButton.js | 1 + open-giving/src/hooks/mobile.js | 2 +- open-giving/src/pages/index-old.js | 163 ------------------ open-giving/src/pages/index.js | 14 +- 12 files changed, 39 insertions(+), 187 deletions(-) delete mode 100644 open-giving/src/pages/index-old.js diff --git a/open-giving/src/components/DonationForm.js b/open-giving/src/components/DonationForm.js index c160b2b..14bbb2e 100644 --- a/open-giving/src/components/DonationForm.js +++ b/open-giving/src/components/DonationForm.js @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; import useDonation from '../hooks/useDonation'; -import DonateButton from './landingpage/donateButton'; -import CopyWithTooltip from './landingpage/copy'; import { sanitizeNumericInput } from '../utils/paymentMethods'; +import CopyWithTooltip from './landingpage/copy'; +import DonateButton from './landingpage/donateButton'; + const dev = process.env.NODE_ENV == 'development'; const DonationForm = React.memo( ({ method, index, setSnackbarMessage, setSnackbarOpen, NPOName }) => { diff --git a/open-giving/src/components/Header.js b/open-giving/src/components/Header.js index d865d7e..c0671a6 100644 --- a/open-giving/src/components/Header.js +++ b/open-giving/src/components/Header.js @@ -1,8 +1,9 @@ -import useIsMobileScreen from '@/hooks/mobile'; import Image from 'next/image'; import React from 'react'; import { FaGithub } from 'react-icons/fa'; +import useIsMobileScreen from '@/hooks/mobile'; + const Header = () => { const isMobile = useIsMobileScreen(); return ( diff --git a/open-giving/src/components/Layout.js b/open-giving/src/components/Layout.js index 9e5847f..a67929e 100644 --- a/open-giving/src/components/Layout.js +++ b/open-giving/src/components/Layout.js @@ -1,8 +1,9 @@ +import Image from 'next/image'; import React from 'react'; -import TestModeSwitcher from './TestModeSwitcher'; -import Header from './Header'; import { FaHeart } from 'react-icons/fa6'; -import Image from 'next/image'; + +import Header from './Header'; +import TestModeSwitcher from './TestModeSwitcher'; const Layout = ({ children, plain = false }) => { return (
diff --git a/open-giving/src/components/NonProfitDialog.js b/open-giving/src/components/NonProfitDialog.js index f22349d..3a2884a 100644 --- a/open-giving/src/components/NonProfitDialog.js +++ b/open-giving/src/components/NonProfitDialog.js @@ -1,15 +1,17 @@ +import Image from 'next/image'; import React, { useState } from 'react'; -import { MdClose, MdLocationOn } from 'react-icons/md'; import { FaRegCalendarAlt } from 'react-icons/fa'; -import DonationForm from './DonationForm'; -import Image from 'next/image'; import { FaAngleRight, FaArrowLeft } from 'react-icons/fa6'; +import { MdClose, MdLocationOn } from 'react-icons/md'; + +import DonationForm from './DonationForm'; + +import useIsMobileScreen from '@/hooks/mobile'; import { filterDonationMethods, formatPaymentMethodName, getIconByMethod, } from '@/utils/paymentMethods'; -import useIsMobileScreen from '@/hooks/mobile'; const Modal = ({ open, onClose, children }) => { if (!open) return null; @@ -39,6 +41,7 @@ const NonProfitDialog = ({ nonProfit?.logo || defaultLogo ); const [selectedPaymentType, setSelectedPaymentType] = useState(null); + const isMobile = useIsMobileScreen(); const handleDialogImageError = () => { setDialogImgSrc(defaultLogo); @@ -46,7 +49,6 @@ const NonProfitDialog = ({ if (!nonProfit) return null; - const isMobile = useIsMobileScreen(); const getPaymentID = (method) => { if (!method.paymentID) { return true; @@ -102,7 +104,10 @@ const NonProfitDialog = ({ }, ].map((i) => { return ( - + {i.icon} {i.name} ); @@ -186,6 +191,7 @@ const NonProfitDialog = ({ {options.map((i) => { return (