├── .eslintignore ├── .prettierignore ├── .githooks ├── pre-commit ├── notice.md └── post-checkout ├── jest.setup.js ├── components ├── Astronaut │ ├── constants.js │ ├── astronaut.spec.js │ └── index.js ├── form │ ├── InputFormControl.module.css │ ├── TextareaFormControl.js │ ├── CheckboxFormControl.js │ ├── SelectFormControl.js │ └── InputFormControl.js ├── TestimonialCard.js ├── PrimaryLayout.js ├── email │ ├── Thankyou.js │ ├── Questions.js │ ├── SurveyContainer.js │ ├── EmailCaptureHelper.js │ ├── ThankyouEmail.js │ ├── InteractiveSection.js │ ├── SurveySections.js │ └── EmailCapture.js ├── LaptopForFamiliesCard.js ├── HygieneKitsCard.js ├── Modal.js ├── ElectronicsDropOffCard.js ├── HumanitarianClinicCard.js ├── DoctorsAsVolunteersCard.js ├── HotMealDayCard.js ├── FallPreventionForEldersCard.js ├── FoodDistributionSupportCard.js ├── LargeHeroSection.js ├── HealthWorkshopCard.js ├── CardsLayout.js ├── ThemeContext.js ├── LargeHeroContent.js ├── Card │ ├── __snapshots__ │ │ └── card.spec.js.snap │ ├── card.spec.js │ ├── __mocks__ │ │ └── cardData.js │ └── index.js ├── SideNavbar.js ├── HeroSection.js ├── LandingPageNav.js ├── MainDonationForm.js ├── HotMealDaySection.js ├── LargeInfoSection.js ├── Navbar.js ├── SVGBackgrounds.js └── Footer.js ├── next.config.js ├── public ├── images │ ├── BG.png │ ├── Laptop.jpeg │ ├── Volunteer.jpg │ ├── favicon.ico │ ├── HotMealDay.jpg │ ├── HygieneKit.webp │ ├── volunteer1.png │ ├── FallPrevention.jpg │ ├── HealthWorkshop.jpg │ ├── Humanitarian.jpg │ ├── keepInTouch.jpeg │ ├── ElectronicsDrop.jpg │ ├── FoodDistribution.jpg │ ├── laptops-unsplash.png │ ├── MHF-Color-300x300.png │ ├── hotMealDaySection.jpeg │ ├── hotmeals-unsplash.jpeg │ ├── large-info-section.png │ ├── marguerite_960_720.webp │ ├── larm-rmah-AEaTUnvneik-unsplash.jpeg │ ├── neonbrand-mqoLpeeYBic-unsplash.jpeg │ ├── joel-muniz-BlnpElo7clE-unsplash.jpeg │ ├── joel-muniz-y3ZY6qFln_g-unsplash.jpeg │ ├── tom-parsons-pVmjvK44Dao-unsplash.jpeg │ ├── tyler-lagalo-ZU94isADXDs-unsplash.jpeg │ ├── ray-sangga-kusuma-7uSrOyY1U0I-unsplash.jpeg │ ├── streets-of-food-OvqrJgk0WQQ-unsplash.jpeg │ ├── powered-by-vercel.svg │ └── Astronaut-01.svg └── fonts │ └── Source_Sans_Pro │ ├── SourceSansPro-Bold.ttf │ ├── SourceSansPro-Light.ttf │ ├── SourceSansPro-Regular.ttf │ └── OFL.txt ├── docs ├── images │ ├── gmaps-key-naming.png │ ├── gmaps-key-restrictions-dev.png │ └── gmaps-key-restrictions-prod.png └── env_vars.md ├── .deepsource.toml ├── .prettierrc.json ├── Dockerfile ├── lint-staged.config.js ├── models └── routes.js ├── utils └── isAvailable.js ├── docker-compose.yml ├── postcss.config.js ├── jsconfig.json ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── idea-suggestion.md ├── workflows │ ├── format.yml │ └── coverage.yml └── PULL_REQUEST_TEMPLATE.md ├── constants └── heroImages.js ├── pages ├── in-kind.js ├── give-your-time.js ├── api │ ├── create-stripe-session.js │ └── process-device-donation.js ├── _app.js ├── electronics-gifting-cities.js ├── index.js ├── 404.js ├── _document.js ├── thank-you.js ├── fund.js ├── partner-with-us.js ├── landing-page.js └── give-devices.js ├── lighthouserc.js ├── .env.example ├── hooks ├── useStripeSession.js ├── useIntersectionObserver.js └── usePosition.js ├── firebase.config.js ├── data ├── laptop-cities.json ├── GiveyourTimeCardsData.json ├── InkindCardsData.json └── homeCardsData.json ├── __tests__ └── components │ ├── MainDonationFormInNeed.spec.js │ └── MainDonationForm.spec.js ├── tailwind.config.js ├── jest.config.js ├── .eslintrc.json ├── styles └── global.css ├── package.json ├── README.md ├── .gitignore └── CONTRIBUTING.md /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .next 2 | node_modules 3 | .github 4 | -------------------------------------------------------------------------------- /.githooks/pre-commit: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | npm run precommit 4 | -------------------------------------------------------------------------------- /jest.setup.js: -------------------------------------------------------------------------------- 1 | import '@testing-library/jest-dom/extend-expect'; 2 | -------------------------------------------------------------------------------- /components/Astronaut/constants.js: -------------------------------------------------------------------------------- 1 | export const REGULAR_LOTTIE_DIMENSIONS = 400; 2 | -------------------------------------------------------------------------------- /components/form/InputFormControl.module.css: -------------------------------------------------------------------------------- 1 | .required:after { 2 | content: ' *'; 3 | color: red; 4 | } 5 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | images: { 3 | domains: ['images.ctfassets.net'], 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /public/images/BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/BG.png -------------------------------------------------------------------------------- /public/images/Laptop.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/Laptop.jpeg -------------------------------------------------------------------------------- /public/images/Volunteer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/Volunteer.jpg -------------------------------------------------------------------------------- /public/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/favicon.ico -------------------------------------------------------------------------------- /public/images/HotMealDay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/HotMealDay.jpg -------------------------------------------------------------------------------- /public/images/HygieneKit.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/HygieneKit.webp -------------------------------------------------------------------------------- /public/images/volunteer1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/volunteer1.png -------------------------------------------------------------------------------- /docs/images/gmaps-key-naming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/docs/images/gmaps-key-naming.png -------------------------------------------------------------------------------- /public/images/FallPrevention.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/FallPrevention.jpg -------------------------------------------------------------------------------- /public/images/HealthWorkshop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/HealthWorkshop.jpg -------------------------------------------------------------------------------- /public/images/Humanitarian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/Humanitarian.jpg -------------------------------------------------------------------------------- /public/images/keepInTouch.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/keepInTouch.jpeg -------------------------------------------------------------------------------- /public/images/ElectronicsDrop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/ElectronicsDrop.jpg -------------------------------------------------------------------------------- /public/images/FoodDistribution.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/FoodDistribution.jpg -------------------------------------------------------------------------------- /public/images/laptops-unsplash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/laptops-unsplash.png -------------------------------------------------------------------------------- /public/images/MHF-Color-300x300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/MHF-Color-300x300.png -------------------------------------------------------------------------------- /public/images/hotMealDaySection.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/hotMealDaySection.jpeg -------------------------------------------------------------------------------- /public/images/hotmeals-unsplash.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/hotmeals-unsplash.jpeg -------------------------------------------------------------------------------- /public/images/large-info-section.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/large-info-section.png -------------------------------------------------------------------------------- /public/images/marguerite_960_720.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/marguerite_960_720.webp -------------------------------------------------------------------------------- /.deepsource.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | 3 | [[analyzers]] 4 | name = "javascript" 5 | enabled = true 6 | 7 | [analyzers.meta] 8 | plugins = ["react"] 9 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 2, 4 | "semi": true, 5 | "singleQuote": true, 6 | "endOfLine": "lf" 7 | } 8 | -------------------------------------------------------------------------------- /docs/images/gmaps-key-restrictions-dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/docs/images/gmaps-key-restrictions-dev.png -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:16 2 | RUN mkdir /home/node/app 3 | 4 | WORKDIR /home/node/app 5 | 6 | COPY package.json yarn.lock ./ 7 | 8 | RUN yarn install 9 | -------------------------------------------------------------------------------- /docs/images/gmaps-key-restrictions-prod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/docs/images/gmaps-key-restrictions-prod.png -------------------------------------------------------------------------------- /lint-staged.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | '*.{js,jsx,ts,tsx}': ['prettier --write', 'eslint --fix'], 3 | '*.{md,css}': 'prettier --write', 4 | }; 5 | -------------------------------------------------------------------------------- /public/images/larm-rmah-AEaTUnvneik-unsplash.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/larm-rmah-AEaTUnvneik-unsplash.jpeg -------------------------------------------------------------------------------- /public/images/neonbrand-mqoLpeeYBic-unsplash.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/neonbrand-mqoLpeeYBic-unsplash.jpeg -------------------------------------------------------------------------------- /public/fonts/Source_Sans_Pro/SourceSansPro-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/fonts/Source_Sans_Pro/SourceSansPro-Bold.ttf -------------------------------------------------------------------------------- /public/fonts/Source_Sans_Pro/SourceSansPro-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/fonts/Source_Sans_Pro/SourceSansPro-Light.ttf -------------------------------------------------------------------------------- /public/images/joel-muniz-BlnpElo7clE-unsplash.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/joel-muniz-BlnpElo7clE-unsplash.jpeg -------------------------------------------------------------------------------- /public/images/joel-muniz-y3ZY6qFln_g-unsplash.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/joel-muniz-y3ZY6qFln_g-unsplash.jpeg -------------------------------------------------------------------------------- /public/images/tom-parsons-pVmjvK44Dao-unsplash.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/tom-parsons-pVmjvK44Dao-unsplash.jpeg -------------------------------------------------------------------------------- /public/images/tyler-lagalo-ZU94isADXDs-unsplash.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/tyler-lagalo-ZU94isADXDs-unsplash.jpeg -------------------------------------------------------------------------------- /.githooks/notice.md: -------------------------------------------------------------------------------- 1 | ### Important 2 | 3 | When adding new hooks to this directory, make sure that they are executable. 4 | 5 | ``` 6 | chmod +x .githooks/your-hook 7 | ``` 8 | -------------------------------------------------------------------------------- /public/fonts/Source_Sans_Pro/SourceSansPro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/fonts/Source_Sans_Pro/SourceSansPro-Regular.ttf -------------------------------------------------------------------------------- /public/images/ray-sangga-kusuma-7uSrOyY1U0I-unsplash.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/ray-sangga-kusuma-7uSrOyY1U0I-unsplash.jpeg -------------------------------------------------------------------------------- /public/images/streets-of-food-OvqrJgk0WQQ-unsplash.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margaritahumanitarian/helpafamily/HEAD/public/images/streets-of-food-OvqrJgk0WQQ-unsplash.jpeg -------------------------------------------------------------------------------- /models/routes.js: -------------------------------------------------------------------------------- 1 | export const Routes = { 2 | Home: '/', 3 | InKind: '/in-kind', 4 | Fund: '/fund', 5 | GiveYourTime: '/give-your-time', 6 | PartnerWithUs: '/partner-with-us', 7 | }; 8 | -------------------------------------------------------------------------------- /utils/isAvailable.js: -------------------------------------------------------------------------------- 1 | export function isAvailable(value) { 2 | return ( 3 | value != null || 4 | value != undefined || 5 | (typeof value === 'string' && value.strip() != '') 6 | ); 7 | } 8 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | services: 3 | app: 4 | build: . 5 | ports: 6 | - 3000:3000 7 | volumes: 8 | - .:/home/node/app 9 | - /home/node/app/node_modules 10 | command: yarn dev 11 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | // If you want to use other PostCSS plugins, see the following: 2 | // https://tailwindcss.com/docs/using-with-preprocessors 3 | module.exports = { 4 | plugins: { 5 | tailwindcss: {}, 6 | autoprefixer: {}, 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "baseUrl": ".", 6 | "paths": { 7 | "@components/*": ["./components/*"] 8 | } 9 | }, 10 | "exclude": ["node_modules"] 11 | } 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG] " 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **What happened?** 11 | 12 | **Steps to reproduce** 13 | 1. Click xyz 14 | 15 | **What did you expect to happen?** 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/idea-suggestion.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Idea suggestion 3 | about: Suggest an idea for this project 4 | title: "" 5 | labels: idea 6 | assignees: '' 7 | 8 | --- 9 | 10 | **What should we change and why?** 11 | 12 | **Please list any other [issues](https://github.com/margaritahumanitarian/helpafamily/issues) this may be related to** 13 | - #Issue_number 14 | -------------------------------------------------------------------------------- /constants/heroImages.js: -------------------------------------------------------------------------------- 1 | const heroImages = [ 2 | '/images/joel-muniz-BlnpElo7clE-unsplash.jpeg', 3 | '/images/ray-sangga-kusuma-7uSrOyY1U0I-unsplash.jpeg', 4 | '/images/larm-rmah-AEaTUnvneik-unsplash.jpeg', 5 | '/images/joel-muniz-y3ZY6qFln_g-unsplash.jpeg', 6 | '/images/streets-of-food-OvqrJgk0WQQ-unsplash.jpeg', 7 | '/images/joel-muniz-y3ZY6qFln_g-unsplash.jpeg', 8 | '/images/tyler-lagalo-ZU94isADXDs-unsplash.jpeg', 9 | ]; 10 | 11 | export default heroImages; 12 | -------------------------------------------------------------------------------- /.githooks/post-checkout: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | updatedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" 4 | Color_Off='\033[0m' 5 | Yellow='\033[0;33m' 6 | 7 | checkUpdates() { 8 | echo "$updatedFiles" | grep --quiet "$1" && eval "$2" 9 | } 10 | 11 | packageJsonUpdated() { 12 | echo -e "${Yellow}Your package.json has changed.. \nConsider running 'npm install' or 'yarn install' ;)${Color_Off}" 13 | } 14 | 15 | checkUpdates package.json packageJsonUpdated 16 | -------------------------------------------------------------------------------- /.github/workflows/format.yml: -------------------------------------------------------------------------------- 1 | name: Format 2 | on: 3 | push: 4 | branches: [main] 5 | jobs: 6 | format: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - uses: actions/setup-node@v2 11 | with: 12 | node-version: "14.x" 13 | - run: yarn install 14 | - run: yarn format 15 | - name: Commit changes 16 | uses: stefanzweifel/git-auto-commit-action@v4 17 | with: 18 | commit_message: Apply formatting changes 19 | 20 | -------------------------------------------------------------------------------- /pages/in-kind.js: -------------------------------------------------------------------------------- 1 | import Card from '@components/Card'; 2 | import React from 'react'; 3 | 4 | import CardsLayout from '../components/CardsLayout'; 5 | import PrimaryLayout from '../components/PrimaryLayout'; 6 | import cards from '../data/InkindCardsData.json'; 7 | 8 | export default function InKindPage() { 9 | return ( 10 | 11 | 12 | {cards.data.map((cardData) => ( 13 | 14 | ))} 15 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /lighthouserc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ci: { 3 | collect: { 4 | startServerCommand: 'yarn start', 5 | url: ['http://localhost:3000'], 6 | }, 7 | assert: { 8 | assertions: { 9 | 'categories:performance': ['error', { minScore: 0.9 }], 10 | 'categories:accessibility': ['error', { minScore: 0.8 }], 11 | 'categories:best-practices': ['error', { minScore: 0.92 }], 12 | 'categories:seo': ['error', { minScore: 0.9 }], 13 | }, 14 | }, 15 | upload: { 16 | target: 'temporary-public-storage', 17 | }, 18 | }, 19 | }; 20 | -------------------------------------------------------------------------------- /pages/give-your-time.js: -------------------------------------------------------------------------------- 1 | import Card from '@components/Card'; 2 | import React from 'react'; 3 | 4 | import CardsLayout from '../components/CardsLayout'; 5 | import PrimaryLayout from '../components/PrimaryLayout'; 6 | import cards from '../data/GiveyourTimeCardsData.json'; 7 | 8 | export default function GiveYourTimePage() { 9 | return ( 10 | 11 | 12 | {cards.data.map((cardData) => ( 13 | 14 | ))} 15 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### This PR: 2 | 3 | 4 | ### Self-Review Checklist 5 | 6 | - [ ] PR title is clear with proper spelling and grammar 7 | - [ ] PR description contains a bulleted list of changes contained in the PR 8 | - [ ] PR links to relevant issues, with keywords to auto-close any issues fully resolved upon merge 9 | - [ ] All automated checks passed 10 | - [ ] Any variables introduced are named clearly and explicitly 11 | -------------------------------------------------------------------------------- /components/TestimonialCard.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import Image from 'next/image'; 3 | 4 | const TestimonialCard = ({ content, image, title }) => { 5 | return ( 6 |
7 |
8 | testimonial 16 |
17 |
18 |

{title}

19 |
20 |

{content}

21 |
22 |
23 |
24 | ); 25 | }; 26 | 27 | export default TestimonialCard; 28 | -------------------------------------------------------------------------------- /components/Astronaut/astronaut.spec.js: -------------------------------------------------------------------------------- 1 | require('jest-canvas-mock'); 2 | import Astronaut from './'; 3 | import { REGULAR_LOTTIE_DIMENSIONS } from './constants'; 4 | import { render } from '@testing-library/react'; 5 | 6 | describe('Test Astronaut component', () => { 7 | it('should have correct lottie width', () => { 8 | window.innerWidth = 1000; 9 | const { getByLabelText } = render(); 10 | expect(getByLabelText('animation')).toHaveStyle( 11 | `width: ${REGULAR_LOTTIE_DIMENSIONS}px` 12 | ); 13 | }); 14 | it('should have correct lottie width when resized to mobile screen', () => { 15 | window.innerWidth = 400; 16 | const { getByLabelText } = render(); 17 | expect(getByLabelText('animation')).toHaveStyle('width: 100%'); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /.github/workflows/coverage.yml: -------------------------------------------------------------------------------- 1 | name: Running Code Coverage 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | strategy: 10 | matrix: 11 | node-version: [14.x] 12 | 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v2 16 | with: 17 | fetch-depth: 2 18 | 19 | - name: Set up Node.js ${{ matrix.node-version }} 20 | uses: actions/setup-node@v1 21 | with: 22 | node-version: ${{ matrix.node-version }} 23 | 24 | - name: Install dependencies 25 | run: yarn 26 | 27 | - name: Run the tests 28 | run: yarn test:coverage 29 | 30 | - name: Upload coverage to Codecov 31 | uses: codecov/codecov-action@v2 32 | with: 33 | file: ./coverage/clover.xml 34 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | STRIPE_SECRET_KEY = "sk_test_51JJ3vNLOlCyqSHKrp2vu93c9YzrXxDq7otphDYZqQTE10eZ0GsiVPJPxEOYOHEIBsMW9qjvtIZGPM2pcJTaYulvE00MlBr7pi9" 2 | CANCEL_URL = "https://helpafamily.margaritahumanitarian.org/" 3 | SUCCESS_URL = "https://helpafamily.margaritahumanitarian.org/thank-you" 4 | NEXT_PUBLIC_GMAPS_JS_API_KEY = "" 5 | FORM_ID = "XYZ" 6 | 7 | CONTENTFUL_ENVIRONMENT = "XYZ" 8 | CONTENTFUL_SPACE_ID = "XYZ" 9 | CONTENTFUL_ACCESS_TOKEN = "XYZ" 10 | 11 | // Generate these values in the Firebase console: 12 | // PROJECT SETTINGS > Firebase Admin SDK > Generate new private key 13 | // Creates a downloadable JSON FILE that contains these values 14 | FIREBASE_PROJECT_ID = "XYZ" 15 | FIREBASE_PRIVATE_KEY_ID = "XYZ" 16 | FIREBASE_PRIVATE_KEY = "XYZ" 17 | FIREBASE_CLIENT_EMAIL = "XYZ" 18 | FIREBASE_CLIENT_ID = "XYZ" 19 | FIREBASE_CLIENT_X509_CERT_URL = "XYZ" -------------------------------------------------------------------------------- /hooks/useStripeSession.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useRouter } from 'next/router'; 3 | 4 | const dollarsToCentsMultiplier = 100; 5 | 6 | const useStripeSession = () => { 7 | const [isPending, setIsPending] = React.useState(false); 8 | const router = useRouter(); 9 | 10 | const handleSubmit = async ({ amount, cause }) => { 11 | setIsPending(true); 12 | 13 | const response = await fetch('/api/create-stripe-session', { 14 | body: JSON.stringify({ 15 | amount: amount * dollarsToCentsMultiplier, 16 | cause, 17 | }), 18 | headers: { 19 | 'Content-Type': 'application/json', 20 | }, 21 | method: 'POST', 22 | }); 23 | 24 | const result = await response.json(); 25 | 26 | setIsPending(false); 27 | router.push(result.url); 28 | }; 29 | 30 | return [handleSubmit, isPending]; 31 | }; 32 | 33 | export default useStripeSession; 34 | -------------------------------------------------------------------------------- /firebase.config.js: -------------------------------------------------------------------------------- 1 | import admin from 'firebase-admin'; 2 | 3 | const secret = { 4 | type: 'service_account', 5 | project_id: process.env.FIREBASE_PROJECT_ID, 6 | private_key_id: process.env.FIREBASE_PRIVATE_KEY_ID, 7 | private_key: process.env.FIREBASE_PRIVATE_KEY, 8 | client_email: process.env.FIREBASE_CLIENT_EMAIL, 9 | client_id: process.env.FIREBASE_CLIENT_ID, 10 | auth_uri: 'https://accounts.google.com/o/oauth2/auth', 11 | token_uri: 'https://oauth2.googleapis.com/token', 12 | auth_provider_x509_cert_url: 'https://www.googleapis.com/oauth2/v1/certs', 13 | client_x509_cert_url: process.env.FIREBASE_CERT_URL, 14 | }; 15 | 16 | if (!admin.apps.length) { 17 | try { 18 | admin.initializeApp({ 19 | credential: admin.credential.cert(secret), 20 | }); 21 | } catch (error) { 22 | console.log('Firebase admin initialization error', error.stack); 23 | } 24 | } 25 | 26 | export default admin.firestore(); 27 | -------------------------------------------------------------------------------- /pages/api/create-stripe-session.js: -------------------------------------------------------------------------------- 1 | import { StatusCodes } from 'http-status-codes'; 2 | 3 | const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY); 4 | 5 | export default async function stripeCheckoutSessionCreate(req, res) { 6 | const session = await stripe.checkout.sessions.create({ 7 | payment_method_types: ['card'], 8 | line_items: [ 9 | { 10 | price_data: { 11 | currency: 'usd', 12 | product_data: { 13 | name: `Help ${req.body.cause}`, 14 | }, 15 | unit_amount: req.body.amount, 16 | }, 17 | quantity: 1, 18 | }, 19 | ], 20 | metadata: { 21 | cause: `Help ${req.body.cause}`, 22 | }, 23 | // mode: 'subscription', 24 | mode: 'payment', 25 | success_url: process.env.SUCCESS_URL, 26 | cancel_url: process.env.CANCEL_URL, 27 | }); 28 | 29 | res.status(StatusCodes.OK).json({ url: session.url }); 30 | } 31 | -------------------------------------------------------------------------------- /components/PrimaryLayout.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React from 'react'; 3 | 4 | import Footer from './Footer'; 5 | import HeroSection from './HeroSection'; 6 | import Navbar from './Navbar'; 7 | import { useContextTheme } from './ThemeContext'; 8 | 9 | export default function PrimaryLayout({ 10 | main = false, 11 | image, 12 | inNeed = false, 13 | children, 14 | }) { 15 | const { backgroundColor, textColor } = useContextTheme(); 16 | return ( 17 | <> 18 |
19 | 20 |
21 | 22 | {children} 23 |
24 |
25 |
26 | 27 | ); 28 | } 29 | 30 | PrimaryLayout.propTypes = { 31 | children: PropTypes.node.isRequired, 32 | }; 33 | -------------------------------------------------------------------------------- /components/email/Thankyou.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import SurveyContainer from './SurveyContainer'; 3 | import { useContextTheme } from '@components/ThemeContext'; 4 | 5 | const Thankyou = () => { 6 | const { textColor } = useContextTheme(); 7 | return ( 8 | 9 |
12 | {'Thank you for submitting your survey!'} 13 |
14 |
15 | ); 16 | }; 17 | 18 | export const ThankyouAgain = () => { 19 | const { textColor } = useContextTheme(); 20 | return ( 21 | 22 |
25 | {'Thank you Again!'} 26 |
27 |
28 | ); 29 | }; 30 | export default Thankyou; 31 | -------------------------------------------------------------------------------- /components/LaptopForFamiliesCard.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Card from './Card'; 4 | 5 | function LaptopForFamiliesCard({ simulateHover }) { 6 | return ( 7 | 19 | ); 20 | } 21 | 22 | export default LaptopForFamiliesCard; 23 | 24 | /* {`Donate`} */ 25 | -------------------------------------------------------------------------------- /data/laptop-cities.json: -------------------------------------------------------------------------------- 1 | { 2 | "cities": [ 3 | { 4 | "name": "Palmdale", 5 | "latitude": 34.5794, 6 | "longitude": -118.1164 7 | }, 8 | { 9 | "name": "Riga", 10 | "latitude": 56.9496, 11 | "longitude": 24.1052 12 | }, 13 | { 14 | "name": "San Francisco", 15 | "latitude": 37.7749, 16 | "longitude": -122.4194 17 | }, 18 | { 19 | "name": "Los Angeles", 20 | "latitude": 34.0522, 21 | "longitude": -118.2437 22 | }, 23 | { 24 | "name": "Bremen", 25 | "latitude": 53.0796, 26 | "longitude": 8.7813 27 | }, 28 | { 29 | "name": "Bulverde", 30 | "latitude": 43.5, 31 | "longitude": -5.5 32 | }, 33 | { 34 | "name": "Houston", 35 | "latitude": 29.7628, 36 | "longitude": -95.3832 37 | }, 38 | { 39 | "name": "Layton", 40 | "latitude": 41.6826, 41 | "longitude": -111.9735 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /components/HygieneKitsCard.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Card from './Card'; 4 | 5 | function HygieneKitsCard({ simulateHover }) { 6 | return ( 7 | 21 | ); 22 | } 23 | 24 | export default HygieneKitsCard; 25 | -------------------------------------------------------------------------------- /components/email/Questions.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useContextTheme } from '@components/ThemeContext'; 3 | 4 | export default function Questions({ 5 | inputValue, 6 | inputOnChangeFunction, 7 | question, 8 | }) { 9 | const { textColor } = useContextTheme(); 10 | return ( 11 | <> 12 |
13 |
{question}
14 |
15 |
16 |