diff --git a/donation-ui/.eslintrc.json b/donation-ui/.eslintrc.json deleted file mode 100644 index bffb357..0000000 --- a/donation-ui/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "next/core-web-vitals" -} diff --git a/donation-ui/src/components/DownloadContactButton.js b/donation-ui/src/components/DownloadContactButton.js deleted file mode 100644 index a9737b8..0000000 --- a/donation-ui/src/components/DownloadContactButton.js +++ /dev/null @@ -1,76 +0,0 @@ -import ContactMailIcon from "@mui/icons-material/ContactMail"; -import { Box, Button, CircularProgress } from "@mui/material"; -import React, { useState } from "react"; - -import QRCodeComponent from "./QRCodeComponent"; - -const DownloadContactButton = ({ contact, isMobile }) => { - const [loading, setLoading] = useState(false); - - const handleDownload = () => { - setLoading(true); - - const vCardData = ` -BEGIN:VCARD -VERSION:3.0 -FN:${contact.name} -ORG:${contact.organization} -TITLE:${contact.title} -TEL:${contact.phone} -EMAIL:${contact.email} -ADR:${contact.address} -URL:${contact.profileData.portfolioLink} -NOTE:${contact.profileData.bio} -${contact.socialLinks?.join("\n")} -END:VCARD - `; - - const blob = new Blob([vCardData], { type: "text/vcard" }); - const url = URL.createObjectURL(blob); - const a = document.createElement("a"); - a.href = url; - a.download = `${contact.name}.vcf`; - document.body.appendChild(a); - a.click(); - document.body.removeChild(a); - URL.revokeObjectURL(url); - setLoading(false); - }; - - if (!(contact.name && contact.email)) { - return null; - } - - let url = ""; - if (typeof window !== "undefined") { - url = window.location && window.location.href; - } - if (!isMobile && url) { - return ( - - - - ); - } - - return ( - - ); -}; - -export default DownloadContactButton; diff --git a/donation-ui/src/components/Layout.js b/donation-ui/src/components/Layout.js deleted file mode 100644 index 5555a2b..0000000 --- a/donation-ui/src/components/Layout.js +++ /dev/null @@ -1,62 +0,0 @@ -import React from 'react'; -import { Box, IconButton, Container, Button } from '@mui/material'; -import GitHubIcon from '@mui/icons-material/GitHub'; -import LockIcon from '@mui/icons-material/Lock'; -import { useTheme } from '@mui/material/styles'; - -const Layout = ({ children }) => { - const theme = useTheme(); - - return ( - - - - - - - {children} - - - - - ); -}; - -export default Layout; diff --git a/open-giving/.eslintrc.json b/open-giving/.eslintrc.json new file mode 100644 index 0000000..9a2ff8e --- /dev/null +++ b/open-giving/.eslintrc.json @@ -0,0 +1,8 @@ +{ + "extends": "next/core-web-vitals", + "rules": { + "no-unused-vars": "off", + "functional/immutable-data": "off", + "functional/no-class": "off" + } +} diff --git a/donation-ui/.gitignore b/open-giving/.gitignore similarity index 100% rename from donation-ui/.gitignore rename to open-giving/.gitignore diff --git a/donation-ui/README.md b/open-giving/README.md similarity index 100% rename from donation-ui/README.md rename to open-giving/README.md diff --git a/donation-ui/jsconfig.json b/open-giving/jsconfig.json similarity index 100% rename from donation-ui/jsconfig.json rename to open-giving/jsconfig.json diff --git a/donation-ui/next.config.js b/open-giving/next.config.js similarity index 100% rename from donation-ui/next.config.js rename to open-giving/next.config.js diff --git a/donation-ui/package.json b/open-giving/package.json similarity index 91% rename from donation-ui/package.json rename to open-giving/package.json index d855886..720af76 100644 --- a/donation-ui/package.json +++ b/open-giving/package.json @@ -1,5 +1,5 @@ { - "name": "chimoney-upa-page", + "name": "chimoney-open-giving", "version": "0.1.0", "private": true, "scripts": { @@ -7,7 +7,7 @@ "build": "next build", "start": "next start", "lint": "next lint", - "lint:fix": "next lint --fix" + "lint:fix": "eslint . --ext .js --fix" }, "dependencies": { "@emotion/cache": "^11.11.0", diff --git a/donation-ui/public/android-chrome-192x192.png b/open-giving/public/android-chrome-192x192.png similarity index 100% rename from donation-ui/public/android-chrome-192x192.png rename to open-giving/public/android-chrome-192x192.png diff --git a/donation-ui/public/android-chrome-512x512.png b/open-giving/public/android-chrome-512x512.png similarity index 100% rename from donation-ui/public/android-chrome-512x512.png rename to open-giving/public/android-chrome-512x512.png diff --git a/donation-ui/public/apple-touch-icon.png b/open-giving/public/apple-touch-icon.png similarity index 100% rename from donation-ui/public/apple-touch-icon.png rename to open-giving/public/apple-touch-icon.png diff --git a/donation-ui/public/chimoney-logo-green.png b/open-giving/public/chimoney-logo-green.png similarity index 100% rename from donation-ui/public/chimoney-logo-green.png rename to open-giving/public/chimoney-logo-green.png diff --git a/donation-ui/public/chimoney-logo-light-purple.svg b/open-giving/public/chimoney-logo-light-purple.svg similarity index 100% rename from donation-ui/public/chimoney-logo-light-purple.svg rename to open-giving/public/chimoney-logo-light-purple.svg diff --git a/donation-ui/public/chimoney-logo.svg b/open-giving/public/chimoney-logo.svg similarity index 100% rename from donation-ui/public/chimoney-logo.svg rename to open-giving/public/chimoney-logo.svg diff --git a/donation-ui/public/favicon.ico b/open-giving/public/favicon.ico similarity index 100% rename from donation-ui/public/favicon.ico rename to open-giving/public/favicon.ico diff --git a/donation-ui/public/loading-black.gif b/open-giving/public/loading-black.gif similarity index 100% rename from donation-ui/public/loading-black.gif rename to open-giving/public/loading-black.gif diff --git a/donation-ui/public/manifest.json b/open-giving/public/manifest.json similarity index 82% rename from donation-ui/public/manifest.json rename to open-giving/public/manifest.json index 53927d3..fe29607 100644 --- a/donation-ui/public/manifest.json +++ b/open-giving/public/manifest.json @@ -1,7 +1,7 @@ { - "name": "Chimoney UPA", + "name": "Chimoney Open Giving", "short_name": "Chimoney App", - "description": "Chimoney Universal Payment Application", + "description": "Donate to Verified Non-Profits", "start_url": "/", "display": "standalone", "background_color": "#ffffff", diff --git a/donation-ui/public/next.svg b/open-giving/public/next.svg similarity index 100% rename from donation-ui/public/next.svg rename to open-giving/public/next.svg diff --git a/donation-ui/public/vercel.svg b/open-giving/public/vercel.svg similarity index 100% rename from donation-ui/public/vercel.svg rename to open-giving/public/vercel.svg diff --git a/donation-ui/src/components/ContactForm.js b/open-giving/src/components/ContactForm.js similarity index 97% rename from donation-ui/src/components/ContactForm.js rename to open-giving/src/components/ContactForm.js index a790f9a..ec51575 100644 --- a/donation-ui/src/components/ContactForm.js +++ b/open-giving/src/components/ContactForm.js @@ -35,7 +35,7 @@ const ContactForm = () => { body: JSON.stringify({ email, message, - notificationContext: "UPA Contact Form" + notificationContext: "Contact Form" }) } ); diff --git a/donation-ui/src/components/DonationForm.js b/open-giving/src/components/DonationForm.js similarity index 99% rename from donation-ui/src/components/DonationForm.js rename to open-giving/src/components/DonationForm.js index a4e4767..c2d4bd9 100644 --- a/donation-ui/src/components/DonationForm.js +++ b/open-giving/src/components/DonationForm.js @@ -1,24 +1,24 @@ -import React, { useState } from 'react'; +import CardGiftcardIcon from '@mui/icons-material/CardGiftcard'; +import ContentCopyIcon from '@mui/icons-material/ContentCopy'; +import LinkIcon from '@mui/icons-material/Link'; +import PaymentIcon from '@mui/icons-material/Payment'; import { - ListItem, - ListItemText, - IconButton, - Typography, - Link, Accordion, - AccordionSummary, AccordionDetails, + AccordionSummary, Box, - TextField, Button, CircularProgress, + Link, + ListItem, + ListItemText, + TextField, + Typography, } from '@mui/material'; -import ContentCopyIcon from '@mui/icons-material/ContentCopy'; -import CardGiftcardIcon from '@mui/icons-material/CardGiftcard'; -import PaymentIcon from '@mui/icons-material/Payment'; -import LinkIcon from '@mui/icons-material/Link'; -import { formatPaymentMethodName } from '../utils/paymentMethods'; +import React from 'react'; + import useDonation from '../hooks/useDonation'; +import { formatPaymentMethodName } from '../utils/paymentMethods'; const DonationForm = ({ method, diff --git a/donation-ui/src/components/FilterAccordion.js b/open-giving/src/components/FilterAccordion.js similarity index 100% rename from donation-ui/src/components/FilterAccordion.js rename to open-giving/src/components/FilterAccordion.js index dd4420c..2186edb 100644 --- a/donation-ui/src/components/FilterAccordion.js +++ b/open-giving/src/components/FilterAccordion.js @@ -1,14 +1,14 @@ -import React from 'react'; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; +import FilterListIcon from '@mui/icons-material/FilterList'; import { Accordion, - AccordionSummary, AccordionDetails, - Typography, + AccordionSummary, Box, Button, + Typography, } from '@mui/material'; -import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import FilterListIcon from '@mui/icons-material/FilterList'; +import React from 'react'; const FilterAccordion = ({ isExpanded, diff --git a/donation-ui/src/components/Footer.js b/open-giving/src/components/Footer.js similarity index 96% rename from donation-ui/src/components/Footer.js rename to open-giving/src/components/Footer.js index 1d41e00..60a7552 100644 --- a/donation-ui/src/components/Footer.js +++ b/open-giving/src/components/Footer.js @@ -6,7 +6,7 @@ import React, { useEffect, useState } from 'react'; const dev = process.env.NODE_ENV == 'development'; -const UPA = () => { +const Footer = () => { const theme = useTheme(); return (
@@ -50,4 +50,4 @@ const UPA = () => { ); }; -export default UPA; +export default Footer; diff --git a/donation-ui/src/components/Header.js b/open-giving/src/components/Header.js similarity index 100% rename from donation-ui/src/components/Header.js rename to open-giving/src/components/Header.js index 4adf4b1..824a33f 100644 --- a/donation-ui/src/components/Header.js +++ b/open-giving/src/components/Header.js @@ -1,5 +1,5 @@ -import React from 'react'; import { Typography } from '@mui/material'; +import React from 'react'; const Header = () => ( <> diff --git a/open-giving/src/components/Layout.js b/open-giving/src/components/Layout.js new file mode 100644 index 0000000..9ab61a6 --- /dev/null +++ b/open-giving/src/components/Layout.js @@ -0,0 +1,66 @@ +import GitHubIcon from '@mui/icons-material/GitHub'; +import LockIcon from '@mui/icons-material/Lock'; +import { Box, Button, Container, IconButton } from '@mui/material'; +import { useTheme } from '@mui/material/styles'; +import React from 'react'; + +const Layout = ({ children, plain = false }) => { + const theme = useTheme(); + + return ( + + {!plain && ( + + + + + + )} + {children} + {!plain && ( + + + + )} + + ); +}; + +export default Layout; diff --git a/donation-ui/src/components/NonProfitCard.js b/open-giving/src/components/NonProfitCard.js similarity index 94% rename from donation-ui/src/components/NonProfitCard.js rename to open-giving/src/components/NonProfitCard.js index 0744bff..031dba6 100644 --- a/donation-ui/src/components/NonProfitCard.js +++ b/open-giving/src/components/NonProfitCard.js @@ -7,6 +7,7 @@ import { Typography, } from '@mui/material'; import React from 'react'; + import QRCodeComponent from './QRCodeComponent'; export default function NonProfitCard({ nonProfit, onLearnMore, showQRCode }) { @@ -85,7 +86,14 @@ export default function NonProfitCard({ nonProfit, onLearnMore, showQRCode }) { /> ) : ( - + {hasValidPaymentMethods && (