Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/update ui and use latest live package for demo app #17

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion open-giving/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@opentelemetry/api": "^1.6.0",
"chimoney-payment-widget": "^0.0.28",
"next": "^12.2.5",
"non-profit-donations": "^0.0.6",
"non-profit-donations": "latest",
"qrcode.react": "^4.0.1",
"react": "^18",
"react-dom": "^18",
Expand Down
5 changes: 2 additions & 3 deletions open-giving/src/hooks/useDonation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PaymentWidget from 'chimoney-payment-widget';
import { useRouter } from 'next/router';
import { useState } from 'react';

import donationHandlers from '../../../build/main/lib/donationHandlers';
import { handlers } from 'non-profit-donations';

const useDonation = (method, setSnackbarMessage, setSnackbarOpen) => {
const router = useRouter();
Expand Down Expand Up @@ -79,8 +79,7 @@ const useDonation = (method, setSnackbarMessage, setSnackbarOpen) => {

openPaymentWidget(result.data.paymentLink);
} else {
const handler =
donationHandlers[method.donationHandler || 'copyToClipboard'];
const handler = handlers[method.donationHandler || 'copyToClipboard'];
if (handler) {
const result = await handler(method, {
amount: donationAmount,
Expand Down
2 changes: 1 addition & 1 deletion open-giving/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Box, Container, Pagination, Snackbar } from '@mui/material';
import { useRouter } from 'next/router';
import { verifiedNonprofits } from 'non-profit-donations';
import React, { useEffect, useState } from 'react';

import { verifiedNonprofits } from '../../../build/main/index';
import FilterAccordion from '../components/FilterAccordion';
import Header from '../components/Header';
import Layout from '../components/Layout';
Expand Down
8 changes: 4 additions & 4 deletions open-giving/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2778,10 +2778,10 @@ next@^12.2.5:
"@next/swc-win32-ia32-msvc" "12.3.4"
"@next/swc-win32-x64-msvc" "12.3.4"

non-profit-donations@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/non-profit-donations/-/non-profit-donations-0.0.6.tgz#14acb63168a1bd44d2120e25f0b5f5255a79e871"
integrity sha512-tjpIdtGuV9q/9IfNLHpZMV16n7u3BZAKuOFQn0Tif31/lUufKGcB8EyR4Fr8RBd8x1YfRXT9Lo8JjCeftEjxOQ==
non-profit-donations@^0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/non-profit-donations/-/non-profit-donations-0.0.7.tgz#ffe9f9e00909a6da4d44af98a30c544bd53b8db0"
integrity sha512-ToTclTjBCUkCyvOOg49uz5qUJmsdk9McbxkI/CauV5IEDGHEMFXlteSxDlfMWKNa8jT9D6AcVt9gMw9hBa29JQ==
dependencies:
"@bitauth/libauth" "^1.17.1"
commitizen "^4.2.4"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "non-profit-donations",
"version": "0.0.7",
"version": "0.0.8",
"description": "Support non-profits globally. Get the details of verified non profits to support",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
Expand Down
4 changes: 1 addition & 3 deletions src/lib/donationHandlerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DonationHandler } from '../types/donation-handler';

import defaultDonationHandlers from './defaultDonationHandlers';

const handlers: Record<string, DonationHandler> = {
export const handlers: Record<string, DonationHandler> = {
...defaultDonationHandlers,
};

Expand All @@ -14,5 +14,3 @@ export function registerHandler(type: string, handler: DonationHandler) {
export function getHandler(type: string): DonationHandler | undefined {
return handlers[type];
}

// Remove the class and the donationHandlerManager instance
24 changes: 0 additions & 24 deletions src/lib/donationHandlers.ts

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"typeRoots": ["node_modules/@types", "src/types"]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**", "donation-ui/**"],
"exclude": ["node_modules/**", "open-giving/**"],
"compileOnSave": false
}
2 changes: 1 addition & 1 deletion tsconfig.module.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"outDir": "build/module",
"module": "esnext"
},
"exclude": ["node_modules/**", "donation-ui/**"]
"exclude": ["node_modules/**", "open-giving/**"]
}
Loading