From 65d65b5363df42ea6a0bc68a4ae112e3fe88cc79 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Fri, 19 Jul 2024 20:05:38 +0800 Subject: [PATCH 01/47] Disable tracking in `/donate-widget` (#3163) * move script to Seo component * override seo in widget page * remove duplicate route * override when inside widget route * donate widget override --- src/pages/DonateWidget/DonateWidget.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/DonateWidget/DonateWidget.tsx b/src/pages/DonateWidget/DonateWidget.tsx index e5c02509cb..d90cadd203 100644 --- a/src/pages/DonateWidget/DonateWidget.tsx +++ b/src/pages/DonateWidget/DonateWidget.tsx @@ -1,5 +1,6 @@ import LoaderRing from "components/LoaderRing"; import QueryLoader from "components/QueryLoader"; +import Seo from "components/Seo"; import { ErrorStatus } from "components/Status"; import { idParamToNum } from "helpers"; import { useEffect } from "react"; @@ -44,6 +45,7 @@ export default function DonateWidget() { }} className="grid grid-rows-[1fr_auto] justify-items-center gap-10" > + Date: Tue, 23 Jul 2024 10:20:21 +0800 Subject: [PATCH 02/47] Auth redirect (#3165) * move hub to app * use hub state instead of local storage * convert to uncontrolled * add isNpo flag * password input autocomplete requirement * autocomplete requirement * state -> fromState * state -> fromState * trigger vaidation when clicking google signin * move user type to top * auth redirect * add comment --- src/index.tsx | 2 ++ src/pages/OAuthRedirector.tsx | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 222ae50add..9bb4abd5a6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -30,6 +30,8 @@ Amplify.configure(amplifyConfig); const container = document.getElementById("root"); const root = createRoot(container as Element); +Amplify.configure(amplifyConfig); + Sentry.init({ dsn: process.env.PUBLIC_SENTRY_DSN, environment: process.env.PUBLIC_ENVIRONMENT, diff --git a/src/pages/OAuthRedirector.tsx b/src/pages/OAuthRedirector.tsx index 46e8fe4518..1c9f21177d 100644 --- a/src/pages/OAuthRedirector.tsx +++ b/src/pages/OAuthRedirector.tsx @@ -1,4 +1,5 @@ import LoaderRing from "components/LoaderRing"; +<<<<<<< HEAD export default function OAuthRedirector() { /** @@ -14,4 +15,31 @@ export default function OAuthRedirector() { classes={{ container: "w-32 place-self-center" }} /> ); +======= +import { Navigate, useLocation } from "react-router-dom"; +import type { OAuthState } from "types/auth"; + +export default function OAuthRedirector() { + const location = useLocation(); + + const state: OAuthState | null = location.state + ? JSON.parse(location.state) + : null; + + /** when provider (`A.`) redirects back to our app thru `/oauth-redirector` it doesn't pass `state` + * `A.` - Amplify is configured in src/index.tsx + * App.tsx listens to `auth.customOAuthState` event and navigates to `/oauth-redirector`, this time with `state` + */ + if (!state) { + return ( + + ); + } + + const { pathname = "/", data } = state || {}; + return ; +>>>>>>> ab7d97e0d (Auth redirect (#3165)) } From c7b094dff9511f94c5992ddc305ae1b9c4eb7f21 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:18:32 +0800 Subject: [PATCH 03/47] Email bugs (#3184) * switch to no cors: verified to be still running * move override further down --- src/pages/DonateWidget/DonateWidget.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/DonateWidget/DonateWidget.tsx b/src/pages/DonateWidget/DonateWidget.tsx index d90cadd203..e5c02509cb 100644 --- a/src/pages/DonateWidget/DonateWidget.tsx +++ b/src/pages/DonateWidget/DonateWidget.tsx @@ -1,6 +1,5 @@ import LoaderRing from "components/LoaderRing"; import QueryLoader from "components/QueryLoader"; -import Seo from "components/Seo"; import { ErrorStatus } from "components/Status"; import { idParamToNum } from "helpers"; import { useEffect } from "react"; @@ -45,7 +44,6 @@ export default function DonateWidget() { }} className="grid grid-rows-[1fr_auto] justify-items-center gap-10" > - Date: Sat, 3 Aug 2024 09:11:44 +0800 Subject: [PATCH 04/47] Chariot prod key requirements (#3198) * 50 usd min amount * summary skips * create dedicated chariot checkout form * use props namespace * modal dismissible * floor instead of ceil * set min * update test --- src/pages/OAuthRedirector.tsx | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/pages/OAuthRedirector.tsx b/src/pages/OAuthRedirector.tsx index 1c9f21177d..46e8fe4518 100644 --- a/src/pages/OAuthRedirector.tsx +++ b/src/pages/OAuthRedirector.tsx @@ -1,5 +1,4 @@ import LoaderRing from "components/LoaderRing"; -<<<<<<< HEAD export default function OAuthRedirector() { /** @@ -15,31 +14,4 @@ export default function OAuthRedirector() { classes={{ container: "w-32 place-self-center" }} /> ); -======= -import { Navigate, useLocation } from "react-router-dom"; -import type { OAuthState } from "types/auth"; - -export default function OAuthRedirector() { - const location = useLocation(); - - const state: OAuthState | null = location.state - ? JSON.parse(location.state) - : null; - - /** when provider (`A.`) redirects back to our app thru `/oauth-redirector` it doesn't pass `state` - * `A.` - Amplify is configured in src/index.tsx - * App.tsx listens to `auth.customOAuthState` event and navigates to `/oauth-redirector`, this time with `state` - */ - if (!state) { - return ( - - ); - } - - const { pathname = "/", data } = state || {}; - return ; ->>>>>>> ab7d97e0d (Auth redirect (#3165)) } From 46a4d3fd804a38b465a26cebd3cbc2418320c3f7 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:06:41 +0800 Subject: [PATCH 05/47] BG-1511: Fix Oauth stuck on /auth-redirector (#3204) * upgrade to v6 router * navigate * admin to lazy api * lazy load more page * to router lazy * lazy load more route * Donate widget * done using router lazy * avoid assigning to variable component * revert file renameing * fix test * add register routes * nested registration steps * use fireevent instead * switch to object notation * more accurate type * adminRoutes * media routs * gift route * profile routes * Routes freegit add . * lazy load * update sentry * remove console log * missign editor * signup lazy * bank application lazy * donate widget * catch all route * amplify at top --- src/index.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 9bb4abd5a6..222ae50add 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -30,8 +30,6 @@ Amplify.configure(amplifyConfig); const container = document.getElementById("root"); const root = createRoot(container as Element); -Amplify.configure(amplifyConfig); - Sentry.init({ dsn: process.env.PUBLIC_SENTRY_DSN, environment: process.env.PUBLIC_ENVIRONMENT, From b7d594408fcfdcc1df132b3b511741d5ec16c0a1 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Thu, 8 Aug 2024 18:40:32 +0800 Subject: [PATCH 06/47] Cherry fixes (#3219) * v2.4.1 (#3162) * Admin member names (#3159) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widget content * doante state to be constructed inside * use intent instead * remove reducer * state shape * crypto sender * hello * tip format * clearer state * merge or replace * working fiat intent * remove redundant * remove unwanted * add mode * to switch * fixes * daf and stocks doesnt skip * add loader * remoev unused comment * convert widget slice to plain state * set init state instead * skip split * remove comment * remove unsed * resume no longer need intermediary donation loader page * info comment * add recipientId * apply skips on back * revert crypto checkout * revert stripe checkout * revert stripe checkout * tx submit loading * reset tip on token change * change comment loctin * tip back to donate form if skipped * revert rename * remove unsed comment * remove unused omit * verbose comment * revert optional * remove intent after loading * fetch hide tip config * info * split desc * testimonial copy fixes (#3007) * BG-1357: DB Split settings (#3008) * render slider * split fix flag * fix check field * change type and adjust (#3006) * add in donation state * mix db value to widget value * add label * revert mixup * standalone source attr * format * revert for endow option * take inverse * fee corrected & copy updates in Admin Settings (#3016) * Payout min edit UI (#3015) * update type and add field * add placeholder * add spacing * Methods widget config (#3017) * add method types * donate methods widget config * remove unused * order configurer component * format * error message * error msg * fix bug * no need for whole mthod * revert smaple * error msg * Donate methods admin setting (#3018) * move comp and helper * sort * reuse in settings page * doante page use setting * update link (#3009) * swap tab name (#3019) * distinguish supported/unsupported * qr token type * format * switch to chainId map * reverts * generic donate thanks * add spacing * create intent on direct donation * add space * rename * remove as const * format * Add lefthook git hooks (#3020) * lefthook install and config * hello world * hello world * add glob * ehello world * x * x * test * test * test * testunused * testunused * Endow videos UI (#3021) * media endpoints * use v1 * media page and route * container and header * featured video container * video adder modal * show modal * add video wiring * paginated videos * edit pros * video preview * videos nested * adder to edidtor * update payload * init params * responsive video * toggle featured * increase card per row * add disabled * pagination limit * render videos in profile * edit albel * BG-1374: admin settings tweaks (#3033) * 5 rows * separator heading * move payout minimum * remove unused * switch from Algolia >> CloudSearch (#3034) * Widget custom title and description (#3035) * udpate checkfield style * parse description in widget page * add onChange check field * title and description fields * show fallback if empty * get recipient addr * revert additional wallets * direct button primary accent --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Andrey Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Program metrics (#3041) * add new attributes * target raise edit field * program tally * targetRaise is nullable * unset targetRaise * Update src/pages/Admin/Charity/ProgramEditor/ProgramInfo/ProgramInfo.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * nav dropdown label fixes * BG-1381: Program selector in widget (#3049) * export program selector * load everythig * add in snippet program id * add prog field * parse program id * program initial state widget * add on loaded * update stocks schema * update stocks schema * remove unused * ignore lint * preview selected program * BG-1383 BG-1384 minor fixes (#3051) * User bookmarks (#3052) * remove old type * bookmarks update * bookmarks btn * bookmarks list * bookmarks lists * userId from jwt * favorite -> profile * update endpoints * Header search V1 (#3054) * convert to input * show on focus * update styles * remain open when hovered * marketplace context * convert to context * remoev log * marketplace flag * endowments search * unitialized as loading * separate search component * search dropdown component * propagate search to marketplace * link home and marketplace query * debounce happens in useCards * BG-1385 WP Plugin doc page (#3053) * WP Plugin Documentation page * remove import * clean up table * address PR feedback * fix typo * add top countries (#3065) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 402c3d5b7161c68616482fc5a5e63839f1ba58ff. * Update deps (#3066) * batch one updates * update deps * replace iwth write * BG-1393: UK aid UI (#3068) * batch one updates * update deps * replace iwth write * uk fields * shown checkbox not crypto * form donor and server format * change format * donor address apes * add annotation * Update src/components/donation/Steps/Summary/DonorForm.tsx --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Display top countries (#3070) * endpoint * top countries data-access * new chains integrated (#3080) * new chains updated * add chains to other types * update rest of token/chain items; add stargaze/kujira testnets; * add new chains to keplr wallet * BG-1390: Cards v2 (#3081) * remove implicit fields * card content * bookmark btn improvement * link and button within card * bookmark btn optimistic update * comments * fix arg * remove decimal * Custom tokens UI (#3069) * coin gecko query * token search component * add name and logo * add coingecko platformId * add static list * temp remove queyr * warning * use fuse for search * remove coins * max size * init token not required * add example * file size * proceed button * dont format json * set as token * ignore json * no need for amount * remoev custom solana xrp * platformId * udpate coins * usd rate --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Chain selector (#3082) * add logos * chain combobox * use new chain selector * option chainId to chainId * value chainId * Osmosis support added (#3084) * add osmosis chains * post-fix 'Testnet' to unsupported chain name (when applicable) * Headless UI v2 (#3085) * headless ui * done batch one * done coutnries * done batch two * done batch 3 * done batch 4 * chain selector scroller click * token options scroll click fix * max height * remove extra border * downgrade yarn * fix program hidden * combobox null value * 2.1.0 transition built in dialog --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Add coinbase extension wallet (#3087) * update icons * use 6963 and add coinbase * update icon imports * unload after switching error --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * QR copy (#3088) * add QR warning * more readable * In honor of field (#3089) * honor field * set from intent * closer to label * close to lable * rename form * wiring * Fix token selector search and updates (#3091) * combobox inside popover * search icon on right * rename interface * BG-1417: Cheque FAQ (#3105) * add content * faq content * BG-1423: chain selector updates (#3104) * change type and adjust for chainId '' * shorter * sort chains * display and focus on error * Network dropdown bug fixes (#3106) * add immediate to open on focus * remove hidden input * WP url updated * BG-1424: Improve token search (#3102) * add not listed * mixed * virtualized * per chain json file * biome ignore * add missing * add token placeholder * spacing * Revert "WP url updated" This reverts commit ffb68148308d6078a762e0741cc779814c854ff2. * upgrade to signclient (#3103) * Network select should focus first when all is error (#3109) * more flexible api * use new api * selector value is chainId * remove hookform context * Donate crash + cherry pick from master (#3108) * make default values required * remove undefined * remove placeholder (#3039) * BG-1380: share fixes (#3040) * remove excess * lines and punctuations * handles and notes * BG-1382: Users unable to create programs occasionally (#3050) * fetch new token * comment * refresh token every 5 minutes * add ms multiplier (#3067) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 3ecb5d0958a5645a1ddda2d2d6284883362c13d9. * fix source (#3083) --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Crypto form integration test (#3110) * init test and mocks * persisted state * empty form validation msgs * prior to selecting token * error correcting * remove test id * BG-1399: Stripe status handling for manual bank verification (#3107) * Update stripe payment status API to use latest version * Added verify bank account button to 'pending' tab in My Donations * Add 'arrivalDate' in Donations Thanks page * Donation Thanks Page for 'requires_action' status and logged in donor * Show bank verification link for guest donors on thank you page * Removed redundant comment * Renamed 'Verify Bank Account' to 'Action' * Removed unused import * Add type def for specific bank verification fields * Add wordpress assets to post page (#3090) * add in public assets and load via react helmet * remove extra space * dry input * preserve header and footer style --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Stripe form integration test (#3111) * update currency selector with accessible headless components * extract rhf from field * no rhf stripe form * add missing error * rhf hook * rhf * should focus * init setup * prefilled state * validation test and increments * stripe form loading and error * Node proxies (#3113) * optimism proxy * revert mistake * base proxy * terra proxies * stargaze and juno, compress lcd,rpc to nodeUrl * osmosis * kujira * update terra * Add 'ukGiftAid' field in fiat donation payload (#3121) * WP URL updated * Cover processing fee UI (#3112) * processing fees * fee allowance on intent * fix type errors * fee allowance checkbox * flatten * save as fee allowance instead of bool * processing fee row * fee allowance row * remove console log * add fee allowance to estimate gross amount * add to deps list * tip doesnt disable processign fee * total include processing fee * parent set border child set individual padding * no need for custom bottom margin * psersistend state doesnt drive UI show * fix ts error * Copy tweak --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1437: Tribute notif UI (#3122) * fix: pass type * form elements * schema and field sizing * remove unused import * init tribute * stripe checkout tribute wiring * wiring crypto * fix spacing * fix initial size of * msg char counter * FIX: header footer styles (#3124) * only apply wp override in /blog * only apply wp override on /blog * only to blog/:slug * stocks form test (#3126) * Async chain (#3123) * update definition and adjust consumers * cached get chain options * use token definition * only pick subset * actual url * New donations table fields (#3125) * Update '/ap/donations.ts' types with new fields * Fix 'Action' column for fiat bank verification url in mobile table * Fix 'Action' column for fiat bank verification url in donations table * Added 'Recurring' column for donor My Donations tables * Added 'Direct Donation' and 'SF Donation' columns for donor My Donations tables * Added 'appUsed' in nonprofit My Donations table * Added 'paymentMethod' in nonprofit My Donations table * Added 'isRecurring' in nonprofit My Donations table * Single csv report * Add other fields into nonprofit Donations table * Fix 'Load More' button to span full width of table * DAF form test + MSW mocking (#3127) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * Add staging endpoint for S3 file uploading (#3139) * Donate steps - test skips and resets (#3128) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * compress images and use webp format (#3140) * Stripe checkout test - error paths (#3141) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused * client secret loading * by test id * separate file * error * error modals * donate btn * remove debug * UI updates (#3142) * rounded widget form * common donor terms * reuse in preview * update words * revert order * BG-1452: CC always goes along with DAF (#3145) * tooltip detail * cc locking * append stripe if applicable * add cc if daf && no cc * Summary form integration test (#3146) * factor out selector * no form context field and selector * native checkfield * keep description * add accessible error message * uk gift aid test * done tribute fields * top level * Payment tab label: card >> card/bank * init lock (#3147) * Update donations tables (#3144) * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for donor donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO csv file * Set fill function as new 'replaceWithEmptyString' helper function * Updated csv file fields for donor donations * Updated payment method values for NPO donations table and csv file * Changed csv value for 'Donation Origin' to be the same with corresponding NPO donation table column * Set 'Finish Paying' column name to 'Action' for donor intent table * Removed excess '- - -' which consumes 1 column for intent and finalized donor tabs * Set bank verification url action as a button * Update 'Network' column to 'Donation Type' column for donor donations table * Display date in csv file as it appears in respective donation tables for donor and NPO * Display amounts in csv files to 2 decimal places - both NPO and donor tables * Deleted unused 'paymentMethod' helper function and rolled back changes to NPO donations table for donation type * Update column name 'Network' to 'Donation Type' for donor donations table csv * Set 'Finish Paying' column name to 'Action' for donor intent mobile table * Summary step integration test (#3148) * coin gecko mock handlers * test rows * auth cases * descripbe name * use waitFor instead --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Alerts opt out (#3149) * settings route * detailed endows endpoint * userId * alert row * submit handler * query * reuse in endowment link * default checked * update wiring * bump to v3 * add success prompt * preserve bookmark link * correct route * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/EndowAlertForm.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * lint fix * spacing --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * endow admin object * handle overflow * bump v2 --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Terms move from page to checkout (#3160) * t&c in each checkout screen * remove in /donate page * donate widget page remove * widget preview remove * remove unused * remove unused import * donation terms move closer * temp hide UK GiftAid checkbox (#3161) * temp hide UK GiftAid checkbox * temp disable UK GiftAid Tests --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * v2.4.2 (#3181) * Disable tracking in `/donate-widget` (#3163) * move script to Seo component * override seo in widget page * remove duplicate route * override when inside widget route * donate widget override * `Login` consistency (#3164) * login consistency * vitest upgrade * Auth redirect (#3165) * move hub to app * use hub state instead of local storage * convert to uncontrolled * add isNpo flag * password input autocomplete requirement * autocomplete requirement * state -> fromState * state -> fromState * trigger vaidation when clicking google signin * move user type to top * auth redirect * add comment * protected redirects to signup (#3178) * No edit name (#3177) * disable and add tooltip * bump version * use prompts instead (#3179) * Program info in summary (#3180) * accept program * render program * provide program value --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Bg1489 faqs (#3183) * Email bugs (#3184) * switch to no cors: verified to be still running * move override further down --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * update linkedin tracker (#3199) * v2.4.3 (#3205) * DAF Checkout with chariot (#3143) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widget content * doante state to be constructed inside * use intent instead * remove reducer * state shape * crypto sender * hello * tip format * clearer state * merge or replace * working fiat intent * remove redundant * remove unwanted * add mode * to switch * fixes * daf and stocks doesnt skip * add loader * remoev unused comment * convert widget slice to plain state * set init state instead * skip split * remove comment * remove unsed * resume no longer need intermediary donation loader page * info comment * add recipientId * apply skips on back * revert crypto checkout * revert stripe checkout * revert stripe checkout * tx submit loading * reset tip on token change * change comment loctin * tip back to donate form if skipped * revert rename * remove unsed comment * remove unused omit * verbose comment * revert optional * remove intent after loading * fetch hide tip config * info * split desc * testimonial copy fixes (#3007) * BG-1357: DB Split settings (#3008) * render slider * split fix flag * fix check field * change type and adjust (#3006) * add in donation state * mix db value to widget value * add label * revert mixup * standalone source attr * format * revert for endow option * take inverse * fee corrected & copy updates in Admin Settings (#3016) * Payout min edit UI (#3015) * update type and add field * add placeholder * add spacing * Methods widget config (#3017) * add method types * donate methods widget config * remove unused * order configurer component * format * error message * error msg * fix bug * no need for whole mthod * revert smaple * error msg * Donate methods admin setting (#3018) * move comp and helper * sort * reuse in settings page * doante page use setting * update link (#3009) * swap tab name (#3019) * distinguish supported/unsupported * qr token type * format * switch to chainId map * reverts * generic donate thanks * add spacing * create intent on direct donation * add space * rename * remove as const * format * Add lefthook git hooks (#3020) * lefthook install and config * hello world * hello world * add glob * ehello world * x * x * test * test * test * testunused * testunused * Endow videos UI (#3021) * media endpoints * use v1 * media page and route * container and header * featured video container * video adder modal * show modal * add video wiring * paginated videos * edit pros * video preview * videos nested * adder to edidtor * update payload * init params * responsive video * toggle featured * increase card per row * add disabled * pagination limit * render videos in profile * edit albel * BG-1374: admin settings tweaks (#3033) * 5 rows * separator heading * move payout minimum * remove unused * switch from Algolia >> CloudSearch (#3034) * Widget custom title and description (#3035) * udpate checkfield style * parse description in widget page * add onChange check field * title and description fields * show fallback if empty * get recipient addr * revert additional wallets * direct button primary accent --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Andrey Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Program metrics (#3041) * add new attributes * target raise edit field * program tally * targetRaise is nullable * unset targetRaise * Update src/pages/Admin/Charity/ProgramEditor/ProgramInfo/ProgramInfo.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * nav dropdown label fixes * BG-1381: Program selector in widget (#3049) * export program selector * load everythig * add in snippet program id * add prog field * parse program id * program initial state widget * add on loaded * update stocks schema * update stocks schema * remove unused * ignore lint * preview selected program * BG-1383 BG-1384 minor fixes (#3051) * User bookmarks (#3052) * remove old type * bookmarks update * bookmarks btn * bookmarks list * bookmarks lists * userId from jwt * favorite -> profile * update endpoints * Header search V1 (#3054) * convert to input * show on focus * update styles * remain open when hovered * marketplace context * convert to context * remoev log * marketplace flag * endowments search * unitialized as loading * separate search component * search dropdown component * propagate search to marketplace * link home and marketplace query * debounce happens in useCards * BG-1385 WP Plugin doc page (#3053) * WP Plugin Documentation page * remove import * clean up table * address PR feedback * fix typo * add top countries (#3065) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 402c3d5b7161c68616482fc5a5e63839f1ba58ff. * Update deps (#3066) * batch one updates * update deps * replace iwth write * BG-1393: UK aid UI (#3068) * batch one updates * update deps * replace iwth write * uk fields * shown checkbox not crypto * form donor and server format * change format * donor address apes * add annotation * Update src/components/donation/Steps/Summary/DonorForm.tsx --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Display top countries (#3070) * endpoint * top countries data-access * new chains integrated (#3080) * new chains updated * add chains to other types * update rest of token/chain items; add stargaze/kujira testnets; * add new chains to keplr wallet * BG-1390: Cards v2 (#3081) * remove implicit fields * card content * bookmark btn improvement * link and button within card * bookmark btn optimistic update * comments * fix arg * remove decimal * Custom tokens UI (#3069) * coin gecko query * token search component * add name and logo * add coingecko platformId * add static list * temp remove queyr * warning * use fuse for search * remove coins * max size * init token not required * add example * file size * proceed button * dont format json * set as token * ignore json * no need for amount * remoev custom solana xrp * platformId * udpate coins * usd rate --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Chain selector (#3082) * add logos * chain combobox * use new chain selector * option chainId to chainId * value chainId * Osmosis support added (#3084) * add osmosis chains * post-fix 'Testnet' to unsupported chain name (when applicable) * Headless UI v2 (#3085) * headless ui * done batch one * done coutnries * done batch two * done batch 3 * done batch 4 * chain selector scroller click * token options scroll click fix * max height * remove extra border * downgrade yarn * fix program hidden * combobox null value * 2.1.0 transition built in dialog --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Add coinbase extension wallet (#3087) * update icons * use 6963 and add coinbase * update icon imports * unload after switching error --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * QR copy (#3088) * add QR warning * more readable * In honor of field (#3089) * honor field * set from intent * closer to label * close to lable * rename form * wiring * Fix token selector search and updates (#3091) * combobox inside popover * search icon on right * rename interface * BG-1417: Cheque FAQ (#3105) * add content * faq content * BG-1423: chain selector updates (#3104) * change type and adjust for chainId '' * shorter * sort chains * display and focus on error * Network dropdown bug fixes (#3106) * add immediate to open on focus * remove hidden input * WP url updated * BG-1424: Improve token search (#3102) * add not listed * mixed * virtualized * per chain json file * biome ignore * add missing * add token placeholder * spacing * Revert "WP url updated" This reverts commit ffb68148308d6078a762e0741cc779814c854ff2. * upgrade to signclient (#3103) * Network select should focus first when all is error (#3109) * more flexible api * use new api * selector value is chainId * remove hookform context * Donate crash + cherry pick from master (#3108) * make default values required * remove undefined * remove placeholder (#3039) * BG-1380: share fixes (#3040) * remove excess * lines and punctuations * handles and notes * BG-1382: Users unable to create programs occasionally (#3050) * fetch new token * comment * refresh token every 5 minutes * add ms multiplier (#3067) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 3ecb5d0958a5645a1ddda2d2d6284883362c13d9. * fix source (#3083) --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Crypto form integration test (#3110) * init test and mocks * persisted state * empty form validation msgs * prior to selecting token * error correcting * remove test id * BG-1399: Stripe status handling for manual bank verification (#3107) * Update stripe payment status API to use latest version * Added verify bank account button to 'pending' tab in My Donations * Add 'arrivalDate' in Donations Thanks page * Donation Thanks Page for 'requires_action' status and logged in donor * Show bank verification link for guest donors on thank you page * Removed redundant comment * Renamed 'Verify Bank Account' to 'Action' * Removed unused import * Add type def for specific bank verification fields * Add wordpress assets to post page (#3090) * add in public assets and load via react helmet * remove extra space * dry input * preserve header and footer style --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Stripe form integration test (#3111) * update currency selector with accessible headless components * extract rhf from field * no rhf stripe form * add missing error * rhf hook * rhf * should focus * init setup * prefilled state * validation test and increments * stripe form loading and error * Node proxies (#3113) * optimism proxy * revert mistake * base proxy * terra proxies * stargaze and juno, compress lcd,rpc to nodeUrl * osmosis * kujira * update terra * Add 'ukGiftAid' field in fiat donation payload (#3121) * WP URL updated * Cover processing fee UI (#3112) * processing fees * fee allowance on intent * fix type errors * fee allowance checkbox * flatten * save as fee allowance instead of bool * processing fee row * fee allowance row * remove console log * add fee allowance to estimate gross amount * add to deps list * tip doesnt disable processign fee * total include processing fee * parent set border child set individual padding * no need for custom bottom margin * psersistend state doesnt drive UI show * fix ts error * Copy tweak --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1437: Tribute notif UI (#3122) * fix: pass type * form elements * schema and field sizing * remove unused import * init tribute * stripe checkout tribute wiring * wiring crypto * fix spacing * fix initial size of * msg char counter * FIX: header footer styles (#3124) * only apply wp override in /blog * only apply wp override on /blog * only to blog/:slug * stocks form test (#3126) * Async chain (#3123) * update definition and adjust consumers * cached get chain options * use token definition * only pick subset * actual url * New donations table fields (#3125) * Update '/ap/donations.ts' types with new fields * Fix 'Action' column for fiat bank verification url in mobile table * Fix 'Action' column for fiat bank verification url in donations table * Added 'Recurring' column for donor My Donations tables * Added 'Direct Donation' and 'SF Donation' columns for donor My Donations tables * Added 'appUsed' in nonprofit My Donations table * Added 'paymentMethod' in nonprofit My Donations table * Added 'isRecurring' in nonprofit My Donations table * Single csv report * Add other fields into nonprofit Donations table * Fix 'Load More' button to span full width of table * DAF form test + MSW mocking (#3127) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * Add staging endpoint for S3 file uploading (#3139) * Donate steps - test skips and resets (#3128) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * compress images and use webp format (#3140) * Stripe checkout test - error paths (#3141) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused * client secret loading * by test id * separate file * error * error modals * donate btn * remove debug * deps * use chariot connect * grant error handling * move type to types/page * button loader * success screen * set chariot as default * remove error * adjust actual amount * include in try catch * show prompts --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * update node version lts (#3191) * Chariot prod key requirements (#3198) * 50 usd min amount * summary skips * create dedicated chariot checkout form * use props namespace * modal dismissible * floor instead of ceil * set min * update test * remove dup (#3202) * prefill billing details (#3201) * Dapp logo, go to BG if in widget - client side navigation to homepage otherwise (#3203) * image accepts render prop instead of elaborate variations * update dapp logo to use render pro * widget logo points to bg website * BG-1511: Fix Oauth stuck on /auth-redirector (#3204) * upgrade to v6 router * navigate * admin to lazy api * lazy load more page * to router lazy * lazy load more route * Donate widget * done using router lazy * avoid assigning to variable component * revert file renameing * fix test * add register routes * nested registration steps * use fireevent instead * switch to object notation * more accurate type * adminRoutes * media routs * gift route * profile routes * Routes freegit add . * lazy load * update sentry * remove console log * missign editor * signup lazy * bank application lazy * donate widget * catch all route * amplify at top --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * DAF requirements (#3176) (#3206) * spelled out daf pay * move donate methods component * create order helper * order methods * update implementation * daf order * timeout * comment * unset tribute when disabling honorary (#3207) * Page transition indicator and top level error boundary (#3208) * create error element compatible to router * add lazy loading indicator * display amount (#3209) * DAFPay remove min donation amount (#3214) * remove min donation amount * update test * add tip in total (#3215) * change link (#3216) * include 30cents processing (#3217) * create dedicated slug validator (#3218) --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh --- public/scripts/linkedin-tracking.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/linkedin-tracking.js b/public/scripts/linkedin-tracking.js index 2b1e0f085b..d1262a0d8b 100644 --- a/public/scripts/linkedin-tracking.js +++ b/public/scripts/linkedin-tracking.js @@ -1,4 +1,4 @@ -_linkedin_partner_id = "4969890"; +_linkedin_partner_id = "6373172"; window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; window._linkedin_data_partner_ids.push(_linkedin_partner_id); From 82a4bab45ebb45ed1290bbe399bd089d0640f1fa Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:20:21 +0800 Subject: [PATCH 07/47] Auth redirect (#3165) * move hub to app * use hub state instead of local storage * convert to uncontrolled * add isNpo flag * password input autocomplete requirement * autocomplete requirement * state -> fromState * state -> fromState * trigger vaidation when clicking google signin * move user type to top * auth redirect * add comment --- src/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 222ae50add..9bb4abd5a6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -30,6 +30,8 @@ Amplify.configure(amplifyConfig); const container = document.getElementById("root"); const root = createRoot(container as Element); +Amplify.configure(amplifyConfig); + Sentry.init({ dsn: process.env.PUBLIC_SENTRY_DSN, environment: process.env.PUBLIC_ENVIRONMENT, From 76251676435221766454d92b2b99059e1be253e7 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Thu, 25 Jul 2024 13:55:03 +0800 Subject: [PATCH 08/47] Fund opt in setting (#3182) * bump cloudsearch version * fund opt out checkbox * to lowercase * label and tooltip --- src/pages/Admin/Charity/Settings/Form.tsx | 4 +++- src/pages/Admin/Charity/Settings/Settings.tsx | 21 ++++++++++--------- src/pages/Admin/Charity/Settings/types.ts | 1 + src/types/aws/ap/index.ts | 7 ++++++- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/pages/Admin/Charity/Settings/Form.tsx b/src/pages/Admin/Charity/Settings/Form.tsx index 200afe6121..4a6942c7e3 100644 --- a/src/pages/Admin/Charity/Settings/Form.tsx +++ b/src/pages/Admin/Charity/Settings/Form.tsx @@ -39,6 +39,7 @@ export default function Form(props: Props) { hide_bg_tip: props.hide_bg_tip ?? false, programDonateDisabled: !(props.progDonationsAllowed ?? true), donateMethods: fill(props.donateMethods), + fundOptIn: props.fund_opt_in ?? false, }, }); @@ -63,7 +64,7 @@ export default function Form(props: Props) { reset(); }} onSubmit={handleSubmit( - async ({ programDonateDisabled, donateMethods, ...fv }) => { + async ({ programDonateDisabled, donateMethods, fundOptIn, ...fv }) => { if (props.id === BG_ID && fv.hide_bg_tip === false) { return displayError( "BG donation flow should not show BG tip screen" @@ -72,6 +73,7 @@ export default function Form(props: Props) { await updateEndow({ ...fv, + fund_opt_in: fundOptIn, progDonationsAllowed: !programDonateDisabled, id: props.id, donateMethods: donateMethods diff --git a/src/pages/Admin/Charity/Settings/Settings.tsx b/src/pages/Admin/Charity/Settings/Settings.tsx index 0c863e0a8a..5e60ea9981 100644 --- a/src/pages/Admin/Charity/Settings/Settings.tsx +++ b/src/pages/Admin/Charity/Settings/Settings.tsx @@ -1,20 +1,21 @@ import { FormError, FormSkeleton } from "components/admin"; import { useEndowment } from "services/aws/useEndowment"; +import type { EndowmentSettingsAttributes } from "types/aws"; import { useAdminContext } from "../../Context"; import Form from "./Form"; +type K = EndowmentSettingsAttributes; +const fields = Object.keys({ + receiptMsg: "", + hide_bg_tip: "", + progDonationsAllowed: "", + donateMethods: "", + fund_opt_in: "", +} satisfies { [k in K]: "" }) as K[]; + export default function Settings() { const { id } = useAdminContext(); - const { - data: endow, - isLoading, - isError, - } = useEndowment({ id }, [ - "receiptMsg", - "hide_bg_tip", - "progDonationsAllowed", - "donateMethods", - ]); + const { data: endow, isLoading, isError } = useEndowment({ id }, fields); if (isLoading) { return ; diff --git a/src/pages/Admin/Charity/Settings/types.ts b/src/pages/Admin/Charity/Settings/types.ts index 22a6e5c16e..d2f85b1817 100644 --- a/src/pages/Admin/Charity/Settings/types.ts +++ b/src/pages/Admin/Charity/Settings/types.ts @@ -3,6 +3,7 @@ import type { TDonateMethod } from "types/components"; export type FV = { receiptMsg: string; hide_bg_tip: boolean; + fundOptIn: boolean; programDonateDisabled: boolean; donateMethods: TDonateMethod[]; }; diff --git a/src/types/aws/ap/index.ts b/src/types/aws/ap/index.ts index 037a58fa6f..b2ef226b8c 100644 --- a/src/types/aws/ap/index.ts +++ b/src/types/aws/ap/index.ts @@ -103,6 +103,7 @@ export type Endowment = { //can be optional, default false and need not be explicit hide_bg_tip?: boolean; published?: boolean; + fund_opt_in?: boolean; /** allowed by default */ progDonationsAllowed?: boolean; donateMethods?: DonateMethodId[]; @@ -152,7 +153,11 @@ export type EndowmentOption = Pick; export type EndowmentSettingsAttributes = Extract< keyof Endowment, - "receiptMsg" | "hide_bg_tip" | "progDonationsAllowed" | "donateMethods" + | "receiptMsg" + | "hide_bg_tip" + | "progDonationsAllowed" + | "donateMethods" + | "fund_opt_in" >; //most are optional except id, but typed as required to force setting of default values - "", [], etc .. export type EndowmentProfileUpdate = Except< From bba84266a4477f98c44added470d82d2211c88a5 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:01:02 +0800 Subject: [PATCH 09/47] Create fund UI Iteration 1 (#3185) * funds routes * setup fields and schema * logo * wire validation and add submit * expiratiom field * featured checkbox * group headers * create fund * add split slider * tip checkbox * endowments multiselector * add debounce * selected and hovered * add card_imgs * logo size * remove sort param * remove italic * move fund selector * single endow setting hook * disable when single setting is applied * disable when single setting is applied * set effect dep * rename * generic name * include endow name in config * update schema * submit button * revert to custom * remove unused * endow req valid window * wrap with auth * save to server * show loader when debouncing * add aws type * construct new payload * error validation * change bucket name * wip fund page * fundraiser list * funds credential * success msg * add expiration --- src/App/Header/UserMenu/EndowmentLink.tsx | 19 +- src/App/Header/UserMenu/Funds.tsx | 25 ++ src/App/Header/UserMenu/Menu.tsx | 2 + src/constants/routes.ts | 1 + src/helpers/uploadFiles.ts | 2 +- src/pages/Funds/CreateFund/CreateFund.tsx | 319 ++++++++++++++++++ .../EndowmentSelector/EndowmentSelector.tsx | 110 ++++++ .../CreateFund/EndowmentSelector/Options.tsx | 65 ++++ .../CreateFund/EndowmentSelector/index.ts | 1 + src/pages/Funds/CreateFund/index.ts | 1 + src/pages/Funds/CreateFund/schema.ts | 40 +++ src/pages/Funds/CreateFund/types.ts | 25 ++ src/pages/Funds/CreateFund/useEndow.ts | 40 +++ src/pages/Funds/Fund.tsx | 6 + src/pages/Funds/Funds.tsx | 6 + src/pages/Funds/index.ts | 2 + src/services/aws/aws.ts | 1 + src/services/aws/funds.ts | 22 ++ src/services/aws/users.ts | 15 +- src/slices/auth.ts | 4 + src/types/auth.ts | 1 + src/types/aws/ap/index.ts | 48 +++ 22 files changed, 744 insertions(+), 11 deletions(-) create mode 100644 src/App/Header/UserMenu/Funds.tsx create mode 100644 src/pages/Funds/CreateFund/CreateFund.tsx create mode 100644 src/pages/Funds/CreateFund/EndowmentSelector/EndowmentSelector.tsx create mode 100644 src/pages/Funds/CreateFund/EndowmentSelector/Options.tsx create mode 100644 src/pages/Funds/CreateFund/EndowmentSelector/index.ts create mode 100644 src/pages/Funds/CreateFund/index.ts create mode 100644 src/pages/Funds/CreateFund/schema.ts create mode 100644 src/pages/Funds/CreateFund/types.ts create mode 100644 src/pages/Funds/CreateFund/useEndow.ts create mode 100644 src/pages/Funds/Fund.tsx create mode 100644 src/pages/Funds/Funds.tsx create mode 100644 src/pages/Funds/index.ts create mode 100644 src/services/aws/funds.ts diff --git a/src/App/Header/UserMenu/EndowmentLink.tsx b/src/App/Header/UserMenu/EndowmentLink.tsx index b9fd53662e..ead07065d1 100644 --- a/src/App/Header/UserMenu/EndowmentLink.tsx +++ b/src/App/Header/UserMenu/EndowmentLink.tsx @@ -5,7 +5,7 @@ import QueryLoader from "components/QueryLoader"; import { appRoutes } from "constants/routes"; import { Link } from "react-router-dom"; import { useEndowment } from "services/aws/useEndowment"; -import type { UserEndow } from "types/aws"; +import type { UserEndow, UserFund } from "types/aws"; interface IBookmarkLink { endowId: number; @@ -20,28 +20,29 @@ export function BookmarkLink({ endowId }: IBookmarkLink) { error: <_Link id={endowId} route="profile" />, }} > - {(endow) => <_Link {...endow} id={endowId} route="profile" />} + {(endow) => <_Link {...endow} id={endowId} route={appRoutes.profile} />} ); } export function EndowmentLink({ endowID, logo, name }: UserEndow) { - return <_Link id={endowID} logo={logo} name={name} route="admin" />; + return <_Link id={endowID} logo={logo} name={name} route={appRoutes.admin} />; +} + +export function FundLink({ fundId, logo, name }: UserFund) { + return <_Link id={fundId} logo={logo} name={name} route={appRoutes.admin} />; } type LinkProps = { - id: number; + id: number | string; name?: string; logo?: string; - route: "admin" | "profile"; + route: string; }; const _Link = (props: LinkProps) => ( diff --git a/src/App/Header/UserMenu/Funds.tsx b/src/App/Header/UserMenu/Funds.tsx new file mode 100644 index 0000000000..01a2ee7b37 --- /dev/null +++ b/src/App/Header/UserMenu/Funds.tsx @@ -0,0 +1,25 @@ +import { useUserFundsQuery } from "services/aws/users"; +import { FundLink, Skeleton } from "./EndowmentLink"; + +interface Props { + userId: string; + classes?: string; +} +export function Funds({ userId, classes = "" }: Props) { + const { data: funds = [], isLoading } = useUserFundsQuery(userId); + return ( + + ); +} diff --git a/src/App/Header/UserMenu/Menu.tsx b/src/App/Header/UserMenu/Menu.tsx index 8a63eb55f6..64a1f8ab67 100644 --- a/src/App/Header/UserMenu/Menu.tsx +++ b/src/App/Header/UserMenu/Menu.tsx @@ -5,6 +5,7 @@ import { appRoutes } from "constants/routes"; import { Link } from "react-router-dom"; import type { AuthenticatedUser } from "types/auth"; import { Bookmarks } from "./Bookmarks"; +import { Funds } from "./Funds"; import { Organizations } from "./Organizations"; type Props = { @@ -28,6 +29,7 @@ export default function Menu({ user, signOut, classes }: Props) { My Donations +
BG Admin
diff --git a/src/constants/routes.ts b/src/constants/routes.ts index aaf32b7caa..36132d887f 100644 --- a/src/constants/routes.ts +++ b/src/constants/routes.ts @@ -25,6 +25,7 @@ export enum appRoutes { nonprofit_info = "/nonprofit", donor_info = "/donor", wp_plugin = "/wp-plugin", + funds = "/funds", } export const adminRoutes = { diff --git a/src/helpers/uploadFiles.ts b/src/helpers/uploadFiles.ts index 1c7a6dcfeb..ddb7724067 100644 --- a/src/helpers/uploadFiles.ts +++ b/src/helpers/uploadFiles.ts @@ -3,7 +3,7 @@ import { version as v } from "services/helpers"; import { isEmpty } from "./isEmpty"; import { jwtToken } from "./jwt-token"; -export type Bucket = "endow-profiles" | "endow-reg" | "bg-user"; +export type Bucket = "endow-profiles" | "endow-reg" | "bg-user" | "bg-funds"; export const bucketURL = "s3.amazonaws.com"; const SPACES = /\s+/g; diff --git a/src/pages/Funds/CreateFund/CreateFund.tsx b/src/pages/Funds/CreateFund/CreateFund.tsx new file mode 100644 index 0000000000..9d785dbca3 --- /dev/null +++ b/src/pages/Funds/CreateFund/CreateFund.tsx @@ -0,0 +1,319 @@ +import { yupResolver } from "@hookform/resolvers/yup"; +import { ControlledImgEditor as ImgEditor } from "components/ImgEditor"; +import Prompt from "components/Prompt"; +import { LockedSplitSlider } from "components/donation"; +import { + NativeCheckField as CheckField, + NativeField as Field, + Form, + Label, +} from "components/form"; +import { APP_NAME } from "constants/env"; +import { appRoutes } from "constants/routes"; +import withAuth from "contexts/Auth"; +import { useErrorContext } from "contexts/ErrorContext"; +import { useModalContext } from "contexts/ModalContext"; +import { logger } from "helpers"; +import { getFullURL, uploadFiles } from "helpers/uploadFiles"; +import { + AVATAR_MAX_SIZE_BYTES, + AVATAR_MIME_TYPE, +} from "pages/UserDashboard/EditProfile/useRhf"; +import { useRef } from "react"; +import { type SubmitHandler, useController, useForm } from "react-hook-form"; +import { Link } from "react-router-dom"; +import { useLazyProfileQuery } from "services/aws/aws"; +import { useCreateFundMutation } from "services/aws/funds"; +import type { Fund } from "types/aws"; +import { EndowmentSelector } from "./EndowmentSelector"; +import { schema } from "./schema"; +import type { FormValues as FV } from "./types"; + +export default withAuth(function CreateFund() { + const { + register, + control, + trigger, + resetField, + handleSubmit, + setValue, + formState: { errors, isSubmitting }, + watch, + } = useForm({ + resolver: yupResolver(schema), + defaultValues: { + name: "", + description: "", + logo: { preview: "", publicUrl: "" }, + banner: { preview: "", publicUrl: "" }, + expiration: "", + featured: true, + members: [], + settings: { + from: "fund", + allowBgTip: true, + liquidSplit: 50, + }, + }, + }); + const { field: banner } = useController({ control, name: "banner" }); + const { field: logo } = useController({ control, name: "logo" }); + const { field: liquidSplitPct } = useController({ + control, + name: "settings.liquidSplit", + }); + const { field: members } = useController({ + control, + name: "members", + }); + + //keep track of what user previously set + //revert to it when endow is no longer 1 + const customSplitRef = useRef(50); + const customAllowBgTipRef = useRef(true); + const endowReqRef = useRef(); + + const [getEndow] = useLazyProfileQuery(); + const [createFund] = useCreateFundMutation(); + const { handleError } = useErrorContext(); + const { showModal } = useModalContext(); + const settings = watch("settings"); + + const onSubmit: SubmitHandler = async ({ banner, logo, ...fv }) => { + try { + if (!banner.file || !logo.file) { + throw `dev: banner must be required`; + } + + showModal(Prompt, { type: "loading", children: "Uploading..." }); + + const uploadBaseUrl = await uploadFiles( + [banner.file, logo.file], + "bg-funds" + ); + if (!uploadBaseUrl) throw `upload failed`; + + showModal(Prompt, { type: "loading", children: "Creating fund..." }); + + const fund: Fund.New = { + name: fv.name, + description: fv.description, + banner: getFullURL(uploadBaseUrl, banner.file.name), + logo: getFullURL(uploadBaseUrl, logo.file.name), + members: fv.members.map((m) => m.id), + featured: fv.featured, + settings: { + liquidSplitPct: fv.settings.liquidSplit, + allowBgTip: fv.settings.allowBgTip, + }, + expiration: fv.expiration, + }; + + const res = await createFund(fund).unwrap(); + + showModal(Prompt, { + type: "success", + children: ( +

+ Your{" "} + + fund + {" "} + is created + {fv.featured ? ( + <> + {" "} + and is now listed in{" "} + funds page + + ) : ( + "" + )} + !. To get access to this fund, kindly login again. +

+ ), + }); + } catch (err) { + handleError(err, { context: "creating fund" }); + } + }; + + return ( +
+
+

Fund information

+ + + + { + members.onChange(curr); + if (curr.length === 0 || curr.length > 1) { + //invalidate pending request + endowReqRef.current = undefined; + return setValue("settings", { + from: "fund", + liquidSplit: customSplitRef.current, + allowBgTip: customAllowBgTipRef.current, + }); + } + + //set settings if applicable + try { + const [opt] = curr; + const endowReq = getEndow( + { + id: opt.id, + fields: ["hide_bg_tip", "splitLiqPct", "name"], + }, + true + ); + + endowReqRef.current = endowReq.requestId; + + const endow = await endowReq.unwrap(); + + // more recent onChange invalidated this result + if (!endowReqRef.current) return; + + setValue("settings", { + from: endow.name, + allowBgTip: !endow.hide_bg_tip, + liquidSplit: endow.splitLiqPct ?? 50, + }); + } catch (err) { + logger.error(err); + } + }} + error={errors.members?.message} + /> + + + { + banner.onChange(v); + trigger("banner.file"); + }} + onUndo={(e) => { + e.stopPropagation(); + resetField("banner"); + }} + accept={AVATAR_MIME_TYPE} + aspect={[4, 1]} + classes={{ + container: "mb-4", + dropzone: "aspect-[4/1]", + }} + maxSize={AVATAR_MAX_SIZE_BYTES} + error={errors.banner?.file?.message} + /> + + + { + logo.onChange(v); + trigger("logo.file"); + }} + onUndo={(e) => { + e.stopPropagation(); + resetField("logo"); + }} + accept={AVATAR_MIME_TYPE} + aspect={[1, 1]} + classes={{ + container: "mb-4", + dropzone: "aspect-[1/1] w-60", + }} + maxSize={AVATAR_MAX_SIZE_BYTES} + error={errors.banner?.file?.message} + /> + + + + + Featured in funds page + + +

Donate form settings

+

+ {settings.from !== "fund" && + `${withPossesive(settings.from)} config has been applied`} +

+ + + { + const liq = 100 - lockedPct; + liquidSplitPct.onChange(liq); + customSplitRef.current = liq; + }} + /> + + { + customAllowBgTipRef.current = e.target.checked; + }} + > + Allow tips to {APP_NAME} + +

+ During the donation flow, there is a step in which users can choose to + tip {APP_NAME} any amount they desire alongside their donation to this + fund. The amount they tip will not affect the donation amount this + fund receives. You may choose to turn this step off in the donation + flow and we will instead apply a fixed 2.9% fee to the amount donated + to this fund. +

+ + + +
+ ); +}); + +const withPossesive = (name: string) => + name.endsWith("s") ? `${name}'` : `${name}'s`; diff --git a/src/pages/Funds/CreateFund/EndowmentSelector/EndowmentSelector.tsx b/src/pages/Funds/CreateFund/EndowmentSelector/EndowmentSelector.tsx new file mode 100644 index 0000000000..69a8ad0931 --- /dev/null +++ b/src/pages/Funds/CreateFund/EndowmentSelector/EndowmentSelector.tsx @@ -0,0 +1,110 @@ +import { + Combobox, + ComboboxInput, + Description, + Field, + Label, +} from "@headlessui/react"; +import Icon from "components/Icon"; +import Image from "components/Image"; +import { forwardRef, useState } from "react"; +import type { FundMember } from "../types"; +import { Options } from "./Options"; + +interface EndowmentOption extends FundMember {} + +type OnChange = (opts: EndowmentOption[]) => void; +interface Props { + values: EndowmentOption[]; + onChange: OnChange; + classes?: string; + disabled?: boolean; + error?: string; +} + +type El = HTMLInputElement; + +export const EndowmentSelector = forwardRef((props, ref) => { + const [searchText, setSearchText] = useState(""); + + return ( + + + +
+
+ {props.values.map((v) => ( + + props.onChange( + props.values.filter((v) => v.id !== thisOpt.id) + ) + } + /> + ))} + +
+ + setSearchText(e.target.value)} + ref={ref} + /> +
+
+
+ + +
+

{props.error}

+ + Inclusion as an eligible Fundraiser Index nonprofit is optional for all + Better Giving Nonprofits. If you don't see a nonprofit of interest on + this list, it means that they have not opted-in at this time. + +
+ ); +}); + +interface ISelectedOption extends EndowmentOption { + onDeselect: (thisOpt: EndowmentOption) => void; +} + +function SelectedOption({ onDeselect, ...props }: ISelectedOption) { + return ( +
+ + {props.name} + +
+ ); +} diff --git a/src/pages/Funds/CreateFund/EndowmentSelector/Options.tsx b/src/pages/Funds/CreateFund/EndowmentSelector/Options.tsx new file mode 100644 index 0000000000..85a0df5b3a --- /dev/null +++ b/src/pages/Funds/CreateFund/EndowmentSelector/Options.tsx @@ -0,0 +1,65 @@ +import { ComboboxOption, ComboboxOptions } from "@headlessui/react"; +import Image from "components/Image"; +import { ErrorStatus, Info, LoadingStatus } from "components/Status"; +import useDebouncer from "hooks/useDebouncer"; +import { useEndowmentCardsQuery } from "services/aws/aws"; +import type { FundMember } from "../types"; + +interface Props { + searchText: string; + classes?: string; +} + +export function Options({ classes = "", searchText }: Props) { + const [debouncedSearchText, isDebouncing] = useDebouncer(searchText, 200); + + const endowments = useEndowmentCardsQuery({ + query: debouncedSearchText, + page: 1, + fund_opt_in: "true", + }); + + if (endowments.isLoading || isDebouncing) { + return ( + + Loading options... + + ); + } + + if (endowments.isError) { + return ( + + Failed to load endowments + + ); + } + + const endows = endowments.data?.Items; + if (!endows) return null; + + if (endows.length === 0) { + return No endowments found; + } + + return ( + + {endows.map((o) => ( + + + {o.name} + + ))} + + ); +} diff --git a/src/pages/Funds/CreateFund/EndowmentSelector/index.ts b/src/pages/Funds/CreateFund/EndowmentSelector/index.ts new file mode 100644 index 0000000000..0a7aa11c3d --- /dev/null +++ b/src/pages/Funds/CreateFund/EndowmentSelector/index.ts @@ -0,0 +1 @@ +export { EndowmentSelector } from "./EndowmentSelector"; diff --git a/src/pages/Funds/CreateFund/index.ts b/src/pages/Funds/CreateFund/index.ts new file mode 100644 index 0000000000..e306cdb704 --- /dev/null +++ b/src/pages/Funds/CreateFund/index.ts @@ -0,0 +1 @@ +export { default } from "./CreateFund"; diff --git a/src/pages/Funds/CreateFund/schema.ts b/src/pages/Funds/CreateFund/schema.ts new file mode 100644 index 0000000000..5e8d4556c9 --- /dev/null +++ b/src/pages/Funds/CreateFund/schema.ts @@ -0,0 +1,40 @@ +import type { ImgLink } from "components/ImgEditor"; +import { genFileSchema } from "schemas/file"; +import { schema as schemaFn } from "schemas/shape"; +import { requiredString } from "schemas/string"; +import type { ImageMIMEType } from "types/lists"; +import { array, string } from "yup"; +import type { FormValues as FV } from "./types"; + +export const VALID_MIME_TYPES: ImageMIMEType[] = [ + "image/jpeg", + "image/png", + "image/webp", + "image/svg+xml", +]; + +export const MAX_SIZE_IN_BYTES = 1e6; +export const MAX_CHARS = 4000; + +const fileObj = schemaFn({ + file: genFileSchema(MAX_SIZE_IN_BYTES, VALID_MIME_TYPES).required("required"), +}); + +export const schema = schemaFn({ + name: requiredString, + description: requiredString, + banner: fileObj, + logo: fileObj, + members: array().min(1, "must contain at least one endowment"), + expiration: string() + .transform((v) => { + if (!v) return ""; + return new Date(v).toISOString(); + }) + .datetime("invalid date") + .test( + "", + "must be in the future", + (v) => !v || v >= new Date().toISOString() + ), +}); diff --git a/src/pages/Funds/CreateFund/types.ts b/src/pages/Funds/CreateFund/types.ts new file mode 100644 index 0000000000..1bc516f3c4 --- /dev/null +++ b/src/pages/Funds/CreateFund/types.ts @@ -0,0 +1,25 @@ +import type { ImgLink } from "components/ImgEditor"; + +export interface FundMember { + id: number; + name: string; + logo?: string; +} + +export interface Settings { + /** endowname or fund */ + from: string; + liquidSplit: number; + allowBgTip: boolean; +} + +export interface FormValues { + name: string; + description: string; + logo: ImgLink; + banner: ImgLink; + expiration: string; + featured: boolean; + members: FundMember[]; + settings: Settings; +} diff --git a/src/pages/Funds/CreateFund/useEndow.ts b/src/pages/Funds/CreateFund/useEndow.ts new file mode 100644 index 0000000000..728758419e --- /dev/null +++ b/src/pages/Funds/CreateFund/useEndow.ts @@ -0,0 +1,40 @@ +import { useEffect } from "react"; +import { useLazyProfileQuery } from "services/aws/aws"; +import type { Endowment } from "types/aws"; +import type { FundMember } from "./types"; + +export type Endow = Pick; + +export function useEndow( + members: FundMember[], + onEndowSet: (endow: Endow) => void +) { + /** set donate settings for single endowment */ + const [getEndow] = useLazyProfileQuery(); + const configSource = `${members.at(0)?.id ?? 0}-${members.length}` as const; + + useEffect(() => { + const [id, length] = configSource.split("-"); + const numId = +id; + const numLength = +length; + + if (numId === 0 || numLength === 0) return; + if (numLength > 1) return; + + getEndow( + { + id: numId, + fields: ["hide_bg_tip", "splitLiqPct", "name"], + }, + true + ) + .unwrap() + .then(({ hide_bg_tip, splitLiqPct, name }) => { + onEndowSet({ + hide_bg_tip, + splitLiqPct, + name, + }); + }); + }, [configSource, onEndowSet, getEndow]); +} diff --git a/src/pages/Funds/Fund.tsx b/src/pages/Funds/Fund.tsx new file mode 100644 index 0000000000..aad48f23a2 --- /dev/null +++ b/src/pages/Funds/Fund.tsx @@ -0,0 +1,6 @@ +import { useParams } from "react-router-dom"; + +export function Fund() { + const params = useParams(); + return

WIP: Fund: {params.id}

; +} diff --git a/src/pages/Funds/Funds.tsx b/src/pages/Funds/Funds.tsx new file mode 100644 index 0000000000..589aa8c271 --- /dev/null +++ b/src/pages/Funds/Funds.tsx @@ -0,0 +1,6 @@ +import { appRoutes } from "constants/routes"; +import { Link } from "react-router-dom"; + +export default function Funds() { + return Create fund; +} diff --git a/src/pages/Funds/index.ts b/src/pages/Funds/index.ts new file mode 100644 index 0000000000..79cd7aeaea --- /dev/null +++ b/src/pages/Funds/index.ts @@ -0,0 +1,2 @@ +export { default } from "./Funds"; +export { default as CreateFund } from "./CreateFund"; diff --git a/src/services/aws/aws.ts b/src/services/aws/aws.ts index bac679d6a9..3c8b44c0df 100644 --- a/src/services/aws/aws.ts +++ b/src/services/aws/aws.ts @@ -76,6 +76,7 @@ export const aws = createApi({ "user", "user-bookmarks", "user-endows", + "funds", ], reducerPath: "aws", baseQuery: awsBaseQuery, diff --git a/src/services/aws/funds.ts b/src/services/aws/funds.ts new file mode 100644 index 0000000000..cc894c9415 --- /dev/null +++ b/src/services/aws/funds.ts @@ -0,0 +1,22 @@ +import { TEMP_JWT } from "constants/auth"; +import type { Fund } from "types/aws"; +import { version as v } from "../helpers"; +import { aws } from "./aws"; + +export const funds = aws.injectEndpoints({ + endpoints: (builder) => ({ + createFund: builder.mutation<{ id: string }, Fund.New>({ + invalidatesTags: ["funds"], + query: (payload) => { + return { + url: `${v(1)}/funds`, + method: "POST", + body: payload, + headers: { authorization: TEMP_JWT }, + }; + }, + }), + }), +}); + +export const { useCreateFundMutation } = funds; diff --git a/src/services/aws/users.ts b/src/services/aws/users.ts index 0af463f6bb..2d2432f39a 100644 --- a/src/services/aws/users.ts +++ b/src/services/aws/users.ts @@ -1,5 +1,10 @@ import { TEMP_JWT } from "constants/auth"; -import type { AletPrefUpdate, UserEndow, UserUpdate } from "types/aws"; +import type { + AletPrefUpdate, + UserEndow, + UserFund, + UserUpdate, +} from "types/aws"; import { version as v } from "../helpers"; import { aws } from "./aws"; @@ -23,6 +28,13 @@ const endowAdmins = aws.injectEndpoints({ headers: { authorization: TEMP_JWT }, }), }), + userFunds: builder.query({ + providesTags: ["user-endows"], + query: (userId) => ({ + url: `/${v(3)}/users/${userId}/funds`, + headers: { authorization: TEMP_JWT }, + }), + }), updateUserEndows: builder.mutation< unknown, { userId: string; alertPrefs: AletPrefUpdate[] } @@ -43,5 +55,6 @@ const endowAdmins = aws.injectEndpoints({ export const { useEditUserMutation, useUserEndowsQuery, + useUserFundsQuery, useUpdateUserEndowsMutation, } = endowAdmins; diff --git a/src/slices/auth.ts b/src/slices/auth.ts index 730fb0902f..21b10d789b 100644 --- a/src/slices/auth.ts +++ b/src/slices/auth.ts @@ -32,12 +32,15 @@ export const loadSession = createAsyncThunk( type Payload = { /** csv */ endows?: string; + /** csv */ + funds?: string; "cognito:groups": string[]; email: string; }; const { endows, + funds, "cognito:groups": groups = [], email: userEmail, } = idToken.payload as Payload; @@ -58,6 +61,7 @@ export const loadSession = createAsyncThunk( tokenExpiry: idToken.payload.exp, groups, endowments: endows?.split(",").map(Number) ?? [], + funds: funds?.split(",") ?? [], email: userEmail, firstName: userAttributes.givenName, lastName: userAttributes.familyName, diff --git a/src/types/auth.ts b/src/types/auth.ts index 412e9306ec..91a972f7d6 100644 --- a/src/types/auth.ts +++ b/src/types/auth.ts @@ -3,6 +3,7 @@ export type AuthenticatedUser = { tokenExpiry: number; groups: string[]; endowments: number[]; + funds: string[]; email: string; firstName?: string; lastName?: string; diff --git a/src/types/aws/ap/index.ts b/src/types/aws/ap/index.ts index b2ef226b8c..da85268f46 100644 --- a/src/types/aws/ap/index.ts +++ b/src/types/aws/ap/index.ts @@ -1,5 +1,6 @@ import type { Except } from "type-fest"; import type { PartialExcept } from "types/utils"; +import type { Environment } from "vitest"; import type { DonateMethodId, UNSDG_NUMS } from "../../lists"; export type Milestone = { @@ -128,6 +129,13 @@ export type UserEndow = { }; }; +export interface UserFund { + name?: string; + logo: string; + email: string; + fundId: string; +} + export interface EndowAdmin { email: string; familyName?: string; @@ -206,6 +214,8 @@ export type EndowmentsQueryParams = { countries?: string; //comma separated country names /** boolean csv */ claimed?: string; + /** boolean csv */ + fund_opt_in?: string; }; export type EndowmentBookmark = { @@ -222,3 +232,41 @@ export type UserAttributes = { }; export type UserUpdate = Partial; + +export interface Fund { + /** uuidv4 */ + id: string; + env: Environment; + name: string; + description: string; + banner: string; + logo: string; + members: Pick[]; + featured: boolean; + active: boolean; + settings: { + /** 1 - 100 */ + liquidSplitPct: number; + allowBgTip: boolean; + }; + /** iso */ + expiration?: string; + verified: boolean; + donation_total_usd: number; +} +export namespace Fund { + export interface New + extends Pick< + Fund, + | "name" + | "description" + | "banner" + | "logo" + | "featured" + | "settings" + | "expiration" + > { + /** endowment ids */ + members: number[]; + } +} From b153616f9f59993c467174e4eb25ead6b1105d35 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:40:31 +0800 Subject: [PATCH 10/47] List funds (#3192) * funds routes * setup fields and schema * logo * wire validation and add submit * expiratiom field * featured checkbox * group headers * create fund * add split slider * tip checkbox * endowments multiselector * add debounce * selected and hovered * add card_imgs * logo size * remove sort param * remove italic * move fund selector * single endow setting hook * disable when single setting is applied * disable when single setting is applied * set effect dep * rename * generic name * include endow name in config * update schema * submit button * revert to custom * remove unused * endow req valid window * wrap with auth * save to server * show loader when debouncing * add aws type * construct new payload * error validation * change bucket name * wip fund page * fundraiser list * funds credential * success msg * add expiration * correct propt * route fund page * setup funds page * fix type error --- src/App/Header/UserMenu/EndowmentLink.tsx | 4 +- src/App/Header/UserMenu/Funds.tsx | 2 +- src/pages/Funds/Cards/Card.tsx | 64 +++++++++++++++++++++++ src/pages/Funds/Cards/Cards.tsx | 58 ++++++++++++++++++++ src/pages/Funds/Cards/index.ts | 1 + src/pages/Funds/Cards/useCards.ts | 62 ++++++++++++++++++++++ src/pages/Funds/Funds.tsx | 23 ++++++-- src/pages/Funds/index.ts | 1 + src/services/aws/funds.ts | 15 +++++- src/types/aws/ap/index.ts | 29 +++++++++- 10 files changed, 251 insertions(+), 8 deletions(-) create mode 100644 src/pages/Funds/Cards/Card.tsx create mode 100644 src/pages/Funds/Cards/Cards.tsx create mode 100644 src/pages/Funds/Cards/index.ts create mode 100644 src/pages/Funds/Cards/useCards.ts diff --git a/src/App/Header/UserMenu/EndowmentLink.tsx b/src/App/Header/UserMenu/EndowmentLink.tsx index ead07065d1..5ae5ba1aac 100644 --- a/src/App/Header/UserMenu/EndowmentLink.tsx +++ b/src/App/Header/UserMenu/EndowmentLink.tsx @@ -29,8 +29,8 @@ export function EndowmentLink({ endowID, logo, name }: UserEndow) { return <_Link id={endowID} logo={logo} name={name} route={appRoutes.admin} />; } -export function FundLink({ fundId, logo, name }: UserFund) { - return <_Link id={fundId} logo={logo} name={name} route={appRoutes.admin} />; +export function FundLink({ id, logo, name }: UserFund) { + return <_Link id={id} logo={logo} name={name} route={appRoutes.admin} />; } type LinkProps = { diff --git a/src/App/Header/UserMenu/Funds.tsx b/src/App/Header/UserMenu/Funds.tsx index 01a2ee7b37..e8e306e91b 100644 --- a/src/App/Header/UserMenu/Funds.tsx +++ b/src/App/Header/UserMenu/Funds.tsx @@ -18,7 +18,7 @@ export function Funds({ userId, classes = "" }: Props) { ) : ( - funds.map((fund) => ) + funds.map((fund) => ) )}
); diff --git a/src/pages/Funds/Cards/Card.tsx b/src/pages/Funds/Cards/Card.tsx new file mode 100644 index 0000000000..740c4bc0a3 --- /dev/null +++ b/src/pages/Funds/Cards/Card.tsx @@ -0,0 +1,64 @@ +import flying_character from "assets/images/flying-character.png"; +import Image from "components/Image"; +import VerifiedIcon from "components/VerifiedIcon"; +import { appRoutes } from "constants/routes"; +import { humanize } from "helpers"; +import { Link } from "react-router-dom"; +import type { Fund } from "types/aws"; + +export default function Card({ + name, + logo, + id, + description, + verified, + donation_total_usd, +}: Fund.Card) { + return ( +
+ + e.currentTarget.classList.add("bg-blue-l3")} + /> +
+ {/* nonprofit NAME */} +

+ {verified && ( + + )} + {name} +

+ +

+ {description} +

+ +

+ Total donations: + ${humanize(donation_total_usd, 0)} +

+
+ + {/** absolute so above whole `Link` card */} +
+
{/** future: share button */} + + WIP: Donate + +
{/** future: bookmark button */} +
+
+ ); +} diff --git a/src/pages/Funds/Cards/Cards.tsx b/src/pages/Funds/Cards/Cards.tsx new file mode 100644 index 0000000000..460c8414f8 --- /dev/null +++ b/src/pages/Funds/Cards/Cards.tsx @@ -0,0 +1,58 @@ +import QueryLoader from "components/QueryLoader"; +import Card from "./Card"; +import useCards from "./useCards"; + +interface Props { + classes?: string; + search: string; +} + +export default function Cards({ classes = "", search }: Props) { + const { + hasMore, + isFetching, + isLoading, + isLoadingNextPage, + loadNextPage, + data, + isError, + } = useCards(search); + return ( + + {(funds) => ( +
+ {funds.map((fund) => ( + + ))} + + {hasMore && ( + + )} +
+ )} +
+ ); +} diff --git a/src/pages/Funds/Cards/index.ts b/src/pages/Funds/Cards/index.ts new file mode 100644 index 0000000000..d70ef1788f --- /dev/null +++ b/src/pages/Funds/Cards/index.ts @@ -0,0 +1 @@ +export { default } from "./Cards"; diff --git a/src/pages/Funds/Cards/useCards.ts b/src/pages/Funds/Cards/useCards.ts new file mode 100644 index 0000000000..5a9447101f --- /dev/null +++ b/src/pages/Funds/Cards/useCards.ts @@ -0,0 +1,62 @@ +import useDebouncer from "hooks/useDebouncer"; +import { + updateAwsQueryData, + useFundsQuery, + useLazyFundsQuery, +} from "services/aws/funds"; +import { useSetter } from "store/accessors"; + +export default function useCards(search: string) { + const [debouncedSearchText, isDebouncing] = useDebouncer(search, 500); + const dispatch = useSetter(); + + const { + isLoading, + isFetching, + isUninitialized, + data, + isError, + originalArgs, + } = useFundsQuery( + { query: debouncedSearchText, page: 1 }, + { skip: isDebouncing } + ); + + const [loadMore, { isLoading: isLoadingNextPage }] = useLazyFundsQuery(); + + async function loadNextPage() { + //button is hidden when there's no more + if ( + data?.page && + originalArgs /** cards won't even show if no initial query is made */ + ) { + const { data: newPage } = await loadMore({ + ...originalArgs, + page: data.page + 1, + }); + + if (newPage) { + //pessimistic update to original cache data + dispatch( + updateAwsQueryData("funds", originalArgs, (prevResult) => { + prevResult.items.push(...newPage.items); + prevResult.page = newPage.page; + }) + ); + } + } + } + + // initial assumption is that there's no more to load until we get first res from query + const hasMore = (data?.page || 0) < (data?.numPages || 0); + + return { + hasMore, + isLoading: isLoading || isUninitialized, + isLoadingNextPage: isLoadingNextPage, + isFetching: isFetching || isUninitialized, + loadNextPage, + data, + isError, + }; +} diff --git a/src/pages/Funds/Funds.tsx b/src/pages/Funds/Funds.tsx index 589aa8c271..d677523b90 100644 --- a/src/pages/Funds/Funds.tsx +++ b/src/pages/Funds/Funds.tsx @@ -1,6 +1,23 @@ -import { appRoutes } from "constants/routes"; -import { Link } from "react-router-dom"; +import Icon from "components/Icon"; +import { useState } from "react"; +import Cards from "./Cards"; export default function Funds() { - return Create fund; + const [search, setSearch] = useState(""); + return ( +
+
+ + setSearch(e.target.value)} + className="w-full py-2 pr-3 placeholder:text-navy-l3 text-navy-d4 font-medium font-heading" + placeholder="Search funds..." + /> +
+ +
+ ); } diff --git a/src/pages/Funds/index.ts b/src/pages/Funds/index.ts index 79cd7aeaea..b1eb5a8767 100644 --- a/src/pages/Funds/index.ts +++ b/src/pages/Funds/index.ts @@ -1,2 +1,3 @@ export { default } from "./Funds"; export { default as CreateFund } from "./CreateFund"; +export { Fund } from "./Fund"; diff --git a/src/services/aws/funds.ts b/src/services/aws/funds.ts index cc894c9415..55adc1b57c 100644 --- a/src/services/aws/funds.ts +++ b/src/services/aws/funds.ts @@ -16,7 +16,20 @@ export const funds = aws.injectEndpoints({ }; }, }), + funds: builder.query({ + query: (params) => { + return { + url: `${v(1)}/funds`, + params, + }; + }, + }), }), }); -export const { useCreateFundMutation } = funds; +export const { + useCreateFundMutation, + useLazyFundsQuery, + useFundsQuery, + util: { updateQueryData: updateAwsQueryData }, +} = funds; diff --git a/src/types/aws/ap/index.ts b/src/types/aws/ap/index.ts index da85268f46..e7098b5654 100644 --- a/src/types/aws/ap/index.ts +++ b/src/types/aws/ap/index.ts @@ -133,7 +133,8 @@ export interface UserFund { name?: string; logo: string; email: string; - fundId: string; + /** uuidv4 */ + id: string; } export interface EndowAdmin { @@ -269,4 +270,30 @@ export namespace Fund { /** endowment ids */ members: number[]; } + + export interface Card + extends Pick< + Fund, + | "id" + | "name" + | "description" + | "env" + | "logo" + | "featured" + | "active" + | "verified" + | "donation_total_usd" + | "members" + > {} + + export interface CardsPage { + items: Card[]; + page: number; + numPages: number; + } + + export interface CardsQueryParams { + query?: string; + page?: number; + } } From 581fd30190fa2f7bfe68357acbf40ecd69db099e Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:20:53 +0800 Subject: [PATCH 11/47] Add fundraise target (#3194) * add target * remove unused * fundraiser goal * comment 2 * progress --- src/pages/Funds/Cards/Card.tsx | 8 ++- src/pages/Funds/Cards/Progress.tsx | 55 +++++++++++++++++++++ src/pages/Funds/CreateFund/CreateFund.tsx | 32 +++++++++++- src/pages/Funds/CreateFund/GoalSelector.tsx | 36 ++++++++++++++ src/pages/Funds/CreateFund/schema.ts | 13 ++++- src/pages/Funds/CreateFund/types.ts | 4 ++ src/types/aws/ap/index.ts | 7 +++ 7 files changed, 148 insertions(+), 7 deletions(-) create mode 100644 src/pages/Funds/Cards/Progress.tsx create mode 100644 src/pages/Funds/CreateFund/GoalSelector.tsx diff --git a/src/pages/Funds/Cards/Card.tsx b/src/pages/Funds/Cards/Card.tsx index 740c4bc0a3..352abdce9e 100644 --- a/src/pages/Funds/Cards/Card.tsx +++ b/src/pages/Funds/Cards/Card.tsx @@ -2,9 +2,9 @@ import flying_character from "assets/images/flying-character.png"; import Image from "components/Image"; import VerifiedIcon from "components/VerifiedIcon"; import { appRoutes } from "constants/routes"; -import { humanize } from "helpers"; import { Link } from "react-router-dom"; import type { Fund } from "types/aws"; +import { Progress } from "./Progress"; export default function Card({ name, @@ -13,6 +13,7 @@ export default function Card({ description, verified, donation_total_usd, + target, }: Fund.Card) { return (
@@ -42,10 +43,7 @@ export default function Card({ {description}

-

- Total donations: - ${humanize(donation_total_usd, 0)} -

+
{/** absolute so above whole `Link` card */} diff --git a/src/pages/Funds/Cards/Progress.tsx b/src/pages/Funds/Cards/Progress.tsx new file mode 100644 index 0000000000..b981090109 --- /dev/null +++ b/src/pages/Funds/Cards/Progress.tsx @@ -0,0 +1,55 @@ +import { humanize } from "helpers"; +import type { Fund } from "types/aws"; + +export function Progress( + props: Pick +) { + if (!props.target) { + if (!props.donation_total_usd) return; + return ( +

+ + ${humanize(props.donation_total_usd, 0, true)} + {" "} + Raised +

+ ); + } + + const progress = props.donation_total_usd; + const milestone = + props.target === "smart" ? nextMilestone(progress) : +props.target; + + return ( +
+
+
+
+

+ + ${humanize(props.donation_total_usd, 0)} + {" "} + Raised +

+

+ ${humanize(milestone, 0)}{" "} + Goal amount +

+
+ ); +} + +function nextMilestone(progress: number): number { + const base = 100; + const multiplier = 2; + let next = base; + + while (next <= progress) { + next *= multiplier; + } + + return next; +} diff --git a/src/pages/Funds/CreateFund/CreateFund.tsx b/src/pages/Funds/CreateFund/CreateFund.tsx index 9d785dbca3..d67ad7da65 100644 --- a/src/pages/Funds/CreateFund/CreateFund.tsx +++ b/src/pages/Funds/CreateFund/CreateFund.tsx @@ -26,6 +26,7 @@ import { useLazyProfileQuery } from "services/aws/aws"; import { useCreateFundMutation } from "services/aws/funds"; import type { Fund } from "types/aws"; import { EndowmentSelector } from "./EndowmentSelector"; +import GoalSelector from "./GoalSelector"; import { schema } from "./schema"; import type { FormValues as FV } from "./types"; @@ -54,6 +55,7 @@ export default withAuth(function CreateFund() { allowBgTip: true, liquidSplit: 50, }, + targetType: "smart", }, }); const { field: banner } = useController({ control, name: "banner" }); @@ -66,6 +68,10 @@ export default withAuth(function CreateFund() { control, name: "members", }); + const { field: targetType } = useController({ + control, + name: "targetType", + }); //keep track of what user previously set //revert to it when endow is no longer 1 @@ -106,9 +112,15 @@ export default withAuth(function CreateFund() { liquidSplitPct: fv.settings.liquidSplit, allowBgTip: fv.settings.allowBgTip, }, - expiration: fv.expiration, }; + if (fv.expiration) fund.expiration = fv.expiration; + + if (fv.targetType !== "none") { + fund.target = + fv.targetType === "fixed" ? (fv.fixedTarget as `${number}`) : "smart"; + } + const res = await createFund(fund).unwrap(); showModal(Prompt, { @@ -208,6 +220,24 @@ export default withAuth(function CreateFund() { error={errors.members?.message} /> + + + {targetType.value === "fixed" && ( + + )} + diff --git a/src/pages/Funds/CreateFund/GoalSelector.tsx b/src/pages/Funds/CreateFund/GoalSelector.tsx new file mode 100644 index 0000000000..b0d3382299 --- /dev/null +++ b/src/pages/Funds/CreateFund/GoalSelector.tsx @@ -0,0 +1,36 @@ +import { Field, Label, Radio, RadioGroup } from "@headlessui/react"; +import type { TargetType } from "./types"; + +const options: { [T in TargetType]: string } = { + smart: "Use smart milestones", + none: "No goal or progress bar", + fixed: "Set my own goal", +}; + +interface Props { + value: TargetType; + onChange: (type: TargetType) => void; + classes?: string; +} +export default function GoalSelector(props: Props) { + return ( + + {Object.entries(options).map(([value, label]) => ( + + + + + + + ))} + + ); +} diff --git a/src/pages/Funds/CreateFund/schema.ts b/src/pages/Funds/CreateFund/schema.ts index 5e8d4556c9..2316bb2de8 100644 --- a/src/pages/Funds/CreateFund/schema.ts +++ b/src/pages/Funds/CreateFund/schema.ts @@ -1,6 +1,6 @@ import type { ImgLink } from "components/ImgEditor"; import { genFileSchema } from "schemas/file"; -import { schema as schemaFn } from "schemas/shape"; +import { schema as schemaFn, stringNumber } from "schemas/shape"; import { requiredString } from "schemas/string"; import type { ImageMIMEType } from "types/lists"; import { array, string } from "yup"; @@ -20,6 +20,8 @@ const fileObj = schemaFn({ file: genFileSchema(MAX_SIZE_IN_BYTES, VALID_MIME_TYPES).required("required"), }); +const targetTypeKey: keyof FV = "targetType"; + export const schema = schemaFn({ name: requiredString, description: requiredString, @@ -37,4 +39,13 @@ export const schema = schemaFn({ "must be in the future", (v) => !v || v >= new Date().toISOString() ), + + fixedTarget: stringNumber( + (s) => + s.when(targetTypeKey, (values, schema) => { + const [type] = values as [FV["targetType"]]; + return type === "fixed" ? schema.required("required") : schema; + }), + (n) => n.positive("must be greater than 0") + ), }); diff --git a/src/pages/Funds/CreateFund/types.ts b/src/pages/Funds/CreateFund/types.ts index 1bc516f3c4..314083d7c1 100644 --- a/src/pages/Funds/CreateFund/types.ts +++ b/src/pages/Funds/CreateFund/types.ts @@ -13,6 +13,8 @@ export interface Settings { allowBgTip: boolean; } +export type TargetType = "fixed" | "none" | "smart"; + export interface FormValues { name: string; description: string; @@ -22,4 +24,6 @@ export interface FormValues { featured: boolean; members: FundMember[]; settings: Settings; + targetType: TargetType; + fixedTarget: string; } diff --git a/src/types/aws/ap/index.ts b/src/types/aws/ap/index.ts index e7098b5654..236e8303b7 100644 --- a/src/types/aws/ap/index.ts +++ b/src/types/aws/ap/index.ts @@ -254,6 +254,10 @@ export interface Fund { expiration?: string; verified: boolean; donation_total_usd: number; + /** undefined: no target */ + target?: "smart" | `${number}`; + /** endowIds that allows this fundraiser on their profile */ + approvers: number[]; } export namespace Fund { export interface New @@ -266,6 +270,7 @@ export namespace Fund { | "featured" | "settings" | "expiration" + | "target" > { /** endowment ids */ members: number[]; @@ -284,6 +289,8 @@ export namespace Fund { | "verified" | "donation_total_usd" | "members" + | "target" + | "approvers" > {} export interface CardsPage { From f4cc54b6a38a572111af4d61975c3f813fbf3f3d Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:25:08 +0800 Subject: [PATCH 12/47] Rc v2.5 update (#3220) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Cherry Fixes (#3197) * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * Chariot prod key requirements (#3198) * 50 usd min amount * summary skips * create dedicated chariot checkout form * use props namespace * modal dismissible * floor instead of ceil * set min * update test * remove dup (#3202) * prefill billing details (#3201) * Dapp logo, go to BG if in widget - client side navigation to homepage otherwise (#3203) * image accepts render prop instead of elaborate variations * update dapp logo to use render pro * widget logo points to bg website * BG-1511: Fix Oauth stuck on /auth-redirector (#3204) * upgrade to v6 router * navigate * admin to lazy api * lazy load more page * to router lazy * lazy load more route * Donate widget * done using router lazy * avoid assigning to variable component * revert file renameing * fix test * add register routes * nested registration steps * use fireevent instead * switch to object notation * more accurate type * adminRoutes * media routs * gift route * profile routes * Routes freegit add . * lazy load * update sentry * remove console log * missign editor * signup lazy * bank application lazy * donate widget * catch all route * amplify at top * Cherry fixes (#3219) * v2.4.1 (#3162) * Admin member names (#3159) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widget content * doante state to be constructed inside * use intent instead * remove reducer * state shape * crypto sender * hello * tip format * clearer state * merge or replace * working fiat intent * remove redundant * remove unwanted * add mode * to switch * fixes * daf and stocks doesnt skip * add loader * remoev unused comment * convert widget slice to plain state * set init state instead * skip split * remove comment * remove unsed * resume no longer need intermediary donation loader page * info comment * add recipientId * apply skips on back * revert crypto checkout * revert stripe checkout * revert stripe checkout * tx submit loading * reset tip on token change * change comment loctin * tip back to donate form if skipped * revert rename * remove unsed comment * remove unused omit * verbose comment * revert optional * remove intent after loading * fetch hide tip config * info * split desc * testimonial copy fixes (#3007) * BG-1357: DB Split settings (#3008) * render slider * split fix flag * fix check field * change type and adjust (#3006) * add in donation state * mix db value to widget value * add label * revert mixup * standalone source attr * format * revert for endow option * take inverse * fee corrected & copy updates in Admin Settings (#3016) * Payout min edit UI (#3015) * update type and add field * add placeholder * add spacing * Methods widget config (#3017) * add method types * donate methods widget config * remove unused * order configurer component * format * error message * error msg * fix bug * no need for whole mthod * revert smaple * error msg * Donate methods admin setting (#3018) * move comp and helper * sort * reuse in settings page * doante page use setting * update link (#3009) * swap tab name (#3019) * distinguish supported/unsupported * qr token type * format * switch to chainId map * reverts * generic donate thanks * add spacing * create intent on direct donation * add space * rename * remove as const * format * Add lefthook git hooks (#3020) * lefthook install and config * hello world * hello world * add glob * ehello world * x * x * test * test * test * testunused * testunused * Endow videos UI (#3021) * media endpoints * use v1 * media page and route * container and header * featured video container * video adder modal * show modal * add video wiring * paginated videos * edit pros * video preview * videos nested * adder to edidtor * update payload * init params * responsive video * toggle featured * increase card per row * add disabled * pagination limit * render videos in profile * edit albel * BG-1374: admin settings tweaks (#3033) * 5 rows * separator heading * move payout minimum * remove unused * switch from Algolia >> CloudSearch (#3034) * Widget custom title and description (#3035) * udpate checkfield style * parse description in widget page * add onChange check field * title and description fields * show fallback if empty * get recipient addr * revert additional wallets * direct button primary accent --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Andrey Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Program metrics (#3041) * add new attributes * target raise edit field * program tally * targetRaise is nullable * unset targetRaise * Update src/pages/Admin/Charity/ProgramEditor/ProgramInfo/ProgramInfo.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * nav dropdown label fixes * BG-1381: Program selector in widget (#3049) * export program selector * load everythig * add in snippet program id * add prog field * parse program id * program initial state widget * add on loaded * update stocks schema * update stocks schema * remove unused * ignore lint * preview selected program * BG-1383 BG-1384 minor fixes (#3051) * User bookmarks (#3052) * remove old type * bookmarks update * bookmarks btn * bookmarks list * bookmarks lists * userId from jwt * favorite -> profile * update endpoints * Header search V1 (#3054) * convert to input * show on focus * update styles * remain open when hovered * marketplace context * convert to context * remoev log * marketplace flag * endowments search * unitialized as loading * separate search component * search dropdown component * propagate search to marketplace * link home and marketplace query * debounce happens in useCards * BG-1385 WP Plugin doc page (#3053) * WP Plugin Documentation page * remove import * clean up table * address PR feedback * fix typo * add top countries (#3065) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 402c3d5b7161c68616482fc5a5e63839f1ba58ff. * Update deps (#3066) * batch one updates * update deps * replace iwth write * BG-1393: UK aid UI (#3068) * batch one updates * update deps * replace iwth write * uk fields * shown checkbox not crypto * form donor and server format * change format * donor address apes * add annotation * Update src/components/donation/Steps/Summary/DonorForm.tsx --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Display top countries (#3070) * endpoint * top countries data-access * new chains integrated (#3080) * new chains updated * add chains to other types * update rest of token/chain items; add stargaze/kujira testnets; * add new chains to keplr wallet * BG-1390: Cards v2 (#3081) * remove implicit fields * card content * bookmark btn improvement * link and button within card * bookmark btn optimistic update * comments * fix arg * remove decimal * Custom tokens UI (#3069) * coin gecko query * token search component * add name and logo * add coingecko platformId * add static list * temp remove queyr * warning * use fuse for search * remove coins * max size * init token not required * add example * file size * proceed button * dont format json * set as token * ignore json * no need for amount * remoev custom solana xrp * platformId * udpate coins * usd rate --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Chain selector (#3082) * add logos * chain combobox * use new chain selector * option chainId to chainId * value chainId * Osmosis support added (#3084) * add osmosis chains * post-fix 'Testnet' to unsupported chain name (when applicable) * Headless UI v2 (#3085) * headless ui * done batch one * done coutnries * done batch two * done batch 3 * done batch 4 * chain selector scroller click * token options scroll click fix * max height * remove extra border * downgrade yarn * fix program hidden * combobox null value * 2.1.0 transition built in dialog --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Add coinbase extension wallet (#3087) * update icons * use 6963 and add coinbase * update icon imports * unload after switching error --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * QR copy (#3088) * add QR warning * more readable * In honor of field (#3089) * honor field * set from intent * closer to label * close to lable * rename form * wiring * Fix token selector search and updates (#3091) * combobox inside popover * search icon on right * rename interface * BG-1417: Cheque FAQ (#3105) * add content * faq content * BG-1423: chain selector updates (#3104) * change type and adjust for chainId '' * shorter * sort chains * display and focus on error * Network dropdown bug fixes (#3106) * add immediate to open on focus * remove hidden input * WP url updated * BG-1424: Improve token search (#3102) * add not listed * mixed * virtualized * per chain json file * biome ignore * add missing * add token placeholder * spacing * Revert "WP url updated" This reverts commit ffb68148308d6078a762e0741cc779814c854ff2. * upgrade to signclient (#3103) * Network select should focus first when all is error (#3109) * more flexible api * use new api * selector value is chainId * remove hookform context * Donate crash + cherry pick from master (#3108) * make default values required * remove undefined * remove placeholder (#3039) * BG-1380: share fixes (#3040) * remove excess * lines and punctuations * handles and notes * BG-1382: Users unable to create programs occasionally (#3050) * fetch new token * comment * refresh token every 5 minutes * add ms multiplier (#3067) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 3ecb5d0958a5645a1ddda2d2d6284883362c13d9. * fix source (#3083) --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Crypto form integration test (#3110) * init test and mocks * persisted state * empty form validation msgs * prior to selecting token * error correcting * remove test id * BG-1399: Stripe status handling for manual bank verification (#3107) * Update stripe payment status API to use latest version * Added verify bank account button to 'pending' tab in My Donations * Add 'arrivalDate' in Donations Thanks page * Donation Thanks Page for 'requires_action' status and logged in donor * Show bank verification link for guest donors on thank you page * Removed redundant comment * Renamed 'Verify Bank Account' to 'Action' * Removed unused import * Add type def for specific bank verification fields * Add wordpress assets to post page (#3090) * add in public assets and load via react helmet * remove extra space * dry input * preserve header and footer style --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Stripe form integration test (#3111) * update currency selector with accessible headless components * extract rhf from field * no rhf stripe form * add missing error * rhf hook * rhf * should focus * init setup * prefilled state * validation test and increments * stripe form loading and error * Node proxies (#3113) * optimism proxy * revert mistake * base proxy * terra proxies * stargaze and juno, compress lcd,rpc to nodeUrl * osmosis * kujira * update terra * Add 'ukGiftAid' field in fiat donation payload (#3121) * WP URL updated * Cover processing fee UI (#3112) * processing fees * fee allowance on intent * fix type errors * fee allowance checkbox * flatten * save as fee allowance instead of bool * processing fee row * fee allowance row * remove console log * add fee allowance to estimate gross amount * add to deps list * tip doesnt disable processign fee * total include processing fee * parent set border child set individual padding * no need for custom bottom margin * psersistend state doesnt drive UI show * fix ts error * Copy tweak --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1437: Tribute notif UI (#3122) * fix: pass type * form elements * schema and field sizing * remove unused import * init tribute * stripe checkout tribute wiring * wiring crypto * fix spacing * fix initial size of * msg char counter * FIX: header footer styles (#3124) * only apply wp override in /blog * only apply wp override on /blog * only to blog/:slug * stocks form test (#3126) * Async chain (#3123) * update definition and adjust consumers * cached get chain options * use token definition * only pick subset * actual url * New donations table fields (#3125) * Update '/ap/donations.ts' types with new fields * Fix 'Action' column for fiat bank verification url in mobile table * Fix 'Action' column for fiat bank verification url in donations table * Added 'Recurring' column for donor My Donations tables * Added 'Direct Donation' and 'SF Donation' columns for donor My Donations tables * Added 'appUsed' in nonprofit My Donations table * Added 'paymentMethod' in nonprofit My Donations table * Added 'isRecurring' in nonprofit My Donations table * Single csv report * Add other fields into nonprofit Donations table * Fix 'Load More' button to span full width of table * DAF form test + MSW mocking (#3127) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * Add staging endpoint for S3 file uploading (#3139) * Donate steps - test skips and resets (#3128) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * compress images and use webp format (#3140) * Stripe checkout test - error paths (#3141) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused * client secret loading * by test id * separate file * error * error modals * donate btn * remove debug * UI updates (#3142) * rounded widget form * common donor terms * reuse in preview * update words * revert order * BG-1452: CC always goes along with DAF (#3145) * tooltip detail * cc locking * append stripe if applicable * add cc if daf && no cc * Summary form integration test (#3146) * factor out selector * no form context field and selector * native checkfield * keep description * add accessible error message * uk gift aid test * done tribute fields * top level * Payment tab label: card >> card/bank * init lock (#3147) * Update donations tables (#3144) * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for donor donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO csv file * Set fill function as new 'replaceWithEmptyString' helper function * Updated csv file fields for donor donations * Updated payment method values for NPO donations table and csv file * Changed csv value for 'Donation Origin' to be the same with corresponding NPO donation table column * Set 'Finish Paying' column name to 'Action' for donor intent table * Removed excess '- - -' which consumes 1 column for intent and finalized donor tabs * Set bank verification url action as a button * Update 'Network' column to 'Donation Type' column for donor donations table * Display date in csv file as it appears in respective donation tables for donor and NPO * Display amounts in csv files to 2 decimal places - both NPO and donor tables * Deleted unused 'paymentMethod' helper function and rolled back changes to NPO donations table for donation type * Update column name 'Network' to 'Donation Type' for donor donations table csv * Set 'Finish Paying' column name to 'Action' for donor intent mobile table * Summary step integration test (#3148) * coin gecko mock handlers * test rows * auth cases * descripbe name * use waitFor instead --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Alerts opt out (#3149) * settings route * detailed endows endpoint * userId * alert row * submit handler * query * reuse in endowment link * default checked * update wiring * bump to v3 * add success prompt * preserve bookmark link * correct route * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/EndowAlertForm.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * lint fix * spacing --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * endow admin object * handle overflow * bump v2 --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Terms move from page to checkout (#3160) * t&c in each checkout screen * remove in /donate page * donate widget page remove * widget preview remove * remove unused * remove unused import * donation terms move closer * temp hide UK GiftAid checkbox (#3161) * temp hide UK GiftAid checkbox * temp disable UK GiftAid Tests --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * v2.4.2 (#3181) * Disable tracking in `/donate-widget` (#3163) * move script to Seo component * override seo in widget page * remove duplicate route * override when inside widget route * donate widget override * `Login` consistency (#3164) * login consistency * vitest upgrade * Auth redirect (#3165) * move hub to app * use hub state instead of local storage * convert to uncontrolled * add isNpo flag * password input autocomplete requirement * autocomplete requirement * state -> fromState * state -> fromState * trigger vaidation when clicking google signin * move user type to top * auth redirect * add comment * protected redirects to signup (#3178) * No edit name (#3177) * disable and add tooltip * bump version * use prompts instead (#3179) * Program info in summary (#3180) * accept program * render program * provide program value --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Bg1489 faqs (#3183) * Email bugs (#3184) * switch to no cors: verified to be still running * move override further down --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * update linkedin tracker (#3199) * v2.4.3 (#3205) * DAF Checkout with chariot (#3143) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widge… --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh --- src/App/App.tsx | 2 ++ .../donation/Steps/DonateMethods/Daf/Form.test.tsx | 2 +- src/index.tsx | 2 -- src/pages/Funds/CreateFund/index.ts | 2 +- src/pages/Funds/Fund.tsx | 4 ++-- src/pages/Funds/Funds.tsx | 2 +- src/pages/Funds/index.ts | 3 --- src/pages/Funds/index.tsx | 12 ++++++++++++ 8 files changed, 19 insertions(+), 10 deletions(-) delete mode 100644 src/pages/Funds/index.ts create mode 100644 src/pages/Funds/index.tsx diff --git a/src/App/App.tsx b/src/App/App.tsx index f914520b4d..511fa6a19d 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -5,6 +5,7 @@ import useScrollTop from "hooks/useScrollTop"; import NProgress from "nprogress"; import { adminRoute } from "pages/Admin"; import { routes as blogRoutes } from "pages/Blog"; +import { fundsRoute } from "pages/Funds"; import { legalRoutes } from "pages/Legal"; import OAuthRedirector from "pages/OAuthRedirector"; import { profileRoute } from "pages/Profile"; @@ -38,6 +39,7 @@ const widgetRoutes: RO[] = [ const _appRoutes: RO[] = [ adminRoute, regRoute, + fundsRoute, userDashboardRoute, ...blogRoutes, ...legalRoutes, diff --git a/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx b/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx index 10834e1f2c..1c09fd1972 100644 --- a/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx +++ b/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx @@ -93,7 +93,7 @@ describe("DAF form test", () => { await userEvent.clear(amountInput); await userEvent.type(amountInput, "-5"); - expect(screen.getByText(/must be greater than 0/i)).toBeInTheDocument(); + expect(screen.getByText(/minimum donation is \$50/i)).toBeInTheDocument(); await userEvent.clear(amountInput); await userEvent.type(amountInput, "50"); diff --git a/src/index.tsx b/src/index.tsx index 9bb4abd5a6..222ae50add 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -30,8 +30,6 @@ Amplify.configure(amplifyConfig); const container = document.getElementById("root"); const root = createRoot(container as Element); -Amplify.configure(amplifyConfig); - Sentry.init({ dsn: process.env.PUBLIC_SENTRY_DSN, environment: process.env.PUBLIC_ENVIRONMENT, diff --git a/src/pages/Funds/CreateFund/index.ts b/src/pages/Funds/CreateFund/index.ts index e306cdb704..99fb330beb 100644 --- a/src/pages/Funds/CreateFund/index.ts +++ b/src/pages/Funds/CreateFund/index.ts @@ -1 +1 @@ -export { default } from "./CreateFund"; +export { default as Component } from "./CreateFund"; diff --git a/src/pages/Funds/Fund.tsx b/src/pages/Funds/Fund.tsx index aad48f23a2..09b5fa0fb8 100644 --- a/src/pages/Funds/Fund.tsx +++ b/src/pages/Funds/Fund.tsx @@ -1,6 +1,6 @@ import { useParams } from "react-router-dom"; -export function Fund() { +export function Component() { const params = useParams(); - return

WIP: Fund: {params.id}

; + return

WIP: Fund: {params.fundId}

; } diff --git a/src/pages/Funds/Funds.tsx b/src/pages/Funds/Funds.tsx index d677523b90..9b7b32c510 100644 --- a/src/pages/Funds/Funds.tsx +++ b/src/pages/Funds/Funds.tsx @@ -2,7 +2,7 @@ import Icon from "components/Icon"; import { useState } from "react"; import Cards from "./Cards"; -export default function Funds() { +export function Component() { const [search, setSearch] = useState(""); return (
diff --git a/src/pages/Funds/index.ts b/src/pages/Funds/index.ts deleted file mode 100644 index b1eb5a8767..0000000000 --- a/src/pages/Funds/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { default } from "./Funds"; -export { default as CreateFund } from "./CreateFund"; -export { Fund } from "./Fund"; diff --git a/src/pages/Funds/index.tsx b/src/pages/Funds/index.tsx new file mode 100644 index 0000000000..2ce455c9bd --- /dev/null +++ b/src/pages/Funds/index.tsx @@ -0,0 +1,12 @@ +import { appRoutes } from "constants/routes"; +import { Outlet, type RouteObject } from "react-router-dom"; + +export const fundsRoute: RouteObject = { + path: appRoutes.funds, + element: , + children: [ + { index: true, lazy: () => import("./Funds") }, + { path: ":fundId", lazy: () => import("./Fund") }, + { path: "new", lazy: () => import("./CreateFund") }, + ], +}; From e6589d5c59837ed1856564bae6d31a5689f77640 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:25:35 +0800 Subject: [PATCH 13/47] Fund editor, fund profile (#3196) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add target * remove unused * fundraiser goal * comment 2 * progress * move funds list in user dashboard * funds list page * fix: admin pages reloading on navigation * correct constants * edit types * img form * img form * fund info form * fund info first * featured checkfield * spacing * Cherry Fixes (#3197) * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * Chariot prod key requirements (#3198) * 50 usd min amount * summary skips * create dedicated chariot checkout form * use props namespace * modal dismissible * floor instead of ceil * set min * update test * remove dup (#3202) * prefill billing details (#3201) * Dapp logo, go to BG if in widget - client side navigation to homepage otherwise (#3203) * image accepts render prop instead of elaborate variations * update dapp logo to use render pro * widget logo points to bg website * BG-1511: Fix Oauth stuck on /auth-redirector (#3204) * upgrade to v6 router * navigate * admin to lazy api * lazy load more page * to router lazy * lazy load more route * Donate widget * done using router lazy * avoid assigning to variable component * revert file renameing * fix test * add register routes * nested registration steps * use fireevent instead * switch to object notation * more accurate type * adminRoutes * media routs * gift route * profile routes * Routes freegit add . * lazy load * update sentry * remove console log * missign editor * signup lazy * bank application lazy * donate widget * catch all route * amplify at top * Cherry fixes (#3219) * v2.4.1 (#3162) * Admin member names (#3159) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widget content * doante state to be constructed inside * use intent instead * remove reducer * state shape * crypto sender * hello * tip format * clearer state * merge or replace * working fiat intent * remove redundant * remove unwanted * add mode * to switch * fixes * daf and stocks doesnt skip * add loader * remoev unused comment * convert widget slice to plain state * set init state instead * skip split * remove comment * remove unsed * resume no longer need intermediary donation loader page * info comment * add recipientId * apply skips on back * revert crypto checkout * revert stripe checkout * revert stripe checkout * tx submit loading * reset tip on token change * change comment loctin * tip back to donate form if skipped * revert rename * remove unsed comment * remove unused omit * verbose comment * revert optional * remove intent after loading * fetch hide tip config * info * split desc * testimonial copy fixes (#3007) * BG-1357: DB Split settings (#3008) * render slider * split fix flag * fix check field * change type and adjust (#3006) * add in donation state * mix db value to widget value * add label * revert mixup * standalone source attr * format * revert for endow option * take inverse * fee corrected & copy updates in Admin Settings (#3016) * Payout min edit UI (#3015) * update type and add field * add placeholder * add spacing * Methods widget config (#3017) * add method types * donate methods widget config * remove unused * order configurer component * format * error message * error msg * fix bug * no need for whole mthod * revert smaple * error msg * Donate methods admin setting (#3018) * move comp and helper * sort * reuse in settings page * doante page use setting * update link (#3009) * swap tab name (#3019) * distinguish supported/unsupported * qr token type * format * switch to chainId map * reverts * generic donate thanks * add spacing * create intent on direct donation * add space * rename * remove as const * format * Add lefthook git hooks (#3020) * lefthook install and config * hello world * hello world * add glob * ehello world * x * x * test * test * test * testunused * testunused * Endow videos UI (#3021) * media endpoints * use v1 * media page and route * container and header * featured video container * video adder modal * show modal * add video wiring * paginated videos * edit pros * video preview * videos nested * adder to edidtor * update payload * init params * responsive video * toggle featured * increase card per row * add disabled * pagination limit * render videos in profile * edit albel * BG-1374: admin settings tweaks (#3033) * 5 rows * separator heading * move payout minimum * remove unused * switch from Algolia >> CloudSearch (#3034) * Widget custom title and description (#3035) * udpate checkfield style * parse description in widget page * add onChange check field * title and description fields * show fallback if empty * get recipient addr * revert additional wallets * direct button primary accent --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Andrey Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Program metrics (#3041) * add new attributes * target raise edit field * program tally * targetRaise is nullable * unset targetRaise * Update src/pages/Admin/Charity/ProgramEditor/ProgramInfo/ProgramInfo.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * nav dropdown label fixes * BG-1381: Program selector in widget (#3049) * export program selector * load everythig * add in snippet program id * add prog field * parse program id * program initial state widget * add on loaded * update stocks schema * update stocks schema * remove unused * ignore lint * preview selected program * BG-1383 BG-1384 minor fixes (#3051) * User bookmarks (#3052) * remove old type * bookmarks update * bookmarks btn * bookmarks list * bookmarks lists * userId from jwt * favorite -> profile * update endpoints * Header search V1 (#3054) * convert to input * show on focus * update styles * remain open when hovered * marketplace context * convert to context * remoev log * marketplace flag * endowments search * unitialized as loading * separate search component * search dropdown component * propagate search to marketplace * link home and marketplace query * debounce happens in useCards * BG-1385 WP Plugin doc page (#3053) * WP Plugin Documentation page * remove import * clean up table * address PR feedback * fix typo * add top countries (#3065) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 402c3d5b7161c68616482fc5a5e63839f1ba58ff. * Update deps (#3066) * batch one updates * update deps * replace iwth write * BG-1393: UK aid UI (#3068) * batch one updates * update deps * replace iwth write * uk fields * shown checkbox not crypto * form donor and server format * change format * donor address apes * add annotation * Update src/components/donation/Steps/Summary/DonorForm.tsx --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Display top countries (#3070) * endpoint * top countries data-access * new chains integrated (#3080) * new chains updated * add chains to other types * update rest of token/chain items; add stargaze/kujira testnets; * add new chains to keplr wallet * BG-1390: Cards v2 (#3081) * remove implicit fields * card content * bookmark btn improvement * link and button within card * bookmark btn optimistic update * comments * fix arg * remove decimal * Custom tokens UI (#3069) * coin gecko query * token search component * add name and logo * add coingecko platformId * add static list * temp remove queyr * warning * use fuse for search * remove coins * max size * init token not required * add example * file size * proceed button * dont format json * set as token * ignore json * no need for amount * remoev custom solana xrp * platformId * udpate coins * usd rate --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Chain selector (#3082) * add logos * chain combobox * use new chain selector * option chainId to chainId * value chainId * Osmosis support added (#3084) * add osmosis chains * post-fix 'Testnet' to unsupported chain name (when applicable) * Headless UI v2 (#3085) * headless ui * done batch one * done coutnries * done batch two * done batch 3 * done batch 4 * chain selector scroller click * token options scroll click fix * max height * remove extra border * downgrade yarn * fix program hidden * combobox null value * 2.1.0 transition built in dialog --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Add coinbase extension wallet (#3087) * update icons * use 6963 and add coinbase * update icon imports * unload after switching error --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * QR copy (#3088) * add QR warning * more readable * In honor of field (#3089) * honor field * set from intent * closer to label * close to lable * rename form * wiring * Fix token selector search and updates (#3091) * combobox inside popover * search icon on right * rename interface * BG-1417: Cheque FAQ (#3105) * add content * faq content * BG-1423: chain selector updates (#3104) * change type and adjust for chainId '' * shorter * sort chains * display and focus on error * Network dropdown bug fixes (#3106) * add immediate to open on focus * remove hidden input * WP url updated * BG-1424: Improve token search (#3102) * add not listed * mixed * virtualized * per chain json file * biome ignore * add missing * add token placeholder * spacing * Revert "WP url updated" This reverts commit ffb68148308d6078a762e0741cc779814c854ff2. * upgrade to signclient (#3103) * Network select should focus first when all is error (#3109) * more flexible api * use new api * selector value is chainId * remove hookform context * Donate crash + cherry pick from master (#3108) * make default values required * remove undefined * remove placeholder (#3039) * BG-1380: share fixes (#3040) * remove excess * lines and punctuations * handles and notes * BG-1382: Users unable to create programs occasionally (#3050) * fetch new token * comment * refresh token every 5 minutes * add ms multiplier (#3067) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 3ecb5d0958a5645a1ddda2d2d6284883362c13d9. * fix source (#3083) --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Crypto form integration test (#3110) * init test and mocks * persisted state * empty form validation msgs * prior to selecting token * error correcting * remove test id * BG-1399: Stripe status handling for manual bank verification (#3107) * Update stripe payment status API to use latest version * Added verify bank account button to 'pending' tab in My Donations * Add 'arrivalDate' in Donations Thanks page * Donation Thanks Page for 'requires_action' status and logged in donor * Show bank verification link for guest donors on thank you page * Removed redundant comment * Renamed 'Verify Bank Account' to 'Action' * Removed unused import * Add type def for specific bank verification fields * Add wordpress assets to post page (#3090) * add in public assets and load via react helmet * remove extra space * dry input * preserve header and footer style --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Stripe form integration test (#3111) * update currency selector with accessible headless components * extract rhf from field * no rhf stripe form * add missing error * rhf hook * rhf * should focus * init setup * prefilled state * validation test and increments * stripe form loading and error * Node proxies (#3113) * optimism proxy * revert mistake * base proxy * terra proxies * stargaze and juno, compress lcd,rpc to nodeUrl * osmosis * kujira * update terra * Add 'ukGiftAid' field in fiat donation payload (#3121) * WP URL updated * Cover processing fee UI (#3112) * processing fees * fee allowance on intent * fix type errors * fee allowance checkbox * flatten * save as fee allowance instead of bool * processing fee row * fee allowance row * remove console log * add fee allowance to estimate gross amount * add to deps list * tip doesnt disable processign fee * total include processing fee * parent set border child set individual padding * no need for custom bottom margin * psersistend state doesnt drive UI show * fix ts error * Copy tweak --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1437: Tribute notif UI (#3122) * fix: pass type * form elements * schema and field sizing * remove unused import * init tribute * stripe checkout tribute wiring * wiring crypto * fix spacing * fix initial size of * msg char counter * FIX: header footer styles (#3124) * only apply wp override in /blog * only apply wp override on /blog * only to blog/:slug * stocks form test (#3126) * Async chain (#3123) * update definition and adjust consumers * cached get chain options * use token definition * only pick subset * actual url * New donations table fields (#3125) * Update '/ap/donations.ts' types with new fields * Fix 'Action' column for fiat bank verification url in mobile table * Fix 'Action' column for fiat bank verification url in donations table * Added 'Recurring' column for donor My Donations tables * Added 'Direct Donation' and 'SF Donation' columns for donor My Donations tables * Added 'appUsed' in nonprofit My Donations table * Added 'paymentMethod' in nonprofit My Donations table * Added 'isRecurring' in nonprofit My Donations table * Single csv report * Add other fields into nonprofit Donations table * Fix 'Load More' button to span full width of table * DAF form test + MSW mocking (#3127) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * Add staging endpoint for S3 file uploading (#3139) * Donate steps - test skips and resets (#3128) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * compress images and use webp format (#3140) * Stripe checkout test - error paths (#3141) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused * client secret loading * by test id * separate file * error * error modals * donate btn * remove debug * UI updates (#3142) * rounded widget form * common donor terms * reuse in preview * update words * revert order * BG-1452: CC always goes along with DAF (#3145) * tooltip detail * cc locking * append stripe if applicable * add cc if daf && no cc * Summary form integration test (#3146) * factor out selector * no form context field and selector * native checkfield * keep description * add accessible error message * uk gift aid test * done tribute fields * top level * Payment tab label: card >> card/bank * init lock (#3147) * Update donations tables (#3144) * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for donor donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO csv file * Set fill function as new 'replaceWithEmptyString' helper function * Updated csv file fields for donor donations * Updated payment method values for NPO donations table and csv file * Changed csv value for 'Donation Origin' to be the same with corresponding NPO donation table column * Set 'Finish Paying' column name to 'Action' for donor intent table * Removed excess '- - -' which consumes 1 column for intent and finalized donor tabs * Set bank verification url action as a button * Update 'Network' column to 'Donation Type' column for donor donations table * Display date in csv file as it appears in respective donation tables for donor and NPO * Display amounts in csv files to 2 decimal places - both NPO and donor tables * Deleted unused 'paymentMethod' helper function and rolled back changes to NPO donations table for donation type * Update column name 'Network' to 'Donation Type' for donor donations table csv * Set 'Finish Paying' column name to 'Action' for donor intent mobile table * Summary step integration test (#3148) * coin gecko mock handlers * test rows * auth cases * descripbe name * use waitFor instead --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Alerts opt out (#3149) * settings route * detailed endows endpoint * userId * alert row * submit handler * query * reuse in endowment link * default checked * update wiring * bump to v3 * add success prompt * preserve bookmark link * correct route * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/EndowAlertForm.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * lint fix * spacing --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * endow admin object * handle overflow * bump v2 --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Terms move from page to checkout (#3160) * t&c in each checkout screen * remove in /donate page * donate widget page remove * widget preview remove * remove unused * remove unused import * donation terms move closer * temp hide UK GiftAid checkbox (#3161) * temp hide UK GiftAid checkbox * temp disable UK GiftAid Tests --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * v2.4.2 (#3181) * Disable tracking in `/donate-widget` (#3163) * move script to Seo component * override seo in widget page * remove duplicate route * override when inside widget route * donate widget override * `Login` consistency (#3164) * login consistency * vitest upgrade * Auth redirect (#3165) * move hub to app * use hub state instead of local storage * convert to uncontrolled * add isNpo flag * password input autocomplete requirement * autocomplete requirement * state -> fromState * state -> fromState * trigger vaidation when clicking google signin * move user type to top * auth redirect * add comment * protected redirects to signup (#3178) * No edit name (#3177) * disable and add tooltip * bump version * use prompts instead (#3179) * Program info in summary (#3180) * accept program * render program * provide program value --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Bg1489 faqs (#3183) * Email bugs (#3184) * switch to no cors: verified to be still running * move override further down --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * update linkedin tracker (#3199) * v2.4.3 (#3205) * DAF Checkout with chariot (#3143) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widge… * default values and wiring * auto upload of pic * remove ping query * loading text size * remove grouping * isDirty * basic fund profile * field sizing and wrapping * clamp description * save to close only * add authorization * edit profile validation * single form * spacing * featured banner and update types * fund editing * fund already closed error * placeholder tagline * manifest closed * remove unused * unused export --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh --- src/App/Header/UserMenu/EndowmentLink.tsx | 6 +- src/App/Header/UserMenu/Funds.tsx | 25 -- src/App/Header/UserMenu/Menu.tsx | 2 - src/pages/Funds/Cards/Card.tsx | 2 +- src/pages/Funds/Cards/Progress.tsx | 2 +- src/pages/Funds/CreateFund/CreateFund.tsx | 27 +-- src/pages/Funds/CreateFund/GoalSelector.tsx | 2 +- src/pages/Funds/CreateFund/schema.ts | 12 +- src/pages/Funds/CreateFund/types.ts | 3 +- src/pages/Funds/EditFund/EditFund.tsx | 50 ++++ src/pages/Funds/EditFund/FeatureBanner.tsx | 51 +++++ src/pages/Funds/EditFund/Form.tsx | 216 ++++++++++++++++++ src/pages/Funds/EditFund/index.ts | 1 + src/pages/Funds/EditFund/types.ts | 10 + src/pages/Funds/EditFund/useRhf.ts | 90 ++++++++ src/pages/Funds/Fund.tsx | 6 - src/pages/Funds/Fund/Body/Body.tsx | 61 +++++ src/pages/Funds/Fund/Body/DonateButton.tsx | 17 ++ .../GeneralInfo/DetailsColumn/Balances.tsx | 25 ++ .../DetailsColumn/DetailsColumn.tsx | 14 ++ .../Body/GeneralInfo/DetailsColumn/index.ts | 1 + .../Fund/Body/GeneralInfo/GeneralInfo.tsx | 22 ++ .../Funds/Fund/Body/GeneralInfo/index.ts | 1 + .../Funds/Fund/Body/common/Container.tsx | 70 ++++++ src/pages/Funds/Fund/Body/index.ts | 1 + src/pages/Funds/Fund/FundContext.ts | 14 ++ src/pages/Funds/Fund/PageError.tsx | 18 ++ src/pages/Funds/Fund/Skeleton.tsx | 40 ++++ src/pages/Funds/Fund/index.tsx | 48 ++++ src/pages/Funds/common/GoalSelector.tsx | 37 +++ src/pages/Funds/common/index.ts | 13 ++ src/pages/Funds/index.tsx | 1 + src/pages/UserDashboard/Funds/Funds.tsx | 80 +++++++ src/pages/UserDashboard/Funds/index.ts | 1 + src/pages/UserDashboard/UserDashboard.tsx | 7 +- src/pages/UserDashboard/routes.ts | 9 + src/services/aws/aws.ts | 2 + src/services/aws/funds.ts | 29 +++ src/services/aws/users.ts | 2 +- src/types/aws/ap/index.ts | 15 +- 40 files changed, 959 insertions(+), 74 deletions(-) delete mode 100644 src/App/Header/UserMenu/Funds.tsx create mode 100644 src/pages/Funds/EditFund/EditFund.tsx create mode 100644 src/pages/Funds/EditFund/FeatureBanner.tsx create mode 100644 src/pages/Funds/EditFund/Form.tsx create mode 100644 src/pages/Funds/EditFund/index.ts create mode 100644 src/pages/Funds/EditFund/types.ts create mode 100644 src/pages/Funds/EditFund/useRhf.ts delete mode 100644 src/pages/Funds/Fund.tsx create mode 100644 src/pages/Funds/Fund/Body/Body.tsx create mode 100644 src/pages/Funds/Fund/Body/DonateButton.tsx create mode 100644 src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/Balances.tsx create mode 100644 src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/DetailsColumn.tsx create mode 100644 src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/index.ts create mode 100644 src/pages/Funds/Fund/Body/GeneralInfo/GeneralInfo.tsx create mode 100644 src/pages/Funds/Fund/Body/GeneralInfo/index.ts create mode 100644 src/pages/Funds/Fund/Body/common/Container.tsx create mode 100644 src/pages/Funds/Fund/Body/index.ts create mode 100644 src/pages/Funds/Fund/FundContext.ts create mode 100644 src/pages/Funds/Fund/PageError.tsx create mode 100644 src/pages/Funds/Fund/Skeleton.tsx create mode 100644 src/pages/Funds/Fund/index.tsx create mode 100644 src/pages/Funds/common/GoalSelector.tsx create mode 100644 src/pages/Funds/common/index.ts create mode 100644 src/pages/UserDashboard/Funds/Funds.tsx create mode 100644 src/pages/UserDashboard/Funds/index.ts diff --git a/src/App/Header/UserMenu/EndowmentLink.tsx b/src/App/Header/UserMenu/EndowmentLink.tsx index 5ae5ba1aac..b900804937 100644 --- a/src/App/Header/UserMenu/EndowmentLink.tsx +++ b/src/App/Header/UserMenu/EndowmentLink.tsx @@ -5,7 +5,7 @@ import QueryLoader from "components/QueryLoader"; import { appRoutes } from "constants/routes"; import { Link } from "react-router-dom"; import { useEndowment } from "services/aws/useEndowment"; -import type { UserEndow, UserFund } from "types/aws"; +import type { UserEndow } from "types/aws"; interface IBookmarkLink { endowId: number; @@ -29,10 +29,6 @@ export function EndowmentLink({ endowID, logo, name }: UserEndow) { return <_Link id={endowID} logo={logo} name={name} route={appRoutes.admin} />; } -export function FundLink({ id, logo, name }: UserFund) { - return <_Link id={id} logo={logo} name={name} route={appRoutes.admin} />; -} - type LinkProps = { id: number | string; name?: string; diff --git a/src/App/Header/UserMenu/Funds.tsx b/src/App/Header/UserMenu/Funds.tsx deleted file mode 100644 index e8e306e91b..0000000000 --- a/src/App/Header/UserMenu/Funds.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { useUserFundsQuery } from "services/aws/users"; -import { FundLink, Skeleton } from "./EndowmentLink"; - -interface Props { - userId: string; - classes?: string; -} -export function Funds({ userId, classes = "" }: Props) { - const { data: funds = [], isLoading } = useUserFundsQuery(userId); - return ( - - ); -} diff --git a/src/App/Header/UserMenu/Menu.tsx b/src/App/Header/UserMenu/Menu.tsx index 64a1f8ab67..8a63eb55f6 100644 --- a/src/App/Header/UserMenu/Menu.tsx +++ b/src/App/Header/UserMenu/Menu.tsx @@ -5,7 +5,6 @@ import { appRoutes } from "constants/routes"; import { Link } from "react-router-dom"; import type { AuthenticatedUser } from "types/auth"; import { Bookmarks } from "./Bookmarks"; -import { Funds } from "./Funds"; import { Organizations } from "./Organizations"; type Props = { @@ -29,7 +28,6 @@ export default function Menu({ user, signOut, classes }: Props) { My Donations -
BG Admin
diff --git a/src/pages/Funds/Cards/Card.tsx b/src/pages/Funds/Cards/Card.tsx index 352abdce9e..186c3f7240 100644 --- a/src/pages/Funds/Cards/Card.tsx +++ b/src/pages/Funds/Cards/Card.tsx @@ -39,7 +39,7 @@ export default function Card({ {name} -

+

{description}

diff --git a/src/pages/Funds/Cards/Progress.tsx b/src/pages/Funds/Cards/Progress.tsx index b981090109..515adaff3d 100644 --- a/src/pages/Funds/Cards/Progress.tsx +++ b/src/pages/Funds/Cards/Progress.tsx @@ -4,7 +4,7 @@ import type { Fund } from "types/aws"; export function Progress( props: Pick ) { - if (!props.target) { + if (props.target === "0") { if (!props.donation_total_usd) return; return (

diff --git a/src/pages/Funds/CreateFund/CreateFund.tsx b/src/pages/Funds/CreateFund/CreateFund.tsx index d67ad7da65..7aefbd2471 100644 --- a/src/pages/Funds/CreateFund/CreateFund.tsx +++ b/src/pages/Funds/CreateFund/CreateFund.tsx @@ -15,18 +15,14 @@ import { useErrorContext } from "contexts/ErrorContext"; import { useModalContext } from "contexts/ModalContext"; import { logger } from "helpers"; import { getFullURL, uploadFiles } from "helpers/uploadFiles"; -import { - AVATAR_MAX_SIZE_BYTES, - AVATAR_MIME_TYPE, -} from "pages/UserDashboard/EditProfile/useRhf"; import { useRef } from "react"; import { type SubmitHandler, useController, useForm } from "react-hook-form"; import { Link } from "react-router-dom"; import { useLazyProfileQuery } from "services/aws/aws"; import { useCreateFundMutation } from "services/aws/funds"; import type { Fund } from "types/aws"; +import { GoalSelector, MAX_SIZE_IN_BYTES, VALID_MIME_TYPES } from "../common"; import { EndowmentSelector } from "./EndowmentSelector"; -import GoalSelector from "./GoalSelector"; import { schema } from "./schema"; import type { FormValues as FV } from "./types"; @@ -112,15 +108,16 @@ export default withAuth(function CreateFund() { liquidSplitPct: fv.settings.liquidSplit, allowBgTip: fv.settings.allowBgTip, }, + target: + fv.targetType === "none" + ? `${0}` + : fv.targetType === "smart" + ? "smart" + : `${+fv.fixedTarget}`, }; if (fv.expiration) fund.expiration = fv.expiration; - if (fv.targetType !== "none") { - fund.target = - fv.targetType === "fixed" ? (fv.fixedTarget as `${number}`) : "smart"; - } - const res = await createFund(fund).unwrap(); showModal(Prompt, { @@ -230,7 +227,7 @@ export default withAuth(function CreateFund() { /> {targetType.value === "fixed" && ( @@ -274,13 +271,13 @@ export default withAuth(function CreateFund() { e.stopPropagation(); resetField("logo"); }} - accept={AVATAR_MIME_TYPE} + accept={VALID_MIME_TYPES} aspect={[1, 1]} classes={{ container: "mb-4", dropzone: "aspect-[1/1] w-60", }} - maxSize={AVATAR_MAX_SIZE_BYTES} + maxSize={MAX_SIZE_IN_BYTES} error={errors.banner?.file?.message} /> diff --git a/src/pages/Funds/CreateFund/GoalSelector.tsx b/src/pages/Funds/CreateFund/GoalSelector.tsx index b0d3382299..65b06b6570 100644 --- a/src/pages/Funds/CreateFund/GoalSelector.tsx +++ b/src/pages/Funds/CreateFund/GoalSelector.tsx @@ -1,5 +1,5 @@ import { Field, Label, Radio, RadioGroup } from "@headlessui/react"; -import type { TargetType } from "./types"; +import type { TargetType } from "../common"; const options: { [T in TargetType]: string } = { smart: "Use smart milestones", diff --git a/src/pages/Funds/CreateFund/schema.ts b/src/pages/Funds/CreateFund/schema.ts index 2316bb2de8..a030734cc7 100644 --- a/src/pages/Funds/CreateFund/schema.ts +++ b/src/pages/Funds/CreateFund/schema.ts @@ -2,20 +2,10 @@ import type { ImgLink } from "components/ImgEditor"; import { genFileSchema } from "schemas/file"; import { schema as schemaFn, stringNumber } from "schemas/shape"; import { requiredString } from "schemas/string"; -import type { ImageMIMEType } from "types/lists"; import { array, string } from "yup"; +import { MAX_SIZE_IN_BYTES, VALID_MIME_TYPES } from "../common"; import type { FormValues as FV } from "./types"; -export const VALID_MIME_TYPES: ImageMIMEType[] = [ - "image/jpeg", - "image/png", - "image/webp", - "image/svg+xml", -]; - -export const MAX_SIZE_IN_BYTES = 1e6; -export const MAX_CHARS = 4000; - const fileObj = schemaFn({ file: genFileSchema(MAX_SIZE_IN_BYTES, VALID_MIME_TYPES).required("required"), }); diff --git a/src/pages/Funds/CreateFund/types.ts b/src/pages/Funds/CreateFund/types.ts index 314083d7c1..e58b2d4073 100644 --- a/src/pages/Funds/CreateFund/types.ts +++ b/src/pages/Funds/CreateFund/types.ts @@ -1,4 +1,5 @@ import type { ImgLink } from "components/ImgEditor"; +import type { TargetType } from "../common"; export interface FundMember { id: number; @@ -13,8 +14,6 @@ export interface Settings { allowBgTip: boolean; } -export type TargetType = "fixed" | "none" | "smart"; - export interface FormValues { name: string; description: string; diff --git a/src/pages/Funds/EditFund/EditFund.tsx b/src/pages/Funds/EditFund/EditFund.tsx new file mode 100644 index 0000000000..8b26078520 --- /dev/null +++ b/src/pages/Funds/EditFund/EditFund.tsx @@ -0,0 +1,50 @@ +import { skipToken } from "@reduxjs/toolkit/query"; +import Icon from "components/Icon"; +import { ErrorStatus, LoadingStatus } from "components/Status"; +import withAuth from "contexts/Auth"; +import { useParams } from "react-router-dom"; +import { useFundQuery } from "services/aws/funds"; +import { Form } from "./Form"; + +const containerClass = "padded-container mt-8 grid content-start"; +export default withAuth(function EditFund({ user }) { + const { fundId = "" } = useParams(); + + const { data, isLoading, isError } = useFundQuery(fundId || skipToken); + + if (isLoading) { + return ( +

+ Getting fund... +
+ ); + } + + if (isError || !data) { + return ( +
+ Failed to get fund +
+ ); + } + + if (!user.funds.includes(fundId)) { + return ( +
+ +

Unauthorized

+
+ ); + } + + if (!data.active) { + return ( +
+ +

This fund is already closed

+
+ ); + } + + return
; +}); diff --git a/src/pages/Funds/EditFund/FeatureBanner.tsx b/src/pages/Funds/EditFund/FeatureBanner.tsx new file mode 100644 index 0000000000..b6450d59c8 --- /dev/null +++ b/src/pages/Funds/EditFund/FeatureBanner.tsx @@ -0,0 +1,51 @@ +import ExtLink from "components/ExtLink"; +import { Confirmed, Info } from "components/Status"; +import { appRoutes } from "constants/routes"; + +interface Props { + featured: boolean; + fundId: string; + classes?: string; + onToggle: () => void; + isToggling: boolean; +} + +export function FeatureBanner({ classes = "", ...props }: Props) { + return ( +
+ {props.featured ? ( + Your fund is visible in the funds page + ) : ( + + Your endowment is not visible in the funds page + + )} +
+ + + View + +
+
+ ); +} diff --git a/src/pages/Funds/EditFund/Form.tsx b/src/pages/Funds/EditFund/Form.tsx new file mode 100644 index 0000000000..a74ec3dcb4 --- /dev/null +++ b/src/pages/Funds/EditFund/Form.tsx @@ -0,0 +1,216 @@ +import { + ControlledImgEditor as ImgEditor, + type ImgLink, +} from "components/ImgEditor"; +import Prompt from "components/Prompt"; +import { NativeField as Field, Form as Frm } from "components/form"; +import { useErrorContext } from "contexts/ErrorContext"; +import { useModalContext } from "contexts/ModalContext"; +import { getFullURL, uploadFiles } from "helpers/uploadFiles"; +import type { SubmitHandler } from "react-hook-form"; +import { useCloseFundMutation, useEditFundMutation } from "services/aws/funds"; +import type { Fund } from "types/aws"; +import { GoalSelector, MAX_SIZE_IN_BYTES, VALID_MIME_TYPES } from "../common"; +import { FeatureBanner } from "./FeatureBanner"; +import type { FV } from "./types"; +import { useRhf } from "./useRhf"; + +export function Form({ classes = "", ...props }: Fund & { classes?: string }) { + const { showModal } = useModalContext(); + const { handleError } = useErrorContext(); + const rhf = useRhf(props); + + const [editFund, { isLoading: isEditingFund }] = useEditFundMutation(); + const [closeFund, { isLoading: isClosingFund }] = useCloseFundMutation(); + + const onSubmit: SubmitHandler = async ({ + targetType, + fixedTarget, + logo, + banner, + ...fv + }) => { + try { + const [bannerUrl, logoUrl] = await uploadImgs([banner, logo], () => { + showModal( + Prompt, + { type: "loading", children: "Uploading images.." }, + { isDismissible: false } + ); + }); + + /// BUILD UPDATE /// + const update: Fund.Update = {}; + + if (rhf.dirtyFields.targetType || rhf.dirtyFields.fixedTarget) { + update.target = + targetType === "none" + ? "0" + : targetType === "smart" + ? "smart" + : (fixedTarget as `${number}`); + } + + if (rhf.dirtyFields.banner) update.banner = bannerUrl; + if (rhf.dirtyFields.logo) update.logo = logoUrl; + if (rhf.dirtyFields.name) update.name = fv.name; + if (rhf.dirtyFields.description) update.description = fv.description; + + await editFund({ + ...update, + id: props.id, + }).unwrap(); + showModal(Prompt, { + type: "success", + children: "Successfully updated fund!", + }); + } catch (err) { + handleError(err, { context: "updating fund" }); + } + }; + + return ( + + { + try { + await editFund({ + id: props.id, + featured: !props.featured, + }).unwrap(); + } catch (err) { + handleError(err, { context: "updating fund" }); + } + }} + classes="my-4" + /> + + + + + + { + rhf.logo.onChange(v); + rhf.trigger("logo.file"); + }} + onUndo={(e) => { + e.stopPropagation(); + rhf.resetField("logo"); + }} + accept={VALID_MIME_TYPES} + aspect={[1, 1]} + classes={{ container: "w-80 aspect-[1/1]" }} + maxSize={MAX_SIZE_IN_BYTES} + error={rhf.errors.logo?.file?.message} + /> + + + { + rhf.banner.onChange(v); + rhf.trigger("banner.file"); + }} + onUndo={(e) => { + e.stopPropagation(); + rhf.resetField("banner"); + }} + accept={VALID_MIME_TYPES} + aspect={[4, 1]} + classes={{ container: "w-full aspect-[4/1]" }} + maxSize={MAX_SIZE_IN_BYTES} + error={rhf.errors.banner?.file?.message} + /> + + + + {rhf.targetType.value === "fixed" && ( + + )} + +
+ + +
+
+ ); +} + +async function uploadImgs( + imgs: ImgLink[], + onUpload: () => void +): Promise { + const files = imgs.flatMap((img) => (img.file ? [img.file] : [])); + if (files.length > 0) onUpload(); + const baseURL = await uploadFiles(files, "endow-profiles"); + return imgs.map((img) => + img.file && baseURL ? getFullURL(baseURL, img.file.name) : img.publicUrl + ); +} diff --git a/src/pages/Funds/EditFund/index.ts b/src/pages/Funds/EditFund/index.ts new file mode 100644 index 0000000000..bbdd2bec33 --- /dev/null +++ b/src/pages/Funds/EditFund/index.ts @@ -0,0 +1 @@ +export { default as Component } from "./EditFund"; diff --git a/src/pages/Funds/EditFund/types.ts b/src/pages/Funds/EditFund/types.ts new file mode 100644 index 0000000000..059ba933fa --- /dev/null +++ b/src/pages/Funds/EditFund/types.ts @@ -0,0 +1,10 @@ +import type { ImgLink } from "components/ImgEditor"; +import type { Fund } from "types/aws"; +import type { TargetType } from "../common"; + +export interface FV extends Pick { + targetType: TargetType; + fixedTarget: string; + banner: ImgLink; + logo: ImgLink; +} diff --git a/src/pages/Funds/EditFund/useRhf.ts b/src/pages/Funds/EditFund/useRhf.ts new file mode 100644 index 0000000000..e68887e2b6 --- /dev/null +++ b/src/pages/Funds/EditFund/useRhf.ts @@ -0,0 +1,90 @@ +import { yupResolver } from "@hookform/resolvers/yup"; +import type { ImgLink } from "components/ImgEditor"; +import { useController, useForm } from "react-hook-form"; +import { genFileSchema } from "schemas/file"; +import { schema as schemaFn, stringNumber } from "schemas/shape"; +import type { Fund } from "types/aws"; +import { string } from "yup"; +import { + MAX_SIZE_IN_BYTES, + type TargetType, + VALID_MIME_TYPES, +} from "../common"; +import type { FV } from "./types"; + +const fileObj = schemaFn({ + file: genFileSchema(MAX_SIZE_IN_BYTES, VALID_MIME_TYPES), +}); + +const targetTypeKey: keyof FV = "targetType"; +const schema = schemaFn({ + name: string().required("required"), + description: string().required("required"), + fixedTarget: stringNumber( + (str) => { + return str.when(targetTypeKey, (values, schema) => { + const [type] = values as [TargetType]; + return type === "fixed" ? schema.required("required") : schema; + }); + }, + (n) => { + return n.when(targetTypeKey, (values, schema) => { + const [type] = values as [TargetType]; + return type === "fixed" + ? schema.positive("must be greater than 0") + : schema; + }); + } + ), + logo: fileObj, + banner: fileObj, +}); + +export function useRhf(init: Fund) { + const { + register, + handleSubmit, + control, + trigger, + resetField, + formState: { isSubmitting, errors, isDirty, dirtyFields }, + } = useForm({ + resolver: yupResolver(schema), + values: { + name: init.name, + description: init.description, + targetType: + init.target === "0" + ? "none" + : init.target === "smart" + ? "smart" + : "fixed", + fixedTarget: init.target === "smart" ? "" : init.target, + logo: { name: "", preview: init.logo, publicUrl: init.logo }, + banner: { name: "", preview: init.banner, publicUrl: init.banner }, + }, + }); + + const { field: targetType } = useController({ + control, + name: "targetType", + }); + + const { field: logo } = useController({ control, name: "logo" }); + const { field: banner } = useController({ control, name: "banner" }); + + return { + register, + handleSubmit, + isSubmitting, + errors, + isDirty, + dirtyFields, + trigger, + resetField, + //controllers + targetType, + logo, + banner, + }; +} diff --git a/src/pages/Funds/Fund.tsx b/src/pages/Funds/Fund.tsx deleted file mode 100644 index 09b5fa0fb8..0000000000 --- a/src/pages/Funds/Fund.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import { useParams } from "react-router-dom"; - -export function Component() { - const params = useParams(); - return

WIP: Fund: {params.fundId}

; -} diff --git a/src/pages/Funds/Fund/Body/Body.tsx b/src/pages/Funds/Fund/Body/Body.tsx new file mode 100644 index 0000000000..87bd97d5ed --- /dev/null +++ b/src/pages/Funds/Fund/Body/Body.tsx @@ -0,0 +1,61 @@ +import Breadcrumbs from "components/Breadcrumbs"; +import VerifiedIcon from "components/VerifiedIcon"; +import { appRoutes } from "constants/routes"; +import { useFundContext } from "../FundContext"; +import DonateButton from "./DonateButton"; +import GeneralInfo from "./GeneralInfo"; + +export function Body() { + const p = useFundContext(); + + return ( +
+
+ + + +
+
+
+

+ {p.verified && ( + + )} + {p.name} + {!p.active && ( + + closed + + )} +

+
+ +
+              {p.members.map((m) => `${m.id}:${m.name}`).join()}
+            
+
+
+ info 1 + info 2 + info 3 +
+
+ + +
+
+ ); +} diff --git a/src/pages/Funds/Fund/Body/DonateButton.tsx b/src/pages/Funds/Fund/Body/DonateButton.tsx new file mode 100644 index 0000000000..da2d53daa9 --- /dev/null +++ b/src/pages/Funds/Fund/Body/DonateButton.tsx @@ -0,0 +1,17 @@ +import { appRoutes } from "constants/routes"; +import { Link } from "react-router-dom"; +import { useFundContext } from "../FundContext"; + +export default function DonateButton({ className = "" }) { + const fund = useFundContext(); + + return ( + + Donate now + + ); +} diff --git a/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/Balances.tsx b/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/Balances.tsx new file mode 100644 index 0000000000..09e7b93154 --- /dev/null +++ b/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/Balances.tsx @@ -0,0 +1,25 @@ +import { humanize } from "helpers"; +import { useFundContext } from "../../../FundContext"; + +export default function Balances() { + const fund = useFundContext(); + + return ( +
+ +
+ ); +} + +function Balance(props: { title: string; amount: number }) { + return ( +
+

+ {props.title} +

+

+ ${humanize(props.amount)} +

+
+ ); +} diff --git a/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/DetailsColumn.tsx b/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/DetailsColumn.tsx new file mode 100644 index 0000000000..ea1a4e50a6 --- /dev/null +++ b/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/DetailsColumn.tsx @@ -0,0 +1,14 @@ +import { useFundContext } from "../../../FundContext"; +import Balances from "./Balances"; + +export default function DetailsColumn({ className = "" }) { + const p = useFundContext(); + return ( +
+ +
+
+
+
+ ); +} diff --git a/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/index.ts b/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/index.ts new file mode 100644 index 0000000000..dc96b200ca --- /dev/null +++ b/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/index.ts @@ -0,0 +1 @@ +export { default } from "./DetailsColumn"; diff --git a/src/pages/Funds/Fund/Body/GeneralInfo/GeneralInfo.tsx b/src/pages/Funds/Fund/Body/GeneralInfo/GeneralInfo.tsx new file mode 100644 index 0000000000..5ab0322603 --- /dev/null +++ b/src/pages/Funds/Fund/Body/GeneralInfo/GeneralInfo.tsx @@ -0,0 +1,22 @@ +import { useFundContext } from "../../FundContext"; +import Container from "../common/Container"; +import DetailsColumn from "./DetailsColumn"; + +export default function GeneralInfo({ className = "" }) { + const fund = useFundContext(); + + return ( +
+
+ +
+            {fund.description}
+          
+
+
+ +
+ ); +} diff --git a/src/pages/Funds/Fund/Body/GeneralInfo/index.ts b/src/pages/Funds/Fund/Body/GeneralInfo/index.ts new file mode 100644 index 0000000000..99a2cad797 --- /dev/null +++ b/src/pages/Funds/Fund/Body/GeneralInfo/index.ts @@ -0,0 +1 @@ +export { default } from "./GeneralInfo"; diff --git a/src/pages/Funds/Fund/Body/common/Container.tsx b/src/pages/Funds/Fund/Body/common/Container.tsx new file mode 100644 index 0000000000..6c6ff54db4 --- /dev/null +++ b/src/pages/Funds/Fund/Body/common/Container.tsx @@ -0,0 +1,70 @@ +import Icon from "components/Icon"; +import type React from "react"; +import { type PropsWithChildren, useState } from "react"; + +type Props = PropsWithChildren<{ + title: string; + expanded?: true; + classes?: string; +}>; + +export default function Container({ + expanded, + title, + children, + classes = "", +}: Props) { + const [isOpen, setOpen] = useState(true); + + return ( +
+ {expanded ? ( + + ) : ( +
setOpen((prev) => !prev)} + /> + )} + {isOpen && children} +
+ ); +} + +type HeaderProps = { + classes?: string; + title: string; + children?: React.ReactNode; +}; + +function StaticHeader({ title, classes = "", children }: HeaderProps) { + return ( +
+ {title} + {children} +
+ ); +} + +function Header(props: { + title: string; + isOpen: boolean; + onClick: () => void; +}) { + return ( + + + + ); +} diff --git a/src/pages/Funds/Fund/Body/index.ts b/src/pages/Funds/Fund/Body/index.ts new file mode 100644 index 0000000000..bc83c678e5 --- /dev/null +++ b/src/pages/Funds/Fund/Body/index.ts @@ -0,0 +1 @@ +export { Body } from "./Body"; diff --git a/src/pages/Funds/Fund/FundContext.ts b/src/pages/Funds/Fund/FundContext.ts new file mode 100644 index 0000000000..89a2135242 --- /dev/null +++ b/src/pages/Funds/Fund/FundContext.ts @@ -0,0 +1,14 @@ +import { isEmpty } from "helpers"; +import { createContext, useContext } from "react"; +import type { Fund } from "types/aws"; + +export const FundContext = createContext({} as Fund); + +export const useFundContext = (): Fund => { + const val = useContext(FundContext); + + if (isEmpty(Object.entries(val))) { + throw new Error("useFundContext should only be used inside FundContext"); + } + return val; +}; diff --git a/src/pages/Funds/Fund/PageError.tsx b/src/pages/Funds/Fund/PageError.tsx new file mode 100644 index 0000000000..8c3321ce08 --- /dev/null +++ b/src/pages/Funds/Fund/PageError.tsx @@ -0,0 +1,18 @@ +import Icon from "components/Icon"; +import { appRoutes } from "constants/routes"; +import { Link } from "react-router-dom"; + +export default function PageError() { + return ( +
+ +

Failed to load nonprofit profile

+ + Back to Marketplace + +
+ ); +} diff --git a/src/pages/Funds/Fund/Skeleton.tsx b/src/pages/Funds/Fund/Skeleton.tsx new file mode 100644 index 0000000000..93365e847f --- /dev/null +++ b/src/pages/Funds/Fund/Skeleton.tsx @@ -0,0 +1,40 @@ +import ContentLoader from "components/ContentLoader"; + +export default function Skeleton() { + return ( +
+ + +
+ + {/** header */} + + {/** content */} + + + {/** balances */} +
+ + + +
+
+
+ ); +} + +function Banner() { + return ( +
+ ); +} + +function Logo({ className = "" }) { + return ( +
+
+
+ ); +} diff --git a/src/pages/Funds/Fund/index.tsx b/src/pages/Funds/Fund/index.tsx new file mode 100644 index 0000000000..96db9fbb5a --- /dev/null +++ b/src/pages/Funds/Fund/index.tsx @@ -0,0 +1,48 @@ +import fallback_banner from "assets/images/fallback-banner.png"; +import flying_character from "assets/images/flying-character.png"; +import Image from "components/Image"; +import Seo from "components/Seo"; +import { APP_NAME, BASE_URL } from "constants/env"; + +import { skipToken } from "@reduxjs/toolkit/query"; +import { useParams } from "react-router-dom"; +import { useFundQuery } from "services/aws/funds"; +import { Body } from "./Body"; +import { FundContext } from "./FundContext"; +import PageError from "./PageError"; +import Skeleton from "./Skeleton"; + +export function Component() { + const { fundId = "" } = useParams(); + const { isLoading, isError, data } = useFundQuery(fundId || skipToken); + + if (isLoading) return ; + if (isError || !data) return ; + + return ( + + +
+
+
+ +
+ +
+
+ ); +} diff --git a/src/pages/Funds/common/GoalSelector.tsx b/src/pages/Funds/common/GoalSelector.tsx new file mode 100644 index 0000000000..91c560fabf --- /dev/null +++ b/src/pages/Funds/common/GoalSelector.tsx @@ -0,0 +1,37 @@ +import { Field, Label, Radio, RadioGroup } from "@headlessui/react"; + +export type TargetType = "fixed" | "none" | "smart"; + +const options: { [T in TargetType]: string } = { + smart: "Use smart milestones", + none: "No goal or progress bar", + fixed: "Set my own goal", +}; + +interface Props { + value: TargetType; + onChange: (type: TargetType) => void; + classes?: string; +} +export function GoalSelector(props: Props) { + return ( + + {Object.entries(options).map(([value, label]) => ( + + + + + + + ))} + + ); +} diff --git a/src/pages/Funds/common/index.ts b/src/pages/Funds/common/index.ts new file mode 100644 index 0000000000..fcf509e10b --- /dev/null +++ b/src/pages/Funds/common/index.ts @@ -0,0 +1,13 @@ +import type { ImageMIMEType } from "types/lists"; + +export * from "./GoalSelector"; + +export const VALID_MIME_TYPES: ImageMIMEType[] = [ + "image/jpeg", + "image/png", + "image/webp", + "image/svg+xml", +]; + +export const MAX_SIZE_IN_BYTES = 1e6; +export const MAX_CHARS = 4000; diff --git a/src/pages/Funds/index.tsx b/src/pages/Funds/index.tsx index 2ce455c9bd..ca4c3f4069 100644 --- a/src/pages/Funds/index.tsx +++ b/src/pages/Funds/index.tsx @@ -7,6 +7,7 @@ export const fundsRoute: RouteObject = { children: [ { index: true, lazy: () => import("./Funds") }, { path: ":fundId", lazy: () => import("./Fund") }, + { path: ":fundId/edit", lazy: () => import("./EditFund") }, { path: "new", lazy: () => import("./CreateFund") }, ], }; diff --git a/src/pages/UserDashboard/Funds/Funds.tsx b/src/pages/UserDashboard/Funds/Funds.tsx new file mode 100644 index 0000000000..cce70aa63e --- /dev/null +++ b/src/pages/UserDashboard/Funds/Funds.tsx @@ -0,0 +1,80 @@ +import ContentLoader from "components/ContentLoader"; +import Image from "components/Image"; +import QueryLoader from "components/QueryLoader"; +import { appRoutes } from "constants/routes"; +import { useAuthenticatedUser } from "contexts/Auth"; +import { Link } from "react-router-dom"; +import { useUserFundsQuery } from "services/aws/users"; +import type { UserFund } from "types/aws"; + +export function Funds() { + const user = useAuthenticatedUser(); + const query = useUserFundsQuery(user.email); + return ( +
+

My Fundraisers

+ + + + + + + ), + error: "Failed to get fundraisers", + empty: "You currently don't have any fundraisers", + }} + queryState={query} + > + {(funds) => ( + <> + {funds.map((fund) => ( + + ))} + + )} + +
+ ); +} + +const Fund = (props: UserFund) => ( +
+ + {props.name} +

+ {props.active ? "active" : "closed"} +

+ + edit + + + view + +
+); + +export function Skeleton() { + return ( +
+ + +
+ ); +} diff --git a/src/pages/UserDashboard/Funds/index.ts b/src/pages/UserDashboard/Funds/index.ts new file mode 100644 index 0000000000..0f4842aa81 --- /dev/null +++ b/src/pages/UserDashboard/Funds/index.ts @@ -0,0 +1 @@ +export { Funds as Component } from "./Funds"; diff --git a/src/pages/UserDashboard/UserDashboard.tsx b/src/pages/UserDashboard/UserDashboard.tsx index 59580fe32a..0323dc629b 100644 --- a/src/pages/UserDashboard/UserDashboard.tsx +++ b/src/pages/UserDashboard/UserDashboard.tsx @@ -1,7 +1,7 @@ import { appRoutes } from "constants/routes"; import withAuth from "contexts/Auth"; import DashboardLayout from "layout/DashboardLayout"; -import type { RouteObject } from "react-router-dom"; +import { Outlet, type RouteObject } from "react-router-dom"; import Donations from "./Donations"; import EditProfile from "./EditProfile"; import Settings from "./Settings"; @@ -25,5 +25,10 @@ export const userDashboardRoute: RouteObject = { { path: routes.edit_profile, element: }, { path: routes.donations, element: }, { path: routes.settings, element: }, + { + path: routes.funds, + element: , + children: [{ index: true, lazy: () => import("./Funds") }], + }, ], }; diff --git a/src/pages/UserDashboard/routes.ts b/src/pages/UserDashboard/routes.ts index 74daf43c28..be1d7c2a1b 100644 --- a/src/pages/UserDashboard/routes.ts +++ b/src/pages/UserDashboard/routes.ts @@ -4,6 +4,7 @@ export const routes = { index: "", edit_profile: "edit-profile", donations: "donations", + funds: "funds", settings: "settings", }; @@ -34,6 +35,14 @@ export const linkGroups: LinkGroup[] = [ size: 22, }, }, + { + title: "My fundraisers", + to: routes.funds, + icon: { + type: "HeartFill", + size: 21, + }, + }, ], }, ]; diff --git a/src/services/aws/aws.ts b/src/services/aws/aws.ts index 3c8b44c0df..e5ae7ecd45 100644 --- a/src/services/aws/aws.ts +++ b/src/services/aws/aws.ts @@ -76,7 +76,9 @@ export const aws = createApi({ "user", "user-bookmarks", "user-endows", + "user-funds", "funds", + "fund", ], reducerPath: "aws", baseQuery: awsBaseQuery, diff --git a/src/services/aws/funds.ts b/src/services/aws/funds.ts index 55adc1b57c..b32463b0d5 100644 --- a/src/services/aws/funds.ts +++ b/src/services/aws/funds.ts @@ -16,7 +16,29 @@ export const funds = aws.injectEndpoints({ }; }, }), + editFund: builder.mutation({ + invalidatesTags: ["funds", "fund"], + query: ({ id, ...payload }) => { + return { + url: `${v(1)}/funds/${id}`, + method: "PATCH", + body: payload, + headers: { authorization: TEMP_JWT }, + }; + }, + }), + closeFund: builder.mutation({ + invalidatesTags: ["funds", "fund", "user-funds"], + query: (fundId) => { + return { + url: `${v(1)}/funds/${fundId}/close`, + method: "POST", + headers: { authorization: TEMP_JWT }, + }; + }, + }), funds: builder.query({ + providesTags: ["funds"], query: (params) => { return { url: `${v(1)}/funds`, @@ -24,6 +46,10 @@ export const funds = aws.injectEndpoints({ }; }, }), + fund: builder.query({ + providesTags: ["fund"], + query: (fundId) => `${v(1)}/funds/${fundId}`, + }), }), }); @@ -31,5 +57,8 @@ export const { useCreateFundMutation, useLazyFundsQuery, useFundsQuery, + useFundQuery, + useEditFundMutation, + useCloseFundMutation, util: { updateQueryData: updateAwsQueryData }, } = funds; diff --git a/src/services/aws/users.ts b/src/services/aws/users.ts index 2d2432f39a..98b556a7b3 100644 --- a/src/services/aws/users.ts +++ b/src/services/aws/users.ts @@ -29,7 +29,7 @@ const endowAdmins = aws.injectEndpoints({ }), }), userFunds: builder.query({ - providesTags: ["user-endows"], + providesTags: ["user-funds"], query: (userId) => ({ url: `/${v(3)}/users/${userId}/funds`, headers: { authorization: TEMP_JWT }, diff --git a/src/types/aws/ap/index.ts b/src/types/aws/ap/index.ts index 236e8303b7..d8e8715782 100644 --- a/src/types/aws/ap/index.ts +++ b/src/types/aws/ap/index.ts @@ -130,11 +130,12 @@ export type UserEndow = { }; export interface UserFund { - name?: string; + name: string; logo: string; email: string; /** uuidv4 */ id: string; + active: boolean; } export interface EndowAdmin { @@ -254,8 +255,8 @@ export interface Fund { expiration?: string; verified: boolean; donation_total_usd: number; - /** undefined: no target */ - target?: "smart" | `${number}`; + /** "0": no target */ + target: "smart" | `${number}`; /** endowIds that allows this fundraiser on their profile */ approvers: number[]; } @@ -276,6 +277,14 @@ export namespace Fund { members: number[]; } + export interface Update + extends Partial< + Pick< + Fund, + "name" | "description" | "banner" | "logo" | "featured" | "target" + > + > {} + export interface Card extends Pick< Fund, From 8ff9dc59a1f9fe8acd559a72807dc6897f6bcfeb Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Sat, 3 Aug 2024 09:11:44 +0800 Subject: [PATCH 14/47] Chariot prod key requirements (#3198) * 50 usd min amount * summary skips * create dedicated chariot checkout form * use props namespace * modal dismissible * floor instead of ceil * set min * update test --- src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx b/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx index 1c09fd1972..10834e1f2c 100644 --- a/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx +++ b/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx @@ -93,7 +93,7 @@ describe("DAF form test", () => { await userEvent.clear(amountInput); await userEvent.type(amountInput, "-5"); - expect(screen.getByText(/minimum donation is \$50/i)).toBeInTheDocument(); + expect(screen.getByText(/must be greater than 0/i)).toBeInTheDocument(); await userEvent.clear(amountInput); await userEvent.type(amountInput, "50"); From e0bd7f79f6cd2daa3cd724943f400429025478e9 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:05:40 +0800 Subject: [PATCH 15/47] lint fix --- .../Funds/Fund/Body/GeneralInfo/DetailsColumn/DetailsColumn.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/DetailsColumn.tsx b/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/DetailsColumn.tsx index ea1a4e50a6..039d030897 100644 --- a/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/DetailsColumn.tsx +++ b/src/pages/Funds/Fund/Body/GeneralInfo/DetailsColumn/DetailsColumn.tsx @@ -1,8 +1,6 @@ -import { useFundContext } from "../../../FundContext"; import Balances from "./Balances"; export default function DetailsColumn({ className = "" }) { - const p = useFundContext(); return (
From 43fdf8686a75a2897344de8c22a373eadcf7d0f9 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 2 Sep 2024 21:14:21 +0800 Subject: [PATCH 16/47] revert linkedin --- public/scripts/linkedin-tracking.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/linkedin-tracking.js b/public/scripts/linkedin-tracking.js index d1262a0d8b..2b1e0f085b 100644 --- a/public/scripts/linkedin-tracking.js +++ b/public/scripts/linkedin-tracking.js @@ -1,4 +1,4 @@ -_linkedin_partner_id = "6373172"; +_linkedin_partner_id = "4969890"; window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; window._linkedin_data_partner_ids.push(_linkedin_partner_id); From 0095b69d316b51ea9317ced517f375e1cb33a33b Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Wed, 4 Sep 2024 12:41:28 +0800 Subject: [PATCH 17/47] update icons --- src/pages/Funds/EditFund/EditFund.tsx | 4 ++-- src/pages/UserDashboard/routes.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/Funds/EditFund/EditFund.tsx b/src/pages/Funds/EditFund/EditFund.tsx index 8b26078520..2c2bcbfbce 100644 --- a/src/pages/Funds/EditFund/EditFund.tsx +++ b/src/pages/Funds/EditFund/EditFund.tsx @@ -31,7 +31,7 @@ export default withAuth(function EditFund({ user }) { if (!user.funds.includes(fundId)) { return (
- +

Unauthorized

); @@ -40,7 +40,7 @@ export default withAuth(function EditFund({ user }) { if (!data.active) { return (
- +

This fund is already closed

); diff --git a/src/pages/UserDashboard/routes.ts b/src/pages/UserDashboard/routes.ts index be1d7c2a1b..fd99a7edad 100644 --- a/src/pages/UserDashboard/routes.ts +++ b/src/pages/UserDashboard/routes.ts @@ -39,7 +39,7 @@ export const linkGroups: LinkGroup[] = [ title: "My fundraisers", to: routes.funds, icon: { - type: "HeartFill", + type: "Heart", size: 21, }, }, From 661870cdd8cbc76cceb99c09b5607f264d28e024 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Fri, 19 Jul 2024 20:05:38 +0800 Subject: [PATCH 18/47] Disable tracking in `/donate-widget` (#3163) * move script to Seo component * override seo in widget page * remove duplicate route * override when inside widget route * donate widget override --- src/pages/DonateWidget/DonateWidget.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/DonateWidget/DonateWidget.tsx b/src/pages/DonateWidget/DonateWidget.tsx index e5c02509cb..d90cadd203 100644 --- a/src/pages/DonateWidget/DonateWidget.tsx +++ b/src/pages/DonateWidget/DonateWidget.tsx @@ -1,5 +1,6 @@ import LoaderRing from "components/LoaderRing"; import QueryLoader from "components/QueryLoader"; +import Seo from "components/Seo"; import { ErrorStatus } from "components/Status"; import { idParamToNum } from "helpers"; import { useEffect } from "react"; @@ -44,6 +45,7 @@ export default function DonateWidget() { }} className="grid grid-rows-[1fr_auto] justify-items-center gap-10" > + Date: Tue, 23 Jul 2024 10:20:21 +0800 Subject: [PATCH 19/47] Auth redirect (#3165) * move hub to app * use hub state instead of local storage * convert to uncontrolled * add isNpo flag * password input autocomplete requirement * autocomplete requirement * state -> fromState * state -> fromState * trigger vaidation when clicking google signin * move user type to top * auth redirect * add comment --- src/index.tsx | 2 ++ src/pages/OAuthRedirector.tsx | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 222ae50add..9bb4abd5a6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -30,6 +30,8 @@ Amplify.configure(amplifyConfig); const container = document.getElementById("root"); const root = createRoot(container as Element); +Amplify.configure(amplifyConfig); + Sentry.init({ dsn: process.env.PUBLIC_SENTRY_DSN, environment: process.env.PUBLIC_ENVIRONMENT, diff --git a/src/pages/OAuthRedirector.tsx b/src/pages/OAuthRedirector.tsx index 46e8fe4518..1c9f21177d 100644 --- a/src/pages/OAuthRedirector.tsx +++ b/src/pages/OAuthRedirector.tsx @@ -1,4 +1,5 @@ import LoaderRing from "components/LoaderRing"; +<<<<<<< HEAD export default function OAuthRedirector() { /** @@ -14,4 +15,31 @@ export default function OAuthRedirector() { classes={{ container: "w-32 place-self-center" }} /> ); +======= +import { Navigate, useLocation } from "react-router-dom"; +import type { OAuthState } from "types/auth"; + +export default function OAuthRedirector() { + const location = useLocation(); + + const state: OAuthState | null = location.state + ? JSON.parse(location.state) + : null; + + /** when provider (`A.`) redirects back to our app thru `/oauth-redirector` it doesn't pass `state` + * `A.` - Amplify is configured in src/index.tsx + * App.tsx listens to `auth.customOAuthState` event and navigates to `/oauth-redirector`, this time with `state` + */ + if (!state) { + return ( + + ); + } + + const { pathname = "/", data } = state || {}; + return ; +>>>>>>> ab7d97e0d (Auth redirect (#3165)) } From da155afd9f1701a722e7deee8de1521b1783ad8f Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:18:32 +0800 Subject: [PATCH 20/47] Email bugs (#3184) * switch to no cors: verified to be still running * move override further down --- src/pages/DonateWidget/DonateWidget.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/DonateWidget/DonateWidget.tsx b/src/pages/DonateWidget/DonateWidget.tsx index d90cadd203..e5c02509cb 100644 --- a/src/pages/DonateWidget/DonateWidget.tsx +++ b/src/pages/DonateWidget/DonateWidget.tsx @@ -1,6 +1,5 @@ import LoaderRing from "components/LoaderRing"; import QueryLoader from "components/QueryLoader"; -import Seo from "components/Seo"; import { ErrorStatus } from "components/Status"; import { idParamToNum } from "helpers"; import { useEffect } from "react"; @@ -45,7 +44,6 @@ export default function DonateWidget() { }} className="grid grid-rows-[1fr_auto] justify-items-center gap-10" > - Date: Sat, 3 Aug 2024 09:11:44 +0800 Subject: [PATCH 21/47] Chariot prod key requirements (#3198) * 50 usd min amount * summary skips * create dedicated chariot checkout form * use props namespace * modal dismissible * floor instead of ceil * set min * update test --- src/pages/OAuthRedirector.tsx | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/pages/OAuthRedirector.tsx b/src/pages/OAuthRedirector.tsx index 1c9f21177d..46e8fe4518 100644 --- a/src/pages/OAuthRedirector.tsx +++ b/src/pages/OAuthRedirector.tsx @@ -1,5 +1,4 @@ import LoaderRing from "components/LoaderRing"; -<<<<<<< HEAD export default function OAuthRedirector() { /** @@ -15,31 +14,4 @@ export default function OAuthRedirector() { classes={{ container: "w-32 place-self-center" }} /> ); -======= -import { Navigate, useLocation } from "react-router-dom"; -import type { OAuthState } from "types/auth"; - -export default function OAuthRedirector() { - const location = useLocation(); - - const state: OAuthState | null = location.state - ? JSON.parse(location.state) - : null; - - /** when provider (`A.`) redirects back to our app thru `/oauth-redirector` it doesn't pass `state` - * `A.` - Amplify is configured in src/index.tsx - * App.tsx listens to `auth.customOAuthState` event and navigates to `/oauth-redirector`, this time with `state` - */ - if (!state) { - return ( - - ); - } - - const { pathname = "/", data } = state || {}; - return ; ->>>>>>> ab7d97e0d (Auth redirect (#3165)) } From ee036f273ac7a583bc42401c7d4d57f8ddfd1dde Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:06:41 +0800 Subject: [PATCH 22/47] BG-1511: Fix Oauth stuck on /auth-redirector (#3204) * upgrade to v6 router * navigate * admin to lazy api * lazy load more page * to router lazy * lazy load more route * Donate widget * done using router lazy * avoid assigning to variable component * revert file renameing * fix test * add register routes * nested registration steps * use fireevent instead * switch to object notation * more accurate type * adminRoutes * media routs * gift route * profile routes * Routes freegit add . * lazy load * update sentry * remove console log * missign editor * signup lazy * bank application lazy * donate widget * catch all route * amplify at top --- src/index.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 9bb4abd5a6..222ae50add 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -30,8 +30,6 @@ Amplify.configure(amplifyConfig); const container = document.getElementById("root"); const root = createRoot(container as Element); -Amplify.configure(amplifyConfig); - Sentry.init({ dsn: process.env.PUBLIC_SENTRY_DSN, environment: process.env.PUBLIC_ENVIRONMENT, From 63feb7607f5d288e2b1ffe7d6518fd6dc22aacd3 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Thu, 8 Aug 2024 18:40:32 +0800 Subject: [PATCH 23/47] Cherry fixes (#3219) * v2.4.1 (#3162) * Admin member names (#3159) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widget content * doante state to be constructed inside * use intent instead * remove reducer * state shape * crypto sender * hello * tip format * clearer state * merge or replace * working fiat intent * remove redundant * remove unwanted * add mode * to switch * fixes * daf and stocks doesnt skip * add loader * remoev unused comment * convert widget slice to plain state * set init state instead * skip split * remove comment * remove unsed * resume no longer need intermediary donation loader page * info comment * add recipientId * apply skips on back * revert crypto checkout * revert stripe checkout * revert stripe checkout * tx submit loading * reset tip on token change * change comment loctin * tip back to donate form if skipped * revert rename * remove unsed comment * remove unused omit * verbose comment * revert optional * remove intent after loading * fetch hide tip config * info * split desc * testimonial copy fixes (#3007) * BG-1357: DB Split settings (#3008) * render slider * split fix flag * fix check field * change type and adjust (#3006) * add in donation state * mix db value to widget value * add label * revert mixup * standalone source attr * format * revert for endow option * take inverse * fee corrected & copy updates in Admin Settings (#3016) * Payout min edit UI (#3015) * update type and add field * add placeholder * add spacing * Methods widget config (#3017) * add method types * donate methods widget config * remove unused * order configurer component * format * error message * error msg * fix bug * no need for whole mthod * revert smaple * error msg * Donate methods admin setting (#3018) * move comp and helper * sort * reuse in settings page * doante page use setting * update link (#3009) * swap tab name (#3019) * distinguish supported/unsupported * qr token type * format * switch to chainId map * reverts * generic donate thanks * add spacing * create intent on direct donation * add space * rename * remove as const * format * Add lefthook git hooks (#3020) * lefthook install and config * hello world * hello world * add glob * ehello world * x * x * test * test * test * testunused * testunused * Endow videos UI (#3021) * media endpoints * use v1 * media page and route * container and header * featured video container * video adder modal * show modal * add video wiring * paginated videos * edit pros * video preview * videos nested * adder to edidtor * update payload * init params * responsive video * toggle featured * increase card per row * add disabled * pagination limit * render videos in profile * edit albel * BG-1374: admin settings tweaks (#3033) * 5 rows * separator heading * move payout minimum * remove unused * switch from Algolia >> CloudSearch (#3034) * Widget custom title and description (#3035) * udpate checkfield style * parse description in widget page * add onChange check field * title and description fields * show fallback if empty * get recipient addr * revert additional wallets * direct button primary accent --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Andrey Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Program metrics (#3041) * add new attributes * target raise edit field * program tally * targetRaise is nullable * unset targetRaise * Update src/pages/Admin/Charity/ProgramEditor/ProgramInfo/ProgramInfo.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * nav dropdown label fixes * BG-1381: Program selector in widget (#3049) * export program selector * load everythig * add in snippet program id * add prog field * parse program id * program initial state widget * add on loaded * update stocks schema * update stocks schema * remove unused * ignore lint * preview selected program * BG-1383 BG-1384 minor fixes (#3051) * User bookmarks (#3052) * remove old type * bookmarks update * bookmarks btn * bookmarks list * bookmarks lists * userId from jwt * favorite -> profile * update endpoints * Header search V1 (#3054) * convert to input * show on focus * update styles * remain open when hovered * marketplace context * convert to context * remoev log * marketplace flag * endowments search * unitialized as loading * separate search component * search dropdown component * propagate search to marketplace * link home and marketplace query * debounce happens in useCards * BG-1385 WP Plugin doc page (#3053) * WP Plugin Documentation page * remove import * clean up table * address PR feedback * fix typo * add top countries (#3065) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 402c3d5b7161c68616482fc5a5e63839f1ba58ff. * Update deps (#3066) * batch one updates * update deps * replace iwth write * BG-1393: UK aid UI (#3068) * batch one updates * update deps * replace iwth write * uk fields * shown checkbox not crypto * form donor and server format * change format * donor address apes * add annotation * Update src/components/donation/Steps/Summary/DonorForm.tsx --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Display top countries (#3070) * endpoint * top countries data-access * new chains integrated (#3080) * new chains updated * add chains to other types * update rest of token/chain items; add stargaze/kujira testnets; * add new chains to keplr wallet * BG-1390: Cards v2 (#3081) * remove implicit fields * card content * bookmark btn improvement * link and button within card * bookmark btn optimistic update * comments * fix arg * remove decimal * Custom tokens UI (#3069) * coin gecko query * token search component * add name and logo * add coingecko platformId * add static list * temp remove queyr * warning * use fuse for search * remove coins * max size * init token not required * add example * file size * proceed button * dont format json * set as token * ignore json * no need for amount * remoev custom solana xrp * platformId * udpate coins * usd rate --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Chain selector (#3082) * add logos * chain combobox * use new chain selector * option chainId to chainId * value chainId * Osmosis support added (#3084) * add osmosis chains * post-fix 'Testnet' to unsupported chain name (when applicable) * Headless UI v2 (#3085) * headless ui * done batch one * done coutnries * done batch two * done batch 3 * done batch 4 * chain selector scroller click * token options scroll click fix * max height * remove extra border * downgrade yarn * fix program hidden * combobox null value * 2.1.0 transition built in dialog --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Add coinbase extension wallet (#3087) * update icons * use 6963 and add coinbase * update icon imports * unload after switching error --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * QR copy (#3088) * add QR warning * more readable * In honor of field (#3089) * honor field * set from intent * closer to label * close to lable * rename form * wiring * Fix token selector search and updates (#3091) * combobox inside popover * search icon on right * rename interface * BG-1417: Cheque FAQ (#3105) * add content * faq content * BG-1423: chain selector updates (#3104) * change type and adjust for chainId '' * shorter * sort chains * display and focus on error * Network dropdown bug fixes (#3106) * add immediate to open on focus * remove hidden input * WP url updated * BG-1424: Improve token search (#3102) * add not listed * mixed * virtualized * per chain json file * biome ignore * add missing * add token placeholder * spacing * Revert "WP url updated" This reverts commit ffb68148308d6078a762e0741cc779814c854ff2. * upgrade to signclient (#3103) * Network select should focus first when all is error (#3109) * more flexible api * use new api * selector value is chainId * remove hookform context * Donate crash + cherry pick from master (#3108) * make default values required * remove undefined * remove placeholder (#3039) * BG-1380: share fixes (#3040) * remove excess * lines and punctuations * handles and notes * BG-1382: Users unable to create programs occasionally (#3050) * fetch new token * comment * refresh token every 5 minutes * add ms multiplier (#3067) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 3ecb5d0958a5645a1ddda2d2d6284883362c13d9. * fix source (#3083) --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Crypto form integration test (#3110) * init test and mocks * persisted state * empty form validation msgs * prior to selecting token * error correcting * remove test id * BG-1399: Stripe status handling for manual bank verification (#3107) * Update stripe payment status API to use latest version * Added verify bank account button to 'pending' tab in My Donations * Add 'arrivalDate' in Donations Thanks page * Donation Thanks Page for 'requires_action' status and logged in donor * Show bank verification link for guest donors on thank you page * Removed redundant comment * Renamed 'Verify Bank Account' to 'Action' * Removed unused import * Add type def for specific bank verification fields * Add wordpress assets to post page (#3090) * add in public assets and load via react helmet * remove extra space * dry input * preserve header and footer style --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Stripe form integration test (#3111) * update currency selector with accessible headless components * extract rhf from field * no rhf stripe form * add missing error * rhf hook * rhf * should focus * init setup * prefilled state * validation test and increments * stripe form loading and error * Node proxies (#3113) * optimism proxy * revert mistake * base proxy * terra proxies * stargaze and juno, compress lcd,rpc to nodeUrl * osmosis * kujira * update terra * Add 'ukGiftAid' field in fiat donation payload (#3121) * WP URL updated * Cover processing fee UI (#3112) * processing fees * fee allowance on intent * fix type errors * fee allowance checkbox * flatten * save as fee allowance instead of bool * processing fee row * fee allowance row * remove console log * add fee allowance to estimate gross amount * add to deps list * tip doesnt disable processign fee * total include processing fee * parent set border child set individual padding * no need for custom bottom margin * psersistend state doesnt drive UI show * fix ts error * Copy tweak --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1437: Tribute notif UI (#3122) * fix: pass type * form elements * schema and field sizing * remove unused import * init tribute * stripe checkout tribute wiring * wiring crypto * fix spacing * fix initial size of * msg char counter * FIX: header footer styles (#3124) * only apply wp override in /blog * only apply wp override on /blog * only to blog/:slug * stocks form test (#3126) * Async chain (#3123) * update definition and adjust consumers * cached get chain options * use token definition * only pick subset * actual url * New donations table fields (#3125) * Update '/ap/donations.ts' types with new fields * Fix 'Action' column for fiat bank verification url in mobile table * Fix 'Action' column for fiat bank verification url in donations table * Added 'Recurring' column for donor My Donations tables * Added 'Direct Donation' and 'SF Donation' columns for donor My Donations tables * Added 'appUsed' in nonprofit My Donations table * Added 'paymentMethod' in nonprofit My Donations table * Added 'isRecurring' in nonprofit My Donations table * Single csv report * Add other fields into nonprofit Donations table * Fix 'Load More' button to span full width of table * DAF form test + MSW mocking (#3127) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * Add staging endpoint for S3 file uploading (#3139) * Donate steps - test skips and resets (#3128) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * compress images and use webp format (#3140) * Stripe checkout test - error paths (#3141) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused * client secret loading * by test id * separate file * error * error modals * donate btn * remove debug * UI updates (#3142) * rounded widget form * common donor terms * reuse in preview * update words * revert order * BG-1452: CC always goes along with DAF (#3145) * tooltip detail * cc locking * append stripe if applicable * add cc if daf && no cc * Summary form integration test (#3146) * factor out selector * no form context field and selector * native checkfield * keep description * add accessible error message * uk gift aid test * done tribute fields * top level * Payment tab label: card >> card/bank * init lock (#3147) * Update donations tables (#3144) * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for donor donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO csv file * Set fill function as new 'replaceWithEmptyString' helper function * Updated csv file fields for donor donations * Updated payment method values for NPO donations table and csv file * Changed csv value for 'Donation Origin' to be the same with corresponding NPO donation table column * Set 'Finish Paying' column name to 'Action' for donor intent table * Removed excess '- - -' which consumes 1 column for intent and finalized donor tabs * Set bank verification url action as a button * Update 'Network' column to 'Donation Type' column for donor donations table * Display date in csv file as it appears in respective donation tables for donor and NPO * Display amounts in csv files to 2 decimal places - both NPO and donor tables * Deleted unused 'paymentMethod' helper function and rolled back changes to NPO donations table for donation type * Update column name 'Network' to 'Donation Type' for donor donations table csv * Set 'Finish Paying' column name to 'Action' for donor intent mobile table * Summary step integration test (#3148) * coin gecko mock handlers * test rows * auth cases * descripbe name * use waitFor instead --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Alerts opt out (#3149) * settings route * detailed endows endpoint * userId * alert row * submit handler * query * reuse in endowment link * default checked * update wiring * bump to v3 * add success prompt * preserve bookmark link * correct route * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/EndowAlertForm.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * lint fix * spacing --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * endow admin object * handle overflow * bump v2 --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Terms move from page to checkout (#3160) * t&c in each checkout screen * remove in /donate page * donate widget page remove * widget preview remove * remove unused * remove unused import * donation terms move closer * temp hide UK GiftAid checkbox (#3161) * temp hide UK GiftAid checkbox * temp disable UK GiftAid Tests --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * v2.4.2 (#3181) * Disable tracking in `/donate-widget` (#3163) * move script to Seo component * override seo in widget page * remove duplicate route * override when inside widget route * donate widget override * `Login` consistency (#3164) * login consistency * vitest upgrade * Auth redirect (#3165) * move hub to app * use hub state instead of local storage * convert to uncontrolled * add isNpo flag * password input autocomplete requirement * autocomplete requirement * state -> fromState * state -> fromState * trigger vaidation when clicking google signin * move user type to top * auth redirect * add comment * protected redirects to signup (#3178) * No edit name (#3177) * disable and add tooltip * bump version * use prompts instead (#3179) * Program info in summary (#3180) * accept program * render program * provide program value --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Bg1489 faqs (#3183) * Email bugs (#3184) * switch to no cors: verified to be still running * move override further down --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * update linkedin tracker (#3199) * v2.4.3 (#3205) * DAF Checkout with chariot (#3143) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widget content * doante state to be constructed inside * use intent instead * remove reducer * state shape * crypto sender * hello * tip format * clearer state * merge or replace * working fiat intent * remove redundant * remove unwanted * add mode * to switch * fixes * daf and stocks doesnt skip * add loader * remoev unused comment * convert widget slice to plain state * set init state instead * skip split * remove comment * remove unsed * resume no longer need intermediary donation loader page * info comment * add recipientId * apply skips on back * revert crypto checkout * revert stripe checkout * revert stripe checkout * tx submit loading * reset tip on token change * change comment loctin * tip back to donate form if skipped * revert rename * remove unsed comment * remove unused omit * verbose comment * revert optional * remove intent after loading * fetch hide tip config * info * split desc * testimonial copy fixes (#3007) * BG-1357: DB Split settings (#3008) * render slider * split fix flag * fix check field * change type and adjust (#3006) * add in donation state * mix db value to widget value * add label * revert mixup * standalone source attr * format * revert for endow option * take inverse * fee corrected & copy updates in Admin Settings (#3016) * Payout min edit UI (#3015) * update type and add field * add placeholder * add spacing * Methods widget config (#3017) * add method types * donate methods widget config * remove unused * order configurer component * format * error message * error msg * fix bug * no need for whole mthod * revert smaple * error msg * Donate methods admin setting (#3018) * move comp and helper * sort * reuse in settings page * doante page use setting * update link (#3009) * swap tab name (#3019) * distinguish supported/unsupported * qr token type * format * switch to chainId map * reverts * generic donate thanks * add spacing * create intent on direct donation * add space * rename * remove as const * format * Add lefthook git hooks (#3020) * lefthook install and config * hello world * hello world * add glob * ehello world * x * x * test * test * test * testunused * testunused * Endow videos UI (#3021) * media endpoints * use v1 * media page and route * container and header * featured video container * video adder modal * show modal * add video wiring * paginated videos * edit pros * video preview * videos nested * adder to edidtor * update payload * init params * responsive video * toggle featured * increase card per row * add disabled * pagination limit * render videos in profile * edit albel * BG-1374: admin settings tweaks (#3033) * 5 rows * separator heading * move payout minimum * remove unused * switch from Algolia >> CloudSearch (#3034) * Widget custom title and description (#3035) * udpate checkfield style * parse description in widget page * add onChange check field * title and description fields * show fallback if empty * get recipient addr * revert additional wallets * direct button primary accent --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Andrey Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Program metrics (#3041) * add new attributes * target raise edit field * program tally * targetRaise is nullable * unset targetRaise * Update src/pages/Admin/Charity/ProgramEditor/ProgramInfo/ProgramInfo.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * nav dropdown label fixes * BG-1381: Program selector in widget (#3049) * export program selector * load everythig * add in snippet program id * add prog field * parse program id * program initial state widget * add on loaded * update stocks schema * update stocks schema * remove unused * ignore lint * preview selected program * BG-1383 BG-1384 minor fixes (#3051) * User bookmarks (#3052) * remove old type * bookmarks update * bookmarks btn * bookmarks list * bookmarks lists * userId from jwt * favorite -> profile * update endpoints * Header search V1 (#3054) * convert to input * show on focus * update styles * remain open when hovered * marketplace context * convert to context * remoev log * marketplace flag * endowments search * unitialized as loading * separate search component * search dropdown component * propagate search to marketplace * link home and marketplace query * debounce happens in useCards * BG-1385 WP Plugin doc page (#3053) * WP Plugin Documentation page * remove import * clean up table * address PR feedback * fix typo * add top countries (#3065) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 402c3d5b7161c68616482fc5a5e63839f1ba58ff. * Update deps (#3066) * batch one updates * update deps * replace iwth write * BG-1393: UK aid UI (#3068) * batch one updates * update deps * replace iwth write * uk fields * shown checkbox not crypto * form donor and server format * change format * donor address apes * add annotation * Update src/components/donation/Steps/Summary/DonorForm.tsx --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Display top countries (#3070) * endpoint * top countries data-access * new chains integrated (#3080) * new chains updated * add chains to other types * update rest of token/chain items; add stargaze/kujira testnets; * add new chains to keplr wallet * BG-1390: Cards v2 (#3081) * remove implicit fields * card content * bookmark btn improvement * link and button within card * bookmark btn optimistic update * comments * fix arg * remove decimal * Custom tokens UI (#3069) * coin gecko query * token search component * add name and logo * add coingecko platformId * add static list * temp remove queyr * warning * use fuse for search * remove coins * max size * init token not required * add example * file size * proceed button * dont format json * set as token * ignore json * no need for amount * remoev custom solana xrp * platformId * udpate coins * usd rate --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Chain selector (#3082) * add logos * chain combobox * use new chain selector * option chainId to chainId * value chainId * Osmosis support added (#3084) * add osmosis chains * post-fix 'Testnet' to unsupported chain name (when applicable) * Headless UI v2 (#3085) * headless ui * done batch one * done coutnries * done batch two * done batch 3 * done batch 4 * chain selector scroller click * token options scroll click fix * max height * remove extra border * downgrade yarn * fix program hidden * combobox null value * 2.1.0 transition built in dialog --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Add coinbase extension wallet (#3087) * update icons * use 6963 and add coinbase * update icon imports * unload after switching error --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * QR copy (#3088) * add QR warning * more readable * In honor of field (#3089) * honor field * set from intent * closer to label * close to lable * rename form * wiring * Fix token selector search and updates (#3091) * combobox inside popover * search icon on right * rename interface * BG-1417: Cheque FAQ (#3105) * add content * faq content * BG-1423: chain selector updates (#3104) * change type and adjust for chainId '' * shorter * sort chains * display and focus on error * Network dropdown bug fixes (#3106) * add immediate to open on focus * remove hidden input * WP url updated * BG-1424: Improve token search (#3102) * add not listed * mixed * virtualized * per chain json file * biome ignore * add missing * add token placeholder * spacing * Revert "WP url updated" This reverts commit ffb68148308d6078a762e0741cc779814c854ff2. * upgrade to signclient (#3103) * Network select should focus first when all is error (#3109) * more flexible api * use new api * selector value is chainId * remove hookform context * Donate crash + cherry pick from master (#3108) * make default values required * remove undefined * remove placeholder (#3039) * BG-1380: share fixes (#3040) * remove excess * lines and punctuations * handles and notes * BG-1382: Users unable to create programs occasionally (#3050) * fetch new token * comment * refresh token every 5 minutes * add ms multiplier (#3067) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 3ecb5d0958a5645a1ddda2d2d6284883362c13d9. * fix source (#3083) --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Crypto form integration test (#3110) * init test and mocks * persisted state * empty form validation msgs * prior to selecting token * error correcting * remove test id * BG-1399: Stripe status handling for manual bank verification (#3107) * Update stripe payment status API to use latest version * Added verify bank account button to 'pending' tab in My Donations * Add 'arrivalDate' in Donations Thanks page * Donation Thanks Page for 'requires_action' status and logged in donor * Show bank verification link for guest donors on thank you page * Removed redundant comment * Renamed 'Verify Bank Account' to 'Action' * Removed unused import * Add type def for specific bank verification fields * Add wordpress assets to post page (#3090) * add in public assets and load via react helmet * remove extra space * dry input * preserve header and footer style --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Stripe form integration test (#3111) * update currency selector with accessible headless components * extract rhf from field * no rhf stripe form * add missing error * rhf hook * rhf * should focus * init setup * prefilled state * validation test and increments * stripe form loading and error * Node proxies (#3113) * optimism proxy * revert mistake * base proxy * terra proxies * stargaze and juno, compress lcd,rpc to nodeUrl * osmosis * kujira * update terra * Add 'ukGiftAid' field in fiat donation payload (#3121) * WP URL updated * Cover processing fee UI (#3112) * processing fees * fee allowance on intent * fix type errors * fee allowance checkbox * flatten * save as fee allowance instead of bool * processing fee row * fee allowance row * remove console log * add fee allowance to estimate gross amount * add to deps list * tip doesnt disable processign fee * total include processing fee * parent set border child set individual padding * no need for custom bottom margin * psersistend state doesnt drive UI show * fix ts error * Copy tweak --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1437: Tribute notif UI (#3122) * fix: pass type * form elements * schema and field sizing * remove unused import * init tribute * stripe checkout tribute wiring * wiring crypto * fix spacing * fix initial size of * msg char counter * FIX: header footer styles (#3124) * only apply wp override in /blog * only apply wp override on /blog * only to blog/:slug * stocks form test (#3126) * Async chain (#3123) * update definition and adjust consumers * cached get chain options * use token definition * only pick subset * actual url * New donations table fields (#3125) * Update '/ap/donations.ts' types with new fields * Fix 'Action' column for fiat bank verification url in mobile table * Fix 'Action' column for fiat bank verification url in donations table * Added 'Recurring' column for donor My Donations tables * Added 'Direct Donation' and 'SF Donation' columns for donor My Donations tables * Added 'appUsed' in nonprofit My Donations table * Added 'paymentMethod' in nonprofit My Donations table * Added 'isRecurring' in nonprofit My Donations table * Single csv report * Add other fields into nonprofit Donations table * Fix 'Load More' button to span full width of table * DAF form test + MSW mocking (#3127) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * Add staging endpoint for S3 file uploading (#3139) * Donate steps - test skips and resets (#3128) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * compress images and use webp format (#3140) * Stripe checkout test - error paths (#3141) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused * client secret loading * by test id * separate file * error * error modals * donate btn * remove debug * deps * use chariot connect * grant error handling * move type to types/page * button loader * success screen * set chariot as default * remove error * adjust actual amount * include in try catch * show prompts --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * update node version lts (#3191) * Chariot prod key requirements (#3198) * 50 usd min amount * summary skips * create dedicated chariot checkout form * use props namespace * modal dismissible * floor instead of ceil * set min * update test * remove dup (#3202) * prefill billing details (#3201) * Dapp logo, go to BG if in widget - client side navigation to homepage otherwise (#3203) * image accepts render prop instead of elaborate variations * update dapp logo to use render pro * widget logo points to bg website * BG-1511: Fix Oauth stuck on /auth-redirector (#3204) * upgrade to v6 router * navigate * admin to lazy api * lazy load more page * to router lazy * lazy load more route * Donate widget * done using router lazy * avoid assigning to variable component * revert file renameing * fix test * add register routes * nested registration steps * use fireevent instead * switch to object notation * more accurate type * adminRoutes * media routs * gift route * profile routes * Routes freegit add . * lazy load * update sentry * remove console log * missign editor * signup lazy * bank application lazy * donate widget * catch all route * amplify at top --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * DAF requirements (#3176) (#3206) * spelled out daf pay * move donate methods component * create order helper * order methods * update implementation * daf order * timeout * comment * unset tribute when disabling honorary (#3207) * Page transition indicator and top level error boundary (#3208) * create error element compatible to router * add lazy loading indicator * display amount (#3209) * DAFPay remove min donation amount (#3214) * remove min donation amount * update test * add tip in total (#3215) * change link (#3216) * include 30cents processing (#3217) * create dedicated slug validator (#3218) --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh --- public/scripts/linkedin-tracking.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/linkedin-tracking.js b/public/scripts/linkedin-tracking.js index 2b1e0f085b..d1262a0d8b 100644 --- a/public/scripts/linkedin-tracking.js +++ b/public/scripts/linkedin-tracking.js @@ -1,4 +1,4 @@ -_linkedin_partner_id = "4969890"; +_linkedin_partner_id = "6373172"; window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; window._linkedin_data_partner_ids.push(_linkedin_partner_id); From 2d9d2afca3fdcaa5599611052af43b5e4642ccf5 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:20:21 +0800 Subject: [PATCH 24/47] Auth redirect (#3165) * move hub to app * use hub state instead of local storage * convert to uncontrolled * add isNpo flag * password input autocomplete requirement * autocomplete requirement * state -> fromState * state -> fromState * trigger vaidation when clicking google signin * move user type to top * auth redirect * add comment --- src/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 222ae50add..9bb4abd5a6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -30,6 +30,8 @@ Amplify.configure(amplifyConfig); const container = document.getElementById("root"); const root = createRoot(container as Element); +Amplify.configure(amplifyConfig); + Sentry.init({ dsn: process.env.PUBLIC_SENTRY_DSN, environment: process.env.PUBLIC_ENVIRONMENT, From 3461cc89dd546a90c34d4688a63dd4e58bbd3ede Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:01:02 +0800 Subject: [PATCH 25/47] Create fund UI Iteration 1 (#3185) * funds routes * setup fields and schema * logo * wire validation and add submit * expiratiom field * featured checkbox * group headers * create fund * add split slider * tip checkbox * endowments multiselector * add debounce * selected and hovered * add card_imgs * logo size * remove sort param * remove italic * move fund selector * single endow setting hook * disable when single setting is applied * disable when single setting is applied * set effect dep * rename * generic name * include endow name in config * update schema * submit button * revert to custom * remove unused * endow req valid window * wrap with auth * save to server * show loader when debouncing * add aws type * construct new payload * error validation * change bucket name * wip fund page * fundraiser list * funds credential * success msg * add expiration --- src/App/Header/UserMenu/Funds.tsx | 25 +++++++++++++++++++++++++ src/App/Header/UserMenu/Menu.tsx | 2 ++ src/pages/Funds/Fund.tsx | 6 ++++++ src/pages/Funds/index.ts | 2 ++ 4 files changed, 35 insertions(+) create mode 100644 src/App/Header/UserMenu/Funds.tsx create mode 100644 src/pages/Funds/Fund.tsx create mode 100644 src/pages/Funds/index.ts diff --git a/src/App/Header/UserMenu/Funds.tsx b/src/App/Header/UserMenu/Funds.tsx new file mode 100644 index 0000000000..01a2ee7b37 --- /dev/null +++ b/src/App/Header/UserMenu/Funds.tsx @@ -0,0 +1,25 @@ +import { useUserFundsQuery } from "services/aws/users"; +import { FundLink, Skeleton } from "./EndowmentLink"; + +interface Props { + userId: string; + classes?: string; +} +export function Funds({ userId, classes = "" }: Props) { + const { data: funds = [], isLoading } = useUserFundsQuery(userId); + return ( + + ); +} diff --git a/src/App/Header/UserMenu/Menu.tsx b/src/App/Header/UserMenu/Menu.tsx index 8a63eb55f6..64a1f8ab67 100644 --- a/src/App/Header/UserMenu/Menu.tsx +++ b/src/App/Header/UserMenu/Menu.tsx @@ -5,6 +5,7 @@ import { appRoutes } from "constants/routes"; import { Link } from "react-router-dom"; import type { AuthenticatedUser } from "types/auth"; import { Bookmarks } from "./Bookmarks"; +import { Funds } from "./Funds"; import { Organizations } from "./Organizations"; type Props = { @@ -28,6 +29,7 @@ export default function Menu({ user, signOut, classes }: Props) { My Donations +
BG Admin
diff --git a/src/pages/Funds/Fund.tsx b/src/pages/Funds/Fund.tsx new file mode 100644 index 0000000000..aad48f23a2 --- /dev/null +++ b/src/pages/Funds/Fund.tsx @@ -0,0 +1,6 @@ +import { useParams } from "react-router-dom"; + +export function Fund() { + const params = useParams(); + return

WIP: Fund: {params.id}

; +} diff --git a/src/pages/Funds/index.ts b/src/pages/Funds/index.ts new file mode 100644 index 0000000000..79cd7aeaea --- /dev/null +++ b/src/pages/Funds/index.ts @@ -0,0 +1,2 @@ +export { default } from "./Funds"; +export { default as CreateFund } from "./CreateFund"; From 235350940642d0e2324294a6a3982aeb1a3d0e33 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:40:31 +0800 Subject: [PATCH 26/47] List funds (#3192) * funds routes * setup fields and schema * logo * wire validation and add submit * expiratiom field * featured checkbox * group headers * create fund * add split slider * tip checkbox * endowments multiselector * add debounce * selected and hovered * add card_imgs * logo size * remove sort param * remove italic * move fund selector * single endow setting hook * disable when single setting is applied * disable when single setting is applied * set effect dep * rename * generic name * include endow name in config * update schema * submit button * revert to custom * remove unused * endow req valid window * wrap with auth * save to server * show loader when debouncing * add aws type * construct new payload * error validation * change bucket name * wip fund page * fundraiser list * funds credential * success msg * add expiration * correct propt * route fund page * setup funds page * fix type error --- src/App/Header/UserMenu/Funds.tsx | 2 +- src/pages/Funds/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App/Header/UserMenu/Funds.tsx b/src/App/Header/UserMenu/Funds.tsx index 01a2ee7b37..e8e306e91b 100644 --- a/src/App/Header/UserMenu/Funds.tsx +++ b/src/App/Header/UserMenu/Funds.tsx @@ -18,7 +18,7 @@ export function Funds({ userId, classes = "" }: Props) { ) : ( - funds.map((fund) => ) + funds.map((fund) => ) )}
); diff --git a/src/pages/Funds/index.ts b/src/pages/Funds/index.ts index 79cd7aeaea..b1eb5a8767 100644 --- a/src/pages/Funds/index.ts +++ b/src/pages/Funds/index.ts @@ -1,2 +1,3 @@ export { default } from "./Funds"; export { default as CreateFund } from "./CreateFund"; +export { Fund } from "./Fund"; From dbc72d1b3f08734bef1fba194555ad8901e3384b Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:20:53 +0800 Subject: [PATCH 27/47] Add fundraise target (#3194) * add target * remove unused * fundraiser goal * comment 2 * progress --- src/pages/Funds/CreateFund/CreateFund.tsx | 5 +++-- src/pages/Funds/CreateFund/types.ts | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/Funds/CreateFund/CreateFund.tsx b/src/pages/Funds/CreateFund/CreateFund.tsx index 7aefbd2471..2f06ae499c 100644 --- a/src/pages/Funds/CreateFund/CreateFund.tsx +++ b/src/pages/Funds/CreateFund/CreateFund.tsx @@ -23,6 +23,7 @@ import { useCreateFundMutation } from "services/aws/funds"; import type { Fund } from "types/aws"; import { GoalSelector, MAX_SIZE_IN_BYTES, VALID_MIME_TYPES } from "../common"; import { EndowmentSelector } from "./EndowmentSelector"; +import GoalSelector from "./GoalSelector"; import { schema } from "./schema"; import type { FormValues as FV } from "./types"; @@ -112,8 +113,8 @@ export default withAuth(function CreateFund() { fv.targetType === "none" ? `${0}` : fv.targetType === "smart" - ? "smart" - : `${+fv.fixedTarget}`, + ? "smart" + : `${+fv.fixedTarget}`, }; if (fv.expiration) fund.expiration = fv.expiration; diff --git a/src/pages/Funds/CreateFund/types.ts b/src/pages/Funds/CreateFund/types.ts index e58b2d4073..db464619a2 100644 --- a/src/pages/Funds/CreateFund/types.ts +++ b/src/pages/Funds/CreateFund/types.ts @@ -14,6 +14,8 @@ export interface Settings { allowBgTip: boolean; } +export type TargetType = "fixed" | "none" | "smart"; + export interface FormValues { name: string; description: string; From af9104b394140c94815cc03175c9b3112f749f3f Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:25:08 +0800 Subject: [PATCH 28/47] Rc v2.5 update (#3220) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Cherry Fixes (#3197) * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * Chariot prod key requirements (#3198) * 50 usd min amount * summary skips * create dedicated chariot checkout form * use props namespace * modal dismissible * floor instead of ceil * set min * update test * remove dup (#3202) * prefill billing details (#3201) * Dapp logo, go to BG if in widget - client side navigation to homepage otherwise (#3203) * image accepts render prop instead of elaborate variations * update dapp logo to use render pro * widget logo points to bg website * BG-1511: Fix Oauth stuck on /auth-redirector (#3204) * upgrade to v6 router * navigate * admin to lazy api * lazy load more page * to router lazy * lazy load more route * Donate widget * done using router lazy * avoid assigning to variable component * revert file renameing * fix test * add register routes * nested registration steps * use fireevent instead * switch to object notation * more accurate type * adminRoutes * media routs * gift route * profile routes * Routes freegit add . * lazy load * update sentry * remove console log * missign editor * signup lazy * bank application lazy * donate widget * catch all route * amplify at top * Cherry fixes (#3219) * v2.4.1 (#3162) * Admin member names (#3159) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widget content * doante state to be constructed inside * use intent instead * remove reducer * state shape * crypto sender * hello * tip format * clearer state * merge or replace * working fiat intent * remove redundant * remove unwanted * add mode * to switch * fixes * daf and stocks doesnt skip * add loader * remoev unused comment * convert widget slice to plain state * set init state instead * skip split * remove comment * remove unsed * resume no longer need intermediary donation loader page * info comment * add recipientId * apply skips on back * revert crypto checkout * revert stripe checkout * revert stripe checkout * tx submit loading * reset tip on token change * change comment loctin * tip back to donate form if skipped * revert rename * remove unsed comment * remove unused omit * verbose comment * revert optional * remove intent after loading * fetch hide tip config * info * split desc * testimonial copy fixes (#3007) * BG-1357: DB Split settings (#3008) * render slider * split fix flag * fix check field * change type and adjust (#3006) * add in donation state * mix db value to widget value * add label * revert mixup * standalone source attr * format * revert for endow option * take inverse * fee corrected & copy updates in Admin Settings (#3016) * Payout min edit UI (#3015) * update type and add field * add placeholder * add spacing * Methods widget config (#3017) * add method types * donate methods widget config * remove unused * order configurer component * format * error message * error msg * fix bug * no need for whole mthod * revert smaple * error msg * Donate methods admin setting (#3018) * move comp and helper * sort * reuse in settings page * doante page use setting * update link (#3009) * swap tab name (#3019) * distinguish supported/unsupported * qr token type * format * switch to chainId map * reverts * generic donate thanks * add spacing * create intent on direct donation * add space * rename * remove as const * format * Add lefthook git hooks (#3020) * lefthook install and config * hello world * hello world * add glob * ehello world * x * x * test * test * test * testunused * testunused * Endow videos UI (#3021) * media endpoints * use v1 * media page and route * container and header * featured video container * video adder modal * show modal * add video wiring * paginated videos * edit pros * video preview * videos nested * adder to edidtor * update payload * init params * responsive video * toggle featured * increase card per row * add disabled * pagination limit * render videos in profile * edit albel * BG-1374: admin settings tweaks (#3033) * 5 rows * separator heading * move payout minimum * remove unused * switch from Algolia >> CloudSearch (#3034) * Widget custom title and description (#3035) * udpate checkfield style * parse description in widget page * add onChange check field * title and description fields * show fallback if empty * get recipient addr * revert additional wallets * direct button primary accent --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Andrey Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Program metrics (#3041) * add new attributes * target raise edit field * program tally * targetRaise is nullable * unset targetRaise * Update src/pages/Admin/Charity/ProgramEditor/ProgramInfo/ProgramInfo.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * nav dropdown label fixes * BG-1381: Program selector in widget (#3049) * export program selector * load everythig * add in snippet program id * add prog field * parse program id * program initial state widget * add on loaded * update stocks schema * update stocks schema * remove unused * ignore lint * preview selected program * BG-1383 BG-1384 minor fixes (#3051) * User bookmarks (#3052) * remove old type * bookmarks update * bookmarks btn * bookmarks list * bookmarks lists * userId from jwt * favorite -> profile * update endpoints * Header search V1 (#3054) * convert to input * show on focus * update styles * remain open when hovered * marketplace context * convert to context * remoev log * marketplace flag * endowments search * unitialized as loading * separate search component * search dropdown component * propagate search to marketplace * link home and marketplace query * debounce happens in useCards * BG-1385 WP Plugin doc page (#3053) * WP Plugin Documentation page * remove import * clean up table * address PR feedback * fix typo * add top countries (#3065) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 402c3d5b7161c68616482fc5a5e63839f1ba58ff. * Update deps (#3066) * batch one updates * update deps * replace iwth write * BG-1393: UK aid UI (#3068) * batch one updates * update deps * replace iwth write * uk fields * shown checkbox not crypto * form donor and server format * change format * donor address apes * add annotation * Update src/components/donation/Steps/Summary/DonorForm.tsx --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Display top countries (#3070) * endpoint * top countries data-access * new chains integrated (#3080) * new chains updated * add chains to other types * update rest of token/chain items; add stargaze/kujira testnets; * add new chains to keplr wallet * BG-1390: Cards v2 (#3081) * remove implicit fields * card content * bookmark btn improvement * link and button within card * bookmark btn optimistic update * comments * fix arg * remove decimal * Custom tokens UI (#3069) * coin gecko query * token search component * add name and logo * add coingecko platformId * add static list * temp remove queyr * warning * use fuse for search * remove coins * max size * init token not required * add example * file size * proceed button * dont format json * set as token * ignore json * no need for amount * remoev custom solana xrp * platformId * udpate coins * usd rate --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Chain selector (#3082) * add logos * chain combobox * use new chain selector * option chainId to chainId * value chainId * Osmosis support added (#3084) * add osmosis chains * post-fix 'Testnet' to unsupported chain name (when applicable) * Headless UI v2 (#3085) * headless ui * done batch one * done coutnries * done batch two * done batch 3 * done batch 4 * chain selector scroller click * token options scroll click fix * max height * remove extra border * downgrade yarn * fix program hidden * combobox null value * 2.1.0 transition built in dialog --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Add coinbase extension wallet (#3087) * update icons * use 6963 and add coinbase * update icon imports * unload after switching error --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * QR copy (#3088) * add QR warning * more readable * In honor of field (#3089) * honor field * set from intent * closer to label * close to lable * rename form * wiring * Fix token selector search and updates (#3091) * combobox inside popover * search icon on right * rename interface * BG-1417: Cheque FAQ (#3105) * add content * faq content * BG-1423: chain selector updates (#3104) * change type and adjust for chainId '' * shorter * sort chains * display and focus on error * Network dropdown bug fixes (#3106) * add immediate to open on focus * remove hidden input * WP url updated * BG-1424: Improve token search (#3102) * add not listed * mixed * virtualized * per chain json file * biome ignore * add missing * add token placeholder * spacing * Revert "WP url updated" This reverts commit ffb68148308d6078a762e0741cc779814c854ff2. * upgrade to signclient (#3103) * Network select should focus first when all is error (#3109) * more flexible api * use new api * selector value is chainId * remove hookform context * Donate crash + cherry pick from master (#3108) * make default values required * remove undefined * remove placeholder (#3039) * BG-1380: share fixes (#3040) * remove excess * lines and punctuations * handles and notes * BG-1382: Users unable to create programs occasionally (#3050) * fetch new token * comment * refresh token every 5 minutes * add ms multiplier (#3067) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 3ecb5d0958a5645a1ddda2d2d6284883362c13d9. * fix source (#3083) --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Crypto form integration test (#3110) * init test and mocks * persisted state * empty form validation msgs * prior to selecting token * error correcting * remove test id * BG-1399: Stripe status handling for manual bank verification (#3107) * Update stripe payment status API to use latest version * Added verify bank account button to 'pending' tab in My Donations * Add 'arrivalDate' in Donations Thanks page * Donation Thanks Page for 'requires_action' status and logged in donor * Show bank verification link for guest donors on thank you page * Removed redundant comment * Renamed 'Verify Bank Account' to 'Action' * Removed unused import * Add type def for specific bank verification fields * Add wordpress assets to post page (#3090) * add in public assets and load via react helmet * remove extra space * dry input * preserve header and footer style --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Stripe form integration test (#3111) * update currency selector with accessible headless components * extract rhf from field * no rhf stripe form * add missing error * rhf hook * rhf * should focus * init setup * prefilled state * validation test and increments * stripe form loading and error * Node proxies (#3113) * optimism proxy * revert mistake * base proxy * terra proxies * stargaze and juno, compress lcd,rpc to nodeUrl * osmosis * kujira * update terra * Add 'ukGiftAid' field in fiat donation payload (#3121) * WP URL updated * Cover processing fee UI (#3112) * processing fees * fee allowance on intent * fix type errors * fee allowance checkbox * flatten * save as fee allowance instead of bool * processing fee row * fee allowance row * remove console log * add fee allowance to estimate gross amount * add to deps list * tip doesnt disable processign fee * total include processing fee * parent set border child set individual padding * no need for custom bottom margin * psersistend state doesnt drive UI show * fix ts error * Copy tweak --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1437: Tribute notif UI (#3122) * fix: pass type * form elements * schema and field sizing * remove unused import * init tribute * stripe checkout tribute wiring * wiring crypto * fix spacing * fix initial size of * msg char counter * FIX: header footer styles (#3124) * only apply wp override in /blog * only apply wp override on /blog * only to blog/:slug * stocks form test (#3126) * Async chain (#3123) * update definition and adjust consumers * cached get chain options * use token definition * only pick subset * actual url * New donations table fields (#3125) * Update '/ap/donations.ts' types with new fields * Fix 'Action' column for fiat bank verification url in mobile table * Fix 'Action' column for fiat bank verification url in donations table * Added 'Recurring' column for donor My Donations tables * Added 'Direct Donation' and 'SF Donation' columns for donor My Donations tables * Added 'appUsed' in nonprofit My Donations table * Added 'paymentMethod' in nonprofit My Donations table * Added 'isRecurring' in nonprofit My Donations table * Single csv report * Add other fields into nonprofit Donations table * Fix 'Load More' button to span full width of table * DAF form test + MSW mocking (#3127) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * Add staging endpoint for S3 file uploading (#3139) * Donate steps - test skips and resets (#3128) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * compress images and use webp format (#3140) * Stripe checkout test - error paths (#3141) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused * client secret loading * by test id * separate file * error * error modals * donate btn * remove debug * UI updates (#3142) * rounded widget form * common donor terms * reuse in preview * update words * revert order * BG-1452: CC always goes along with DAF (#3145) * tooltip detail * cc locking * append stripe if applicable * add cc if daf && no cc * Summary form integration test (#3146) * factor out selector * no form context field and selector * native checkfield * keep description * add accessible error message * uk gift aid test * done tribute fields * top level * Payment tab label: card >> card/bank * init lock (#3147) * Update donations tables (#3144) * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for donor donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO csv file * Set fill function as new 'replaceWithEmptyString' helper function * Updated csv file fields for donor donations * Updated payment method values for NPO donations table and csv file * Changed csv value for 'Donation Origin' to be the same with corresponding NPO donation table column * Set 'Finish Paying' column name to 'Action' for donor intent table * Removed excess '- - -' which consumes 1 column for intent and finalized donor tabs * Set bank verification url action as a button * Update 'Network' column to 'Donation Type' column for donor donations table * Display date in csv file as it appears in respective donation tables for donor and NPO * Display amounts in csv files to 2 decimal places - both NPO and donor tables * Deleted unused 'paymentMethod' helper function and rolled back changes to NPO donations table for donation type * Update column name 'Network' to 'Donation Type' for donor donations table csv * Set 'Finish Paying' column name to 'Action' for donor intent mobile table * Summary step integration test (#3148) * coin gecko mock handlers * test rows * auth cases * descripbe name * use waitFor instead --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Alerts opt out (#3149) * settings route * detailed endows endpoint * userId * alert row * submit handler * query * reuse in endowment link * default checked * update wiring * bump to v3 * add success prompt * preserve bookmark link * correct route * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/EndowAlertForm.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * lint fix * spacing --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * endow admin object * handle overflow * bump v2 --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Terms move from page to checkout (#3160) * t&c in each checkout screen * remove in /donate page * donate widget page remove * widget preview remove * remove unused * remove unused import * donation terms move closer * temp hide UK GiftAid checkbox (#3161) * temp hide UK GiftAid checkbox * temp disable UK GiftAid Tests --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * v2.4.2 (#3181) * Disable tracking in `/donate-widget` (#3163) * move script to Seo component * override seo in widget page * remove duplicate route * override when inside widget route * donate widget override * `Login` consistency (#3164) * login consistency * vitest upgrade * Auth redirect (#3165) * move hub to app * use hub state instead of local storage * convert to uncontrolled * add isNpo flag * password input autocomplete requirement * autocomplete requirement * state -> fromState * state -> fromState * trigger vaidation when clicking google signin * move user type to top * auth redirect * add comment * protected redirects to signup (#3178) * No edit name (#3177) * disable and add tooltip * bump version * use prompts instead (#3179) * Program info in summary (#3180) * accept program * render program * provide program value --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Bg1489 faqs (#3183) * Email bugs (#3184) * switch to no cors: verified to be still running * move override further down --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * update linkedin tracker (#3199) * v2.4.3 (#3205) * DAF Checkout with chariot (#3143) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widge… --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh --- src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx | 2 +- src/index.tsx | 2 -- src/pages/Funds/CreateFund/types.ts | 4 +--- src/pages/Funds/Fund.tsx | 4 ++-- src/pages/Funds/index.ts | 3 --- 5 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 src/pages/Funds/index.ts diff --git a/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx b/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx index 10834e1f2c..1c09fd1972 100644 --- a/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx +++ b/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx @@ -93,7 +93,7 @@ describe("DAF form test", () => { await userEvent.clear(amountInput); await userEvent.type(amountInput, "-5"); - expect(screen.getByText(/must be greater than 0/i)).toBeInTheDocument(); + expect(screen.getByText(/minimum donation is \$50/i)).toBeInTheDocument(); await userEvent.clear(amountInput); await userEvent.type(amountInput, "50"); diff --git a/src/index.tsx b/src/index.tsx index 9bb4abd5a6..222ae50add 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -30,8 +30,6 @@ Amplify.configure(amplifyConfig); const container = document.getElementById("root"); const root = createRoot(container as Element); -Amplify.configure(amplifyConfig); - Sentry.init({ dsn: process.env.PUBLIC_SENTRY_DSN, environment: process.env.PUBLIC_ENVIRONMENT, diff --git a/src/pages/Funds/CreateFund/types.ts b/src/pages/Funds/CreateFund/types.ts index db464619a2..fc6a946d7e 100644 --- a/src/pages/Funds/CreateFund/types.ts +++ b/src/pages/Funds/CreateFund/types.ts @@ -1,5 +1,5 @@ import type { ImgLink } from "components/ImgEditor"; -import type { TargetType } from "../common"; +import { TargetType } from "../common"; export interface FundMember { id: number; @@ -14,8 +14,6 @@ export interface Settings { allowBgTip: boolean; } -export type TargetType = "fixed" | "none" | "smart"; - export interface FormValues { name: string; description: string; diff --git a/src/pages/Funds/Fund.tsx b/src/pages/Funds/Fund.tsx index aad48f23a2..09b5fa0fb8 100644 --- a/src/pages/Funds/Fund.tsx +++ b/src/pages/Funds/Fund.tsx @@ -1,6 +1,6 @@ import { useParams } from "react-router-dom"; -export function Fund() { +export function Component() { const params = useParams(); - return

WIP: Fund: {params.id}

; + return

WIP: Fund: {params.fundId}

; } diff --git a/src/pages/Funds/index.ts b/src/pages/Funds/index.ts deleted file mode 100644 index b1eb5a8767..0000000000 --- a/src/pages/Funds/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { default } from "./Funds"; -export { default as CreateFund } from "./CreateFund"; -export { Fund } from "./Fund"; From 66eea3d3addf637c14937bb89fc2ffa650c31be8 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:25:35 +0800 Subject: [PATCH 29/47] Fund editor, fund profile (#3196) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add target * remove unused * fundraiser goal * comment 2 * progress * move funds list in user dashboard * funds list page * fix: admin pages reloading on navigation * correct constants * edit types * img form * img form * fund info form * fund info first * featured checkfield * spacing * Cherry Fixes (#3197) * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * Chariot prod key requirements (#3198) * 50 usd min amount * summary skips * create dedicated chariot checkout form * use props namespace * modal dismissible * floor instead of ceil * set min * update test * remove dup (#3202) * prefill billing details (#3201) * Dapp logo, go to BG if in widget - client side navigation to homepage otherwise (#3203) * image accepts render prop instead of elaborate variations * update dapp logo to use render pro * widget logo points to bg website * BG-1511: Fix Oauth stuck on /auth-redirector (#3204) * upgrade to v6 router * navigate * admin to lazy api * lazy load more page * to router lazy * lazy load more route * Donate widget * done using router lazy * avoid assigning to variable component * revert file renameing * fix test * add register routes * nested registration steps * use fireevent instead * switch to object notation * more accurate type * adminRoutes * media routs * gift route * profile routes * Routes freegit add . * lazy load * update sentry * remove console log * missign editor * signup lazy * bank application lazy * donate widget * catch all route * amplify at top * Cherry fixes (#3219) * v2.4.1 (#3162) * Admin member names (#3159) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widget content * doante state to be constructed inside * use intent instead * remove reducer * state shape * crypto sender * hello * tip format * clearer state * merge or replace * working fiat intent * remove redundant * remove unwanted * add mode * to switch * fixes * daf and stocks doesnt skip * add loader * remoev unused comment * convert widget slice to plain state * set init state instead * skip split * remove comment * remove unsed * resume no longer need intermediary donation loader page * info comment * add recipientId * apply skips on back * revert crypto checkout * revert stripe checkout * revert stripe checkout * tx submit loading * reset tip on token change * change comment loctin * tip back to donate form if skipped * revert rename * remove unsed comment * remove unused omit * verbose comment * revert optional * remove intent after loading * fetch hide tip config * info * split desc * testimonial copy fixes (#3007) * BG-1357: DB Split settings (#3008) * render slider * split fix flag * fix check field * change type and adjust (#3006) * add in donation state * mix db value to widget value * add label * revert mixup * standalone source attr * format * revert for endow option * take inverse * fee corrected & copy updates in Admin Settings (#3016) * Payout min edit UI (#3015) * update type and add field * add placeholder * add spacing * Methods widget config (#3017) * add method types * donate methods widget config * remove unused * order configurer component * format * error message * error msg * fix bug * no need for whole mthod * revert smaple * error msg * Donate methods admin setting (#3018) * move comp and helper * sort * reuse in settings page * doante page use setting * update link (#3009) * swap tab name (#3019) * distinguish supported/unsupported * qr token type * format * switch to chainId map * reverts * generic donate thanks * add spacing * create intent on direct donation * add space * rename * remove as const * format * Add lefthook git hooks (#3020) * lefthook install and config * hello world * hello world * add glob * ehello world * x * x * test * test * test * testunused * testunused * Endow videos UI (#3021) * media endpoints * use v1 * media page and route * container and header * featured video container * video adder modal * show modal * add video wiring * paginated videos * edit pros * video preview * videos nested * adder to edidtor * update payload * init params * responsive video * toggle featured * increase card per row * add disabled * pagination limit * render videos in profile * edit albel * BG-1374: admin settings tweaks (#3033) * 5 rows * separator heading * move payout minimum * remove unused * switch from Algolia >> CloudSearch (#3034) * Widget custom title and description (#3035) * udpate checkfield style * parse description in widget page * add onChange check field * title and description fields * show fallback if empty * get recipient addr * revert additional wallets * direct button primary accent --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Andrey Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Program metrics (#3041) * add new attributes * target raise edit field * program tally * targetRaise is nullable * unset targetRaise * Update src/pages/Admin/Charity/ProgramEditor/ProgramInfo/ProgramInfo.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * nav dropdown label fixes * BG-1381: Program selector in widget (#3049) * export program selector * load everythig * add in snippet program id * add prog field * parse program id * program initial state widget * add on loaded * update stocks schema * update stocks schema * remove unused * ignore lint * preview selected program * BG-1383 BG-1384 minor fixes (#3051) * User bookmarks (#3052) * remove old type * bookmarks update * bookmarks btn * bookmarks list * bookmarks lists * userId from jwt * favorite -> profile * update endpoints * Header search V1 (#3054) * convert to input * show on focus * update styles * remain open when hovered * marketplace context * convert to context * remoev log * marketplace flag * endowments search * unitialized as loading * separate search component * search dropdown component * propagate search to marketplace * link home and marketplace query * debounce happens in useCards * BG-1385 WP Plugin doc page (#3053) * WP Plugin Documentation page * remove import * clean up table * address PR feedback * fix typo * add top countries (#3065) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 402c3d5b7161c68616482fc5a5e63839f1ba58ff. * Update deps (#3066) * batch one updates * update deps * replace iwth write * BG-1393: UK aid UI (#3068) * batch one updates * update deps * replace iwth write * uk fields * shown checkbox not crypto * form donor and server format * change format * donor address apes * add annotation * Update src/components/donation/Steps/Summary/DonorForm.tsx --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Display top countries (#3070) * endpoint * top countries data-access * new chains integrated (#3080) * new chains updated * add chains to other types * update rest of token/chain items; add stargaze/kujira testnets; * add new chains to keplr wallet * BG-1390: Cards v2 (#3081) * remove implicit fields * card content * bookmark btn improvement * link and button within card * bookmark btn optimistic update * comments * fix arg * remove decimal * Custom tokens UI (#3069) * coin gecko query * token search component * add name and logo * add coingecko platformId * add static list * temp remove queyr * warning * use fuse for search * remove coins * max size * init token not required * add example * file size * proceed button * dont format json * set as token * ignore json * no need for amount * remoev custom solana xrp * platformId * udpate coins * usd rate --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Chain selector (#3082) * add logos * chain combobox * use new chain selector * option chainId to chainId * value chainId * Osmosis support added (#3084) * add osmosis chains * post-fix 'Testnet' to unsupported chain name (when applicable) * Headless UI v2 (#3085) * headless ui * done batch one * done coutnries * done batch two * done batch 3 * done batch 4 * chain selector scroller click * token options scroll click fix * max height * remove extra border * downgrade yarn * fix program hidden * combobox null value * 2.1.0 transition built in dialog --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Add coinbase extension wallet (#3087) * update icons * use 6963 and add coinbase * update icon imports * unload after switching error --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * QR copy (#3088) * add QR warning * more readable * In honor of field (#3089) * honor field * set from intent * closer to label * close to lable * rename form * wiring * Fix token selector search and updates (#3091) * combobox inside popover * search icon on right * rename interface * BG-1417: Cheque FAQ (#3105) * add content * faq content * BG-1423: chain selector updates (#3104) * change type and adjust for chainId '' * shorter * sort chains * display and focus on error * Network dropdown bug fixes (#3106) * add immediate to open on focus * remove hidden input * WP url updated * BG-1424: Improve token search (#3102) * add not listed * mixed * virtualized * per chain json file * biome ignore * add missing * add token placeholder * spacing * Revert "WP url updated" This reverts commit ffb68148308d6078a762e0741cc779814c854ff2. * upgrade to signclient (#3103) * Network select should focus first when all is error (#3109) * more flexible api * use new api * selector value is chainId * remove hookform context * Donate crash + cherry pick from master (#3108) * make default values required * remove undefined * remove placeholder (#3039) * BG-1380: share fixes (#3040) * remove excess * lines and punctuations * handles and notes * BG-1382: Users unable to create programs occasionally (#3050) * fetch new token * comment * refresh token every 5 minutes * add ms multiplier (#3067) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 3ecb5d0958a5645a1ddda2d2d6284883362c13d9. * fix source (#3083) --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Crypto form integration test (#3110) * init test and mocks * persisted state * empty form validation msgs * prior to selecting token * error correcting * remove test id * BG-1399: Stripe status handling for manual bank verification (#3107) * Update stripe payment status API to use latest version * Added verify bank account button to 'pending' tab in My Donations * Add 'arrivalDate' in Donations Thanks page * Donation Thanks Page for 'requires_action' status and logged in donor * Show bank verification link for guest donors on thank you page * Removed redundant comment * Renamed 'Verify Bank Account' to 'Action' * Removed unused import * Add type def for specific bank verification fields * Add wordpress assets to post page (#3090) * add in public assets and load via react helmet * remove extra space * dry input * preserve header and footer style --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Stripe form integration test (#3111) * update currency selector with accessible headless components * extract rhf from field * no rhf stripe form * add missing error * rhf hook * rhf * should focus * init setup * prefilled state * validation test and increments * stripe form loading and error * Node proxies (#3113) * optimism proxy * revert mistake * base proxy * terra proxies * stargaze and juno, compress lcd,rpc to nodeUrl * osmosis * kujira * update terra * Add 'ukGiftAid' field in fiat donation payload (#3121) * WP URL updated * Cover processing fee UI (#3112) * processing fees * fee allowance on intent * fix type errors * fee allowance checkbox * flatten * save as fee allowance instead of bool * processing fee row * fee allowance row * remove console log * add fee allowance to estimate gross amount * add to deps list * tip doesnt disable processign fee * total include processing fee * parent set border child set individual padding * no need for custom bottom margin * psersistend state doesnt drive UI show * fix ts error * Copy tweak --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1437: Tribute notif UI (#3122) * fix: pass type * form elements * schema and field sizing * remove unused import * init tribute * stripe checkout tribute wiring * wiring crypto * fix spacing * fix initial size of * msg char counter * FIX: header footer styles (#3124) * only apply wp override in /blog * only apply wp override on /blog * only to blog/:slug * stocks form test (#3126) * Async chain (#3123) * update definition and adjust consumers * cached get chain options * use token definition * only pick subset * actual url * New donations table fields (#3125) * Update '/ap/donations.ts' types with new fields * Fix 'Action' column for fiat bank verification url in mobile table * Fix 'Action' column for fiat bank verification url in donations table * Added 'Recurring' column for donor My Donations tables * Added 'Direct Donation' and 'SF Donation' columns for donor My Donations tables * Added 'appUsed' in nonprofit My Donations table * Added 'paymentMethod' in nonprofit My Donations table * Added 'isRecurring' in nonprofit My Donations table * Single csv report * Add other fields into nonprofit Donations table * Fix 'Load More' button to span full width of table * DAF form test + MSW mocking (#3127) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * Add staging endpoint for S3 file uploading (#3139) * Donate steps - test skips and resets (#3128) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * compress images and use webp format (#3140) * Stripe checkout test - error paths (#3141) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused * client secret loading * by test id * separate file * error * error modals * donate btn * remove debug * UI updates (#3142) * rounded widget form * common donor terms * reuse in preview * update words * revert order * BG-1452: CC always goes along with DAF (#3145) * tooltip detail * cc locking * append stripe if applicable * add cc if daf && no cc * Summary form integration test (#3146) * factor out selector * no form context field and selector * native checkfield * keep description * add accessible error message * uk gift aid test * done tribute fields * top level * Payment tab label: card >> card/bank * init lock (#3147) * Update donations tables (#3144) * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for donor donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO csv file * Set fill function as new 'replaceWithEmptyString' helper function * Updated csv file fields for donor donations * Updated payment method values for NPO donations table and csv file * Changed csv value for 'Donation Origin' to be the same with corresponding NPO donation table column * Set 'Finish Paying' column name to 'Action' for donor intent table * Removed excess '- - -' which consumes 1 column for intent and finalized donor tabs * Set bank verification url action as a button * Update 'Network' column to 'Donation Type' column for donor donations table * Display date in csv file as it appears in respective donation tables for donor and NPO * Display amounts in csv files to 2 decimal places - both NPO and donor tables * Deleted unused 'paymentMethod' helper function and rolled back changes to NPO donations table for donation type * Update column name 'Network' to 'Donation Type' for donor donations table csv * Set 'Finish Paying' column name to 'Action' for donor intent mobile table * Summary step integration test (#3148) * coin gecko mock handlers * test rows * auth cases * descripbe name * use waitFor instead --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Alerts opt out (#3149) * settings route * detailed endows endpoint * userId * alert row * submit handler * query * reuse in endowment link * default checked * update wiring * bump to v3 * add success prompt * preserve bookmark link * correct route * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/EndowAlertForm.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * lint fix * spacing --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * endow admin object * handle overflow * bump v2 --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Terms move from page to checkout (#3160) * t&c in each checkout screen * remove in /donate page * donate widget page remove * widget preview remove * remove unused * remove unused import * donation terms move closer * temp hide UK GiftAid checkbox (#3161) * temp hide UK GiftAid checkbox * temp disable UK GiftAid Tests --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * v2.4.2 (#3181) * Disable tracking in `/donate-widget` (#3163) * move script to Seo component * override seo in widget page * remove duplicate route * override when inside widget route * donate widget override * `Login` consistency (#3164) * login consistency * vitest upgrade * Auth redirect (#3165) * move hub to app * use hub state instead of local storage * convert to uncontrolled * add isNpo flag * password input autocomplete requirement * autocomplete requirement * state -> fromState * state -> fromState * trigger vaidation when clicking google signin * move user type to top * auth redirect * add comment * protected redirects to signup (#3178) * No edit name (#3177) * disable and add tooltip * bump version * use prompts instead (#3179) * Program info in summary (#3180) * accept program * render program * provide program value --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Bg1489 faqs (#3183) * Email bugs (#3184) * switch to no cors: verified to be still running * move override further down --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * update linkedin tracker (#3199) * v2.4.3 (#3205) * DAF Checkout with chariot (#3143) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widge… * default values and wiring * auto upload of pic * remove ping query * loading text size * remove grouping * isDirty * basic fund profile * field sizing and wrapping * clamp description * save to close only * add authorization * edit profile validation * single form * spacing * featured banner and update types * fund editing * fund already closed error * placeholder tagline * manifest closed * remove unused * unused export --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh --- src/App/Header/UserMenu/Funds.tsx | 25 ----------------------- src/App/Header/UserMenu/Menu.tsx | 2 -- src/pages/Funds/CreateFund/CreateFund.tsx | 1 - src/pages/Funds/CreateFund/types.ts | 2 +- src/pages/Funds/Fund.tsx | 6 ------ src/pages/UserDashboard/routes.ts | 8 ++++++++ 6 files changed, 9 insertions(+), 35 deletions(-) delete mode 100644 src/App/Header/UserMenu/Funds.tsx delete mode 100644 src/pages/Funds/Fund.tsx diff --git a/src/App/Header/UserMenu/Funds.tsx b/src/App/Header/UserMenu/Funds.tsx deleted file mode 100644 index e8e306e91b..0000000000 --- a/src/App/Header/UserMenu/Funds.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { useUserFundsQuery } from "services/aws/users"; -import { FundLink, Skeleton } from "./EndowmentLink"; - -interface Props { - userId: string; - classes?: string; -} -export function Funds({ userId, classes = "" }: Props) { - const { data: funds = [], isLoading } = useUserFundsQuery(userId); - return ( - - ); -} diff --git a/src/App/Header/UserMenu/Menu.tsx b/src/App/Header/UserMenu/Menu.tsx index 64a1f8ab67..8a63eb55f6 100644 --- a/src/App/Header/UserMenu/Menu.tsx +++ b/src/App/Header/UserMenu/Menu.tsx @@ -5,7 +5,6 @@ import { appRoutes } from "constants/routes"; import { Link } from "react-router-dom"; import type { AuthenticatedUser } from "types/auth"; import { Bookmarks } from "./Bookmarks"; -import { Funds } from "./Funds"; import { Organizations } from "./Organizations"; type Props = { @@ -29,7 +28,6 @@ export default function Menu({ user, signOut, classes }: Props) { My Donations -
BG Admin
diff --git a/src/pages/Funds/CreateFund/CreateFund.tsx b/src/pages/Funds/CreateFund/CreateFund.tsx index 2f06ae499c..d5f6941b2b 100644 --- a/src/pages/Funds/CreateFund/CreateFund.tsx +++ b/src/pages/Funds/CreateFund/CreateFund.tsx @@ -23,7 +23,6 @@ import { useCreateFundMutation } from "services/aws/funds"; import type { Fund } from "types/aws"; import { GoalSelector, MAX_SIZE_IN_BYTES, VALID_MIME_TYPES } from "../common"; import { EndowmentSelector } from "./EndowmentSelector"; -import GoalSelector from "./GoalSelector"; import { schema } from "./schema"; import type { FormValues as FV } from "./types"; diff --git a/src/pages/Funds/CreateFund/types.ts b/src/pages/Funds/CreateFund/types.ts index fc6a946d7e..e58b2d4073 100644 --- a/src/pages/Funds/CreateFund/types.ts +++ b/src/pages/Funds/CreateFund/types.ts @@ -1,5 +1,5 @@ import type { ImgLink } from "components/ImgEditor"; -import { TargetType } from "../common"; +import type { TargetType } from "../common"; export interface FundMember { id: number; diff --git a/src/pages/Funds/Fund.tsx b/src/pages/Funds/Fund.tsx deleted file mode 100644 index 09b5fa0fb8..0000000000 --- a/src/pages/Funds/Fund.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import { useParams } from "react-router-dom"; - -export function Component() { - const params = useParams(); - return

WIP: Fund: {params.fundId}

; -} diff --git a/src/pages/UserDashboard/routes.ts b/src/pages/UserDashboard/routes.ts index fd99a7edad..721d9bd3e3 100644 --- a/src/pages/UserDashboard/routes.ts +++ b/src/pages/UserDashboard/routes.ts @@ -43,6 +43,14 @@ export const linkGroups: LinkGroup[] = [ size: 21, }, }, + { + title: "My fundraisers", + to: routes.funds, + icon: { + type: "HeartFill", + size: 21, + }, + }, ], }, ]; From 90a9a330651b013d8e349db198a7bef191ddb65f Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Sat, 3 Aug 2024 09:11:44 +0800 Subject: [PATCH 30/47] Chariot prod key requirements (#3198) * 50 usd min amount * summary skips * create dedicated chariot checkout form * use props namespace * modal dismissible * floor instead of ceil * set min * update test --- src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx b/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx index 1c09fd1972..10834e1f2c 100644 --- a/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx +++ b/src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx @@ -93,7 +93,7 @@ describe("DAF form test", () => { await userEvent.clear(amountInput); await userEvent.type(amountInput, "-5"); - expect(screen.getByText(/minimum donation is \$50/i)).toBeInTheDocument(); + expect(screen.getByText(/must be greater than 0/i)).toBeInTheDocument(); await userEvent.clear(amountInput); await userEvent.type(amountInput, "50"); From 738233c4c518da548ac049bd4379ed6bae8d11c9 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:01:02 +0800 Subject: [PATCH 31/47] Create fund UI Iteration 1 (#3185) * funds routes * setup fields and schema * logo * wire validation and add submit * expiratiom field * featured checkbox * group headers * create fund * add split slider * tip checkbox * endowments multiselector * add debounce * selected and hovered * add card_imgs * logo size * remove sort param * remove italic * move fund selector * single endow setting hook * disable when single setting is applied * disable when single setting is applied * set effect dep * rename * generic name * include endow name in config * update schema * submit button * revert to custom * remove unused * endow req valid window * wrap with auth * save to server * show loader when debouncing * add aws type * construct new payload * error validation * change bucket name * wip fund page * fundraiser list * funds credential * success msg * add expiration --- src/App/Header/UserMenu/Funds.tsx | 25 +++++++++++++++++++++++++ src/App/Header/UserMenu/Menu.tsx | 2 ++ src/pages/Funds/Fund.tsx | 6 ++++++ src/pages/Funds/index.ts | 2 ++ 4 files changed, 35 insertions(+) create mode 100644 src/App/Header/UserMenu/Funds.tsx create mode 100644 src/pages/Funds/Fund.tsx create mode 100644 src/pages/Funds/index.ts diff --git a/src/App/Header/UserMenu/Funds.tsx b/src/App/Header/UserMenu/Funds.tsx new file mode 100644 index 0000000000..01a2ee7b37 --- /dev/null +++ b/src/App/Header/UserMenu/Funds.tsx @@ -0,0 +1,25 @@ +import { useUserFundsQuery } from "services/aws/users"; +import { FundLink, Skeleton } from "./EndowmentLink"; + +interface Props { + userId: string; + classes?: string; +} +export function Funds({ userId, classes = "" }: Props) { + const { data: funds = [], isLoading } = useUserFundsQuery(userId); + return ( + + ); +} diff --git a/src/App/Header/UserMenu/Menu.tsx b/src/App/Header/UserMenu/Menu.tsx index 8a63eb55f6..64a1f8ab67 100644 --- a/src/App/Header/UserMenu/Menu.tsx +++ b/src/App/Header/UserMenu/Menu.tsx @@ -5,6 +5,7 @@ import { appRoutes } from "constants/routes"; import { Link } from "react-router-dom"; import type { AuthenticatedUser } from "types/auth"; import { Bookmarks } from "./Bookmarks"; +import { Funds } from "./Funds"; import { Organizations } from "./Organizations"; type Props = { @@ -28,6 +29,7 @@ export default function Menu({ user, signOut, classes }: Props) { My Donations +
BG Admin
diff --git a/src/pages/Funds/Fund.tsx b/src/pages/Funds/Fund.tsx new file mode 100644 index 0000000000..aad48f23a2 --- /dev/null +++ b/src/pages/Funds/Fund.tsx @@ -0,0 +1,6 @@ +import { useParams } from "react-router-dom"; + +export function Fund() { + const params = useParams(); + return

WIP: Fund: {params.id}

; +} diff --git a/src/pages/Funds/index.ts b/src/pages/Funds/index.ts new file mode 100644 index 0000000000..79cd7aeaea --- /dev/null +++ b/src/pages/Funds/index.ts @@ -0,0 +1,2 @@ +export { default } from "./Funds"; +export { default as CreateFund } from "./CreateFund"; From c82f480e102eb11fb1d60e1b2b736177d5813cc9 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:25:35 +0800 Subject: [PATCH 32/47] Fund editor, fund profile (#3196) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add target * remove unused * fundraiser goal * comment 2 * progress * move funds list in user dashboard * funds list page * fix: admin pages reloading on navigation * correct constants * edit types * img form * img form * fund info form * fund info first * featured checkfield * spacing * Cherry Fixes (#3197) * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * Chariot prod key requirements (#3198) * 50 usd min amount * summary skips * create dedicated chariot checkout form * use props namespace * modal dismissible * floor instead of ceil * set min * update test * remove dup (#3202) * prefill billing details (#3201) * Dapp logo, go to BG if in widget - client side navigation to homepage otherwise (#3203) * image accepts render prop instead of elaborate variations * update dapp logo to use render pro * widget logo points to bg website * BG-1511: Fix Oauth stuck on /auth-redirector (#3204) * upgrade to v6 router * navigate * admin to lazy api * lazy load more page * to router lazy * lazy load more route * Donate widget * done using router lazy * avoid assigning to variable component * revert file renameing * fix test * add register routes * nested registration steps * use fireevent instead * switch to object notation * more accurate type * adminRoutes * media routs * gift route * profile routes * Routes freegit add . * lazy load * update sentry * remove console log * missign editor * signup lazy * bank application lazy * donate widget * catch all route * amplify at top * Cherry fixes (#3219) * v2.4.1 (#3162) * Admin member names (#3159) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widget content * doante state to be constructed inside * use intent instead * remove reducer * state shape * crypto sender * hello * tip format * clearer state * merge or replace * working fiat intent * remove redundant * remove unwanted * add mode * to switch * fixes * daf and stocks doesnt skip * add loader * remoev unused comment * convert widget slice to plain state * set init state instead * skip split * remove comment * remove unsed * resume no longer need intermediary donation loader page * info comment * add recipientId * apply skips on back * revert crypto checkout * revert stripe checkout * revert stripe checkout * tx submit loading * reset tip on token change * change comment loctin * tip back to donate form if skipped * revert rename * remove unsed comment * remove unused omit * verbose comment * revert optional * remove intent after loading * fetch hide tip config * info * split desc * testimonial copy fixes (#3007) * BG-1357: DB Split settings (#3008) * render slider * split fix flag * fix check field * change type and adjust (#3006) * add in donation state * mix db value to widget value * add label * revert mixup * standalone source attr * format * revert for endow option * take inverse * fee corrected & copy updates in Admin Settings (#3016) * Payout min edit UI (#3015) * update type and add field * add placeholder * add spacing * Methods widget config (#3017) * add method types * donate methods widget config * remove unused * order configurer component * format * error message * error msg * fix bug * no need for whole mthod * revert smaple * error msg * Donate methods admin setting (#3018) * move comp and helper * sort * reuse in settings page * doante page use setting * update link (#3009) * swap tab name (#3019) * distinguish supported/unsupported * qr token type * format * switch to chainId map * reverts * generic donate thanks * add spacing * create intent on direct donation * add space * rename * remove as const * format * Add lefthook git hooks (#3020) * lefthook install and config * hello world * hello world * add glob * ehello world * x * x * test * test * test * testunused * testunused * Endow videos UI (#3021) * media endpoints * use v1 * media page and route * container and header * featured video container * video adder modal * show modal * add video wiring * paginated videos * edit pros * video preview * videos nested * adder to edidtor * update payload * init params * responsive video * toggle featured * increase card per row * add disabled * pagination limit * render videos in profile * edit albel * BG-1374: admin settings tweaks (#3033) * 5 rows * separator heading * move payout minimum * remove unused * switch from Algolia >> CloudSearch (#3034) * Widget custom title and description (#3035) * udpate checkfield style * parse description in widget page * add onChange check field * title and description fields * show fallback if empty * get recipient addr * revert additional wallets * direct button primary accent --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Andrey Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Program metrics (#3041) * add new attributes * target raise edit field * program tally * targetRaise is nullable * unset targetRaise * Update src/pages/Admin/Charity/ProgramEditor/ProgramInfo/ProgramInfo.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * nav dropdown label fixes * BG-1381: Program selector in widget (#3049) * export program selector * load everythig * add in snippet program id * add prog field * parse program id * program initial state widget * add on loaded * update stocks schema * update stocks schema * remove unused * ignore lint * preview selected program * BG-1383 BG-1384 minor fixes (#3051) * User bookmarks (#3052) * remove old type * bookmarks update * bookmarks btn * bookmarks list * bookmarks lists * userId from jwt * favorite -> profile * update endpoints * Header search V1 (#3054) * convert to input * show on focus * update styles * remain open when hovered * marketplace context * convert to context * remoev log * marketplace flag * endowments search * unitialized as loading * separate search component * search dropdown component * propagate search to marketplace * link home and marketplace query * debounce happens in useCards * BG-1385 WP Plugin doc page (#3053) * WP Plugin Documentation page * remove import * clean up table * address PR feedback * fix typo * add top countries (#3065) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 402c3d5b7161c68616482fc5a5e63839f1ba58ff. * Update deps (#3066) * batch one updates * update deps * replace iwth write * BG-1393: UK aid UI (#3068) * batch one updates * update deps * replace iwth write * uk fields * shown checkbox not crypto * form donor and server format * change format * donor address apes * add annotation * Update src/components/donation/Steps/Summary/DonorForm.tsx --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Display top countries (#3070) * endpoint * top countries data-access * new chains integrated (#3080) * new chains updated * add chains to other types * update rest of token/chain items; add stargaze/kujira testnets; * add new chains to keplr wallet * BG-1390: Cards v2 (#3081) * remove implicit fields * card content * bookmark btn improvement * link and button within card * bookmark btn optimistic update * comments * fix arg * remove decimal * Custom tokens UI (#3069) * coin gecko query * token search component * add name and logo * add coingecko platformId * add static list * temp remove queyr * warning * use fuse for search * remove coins * max size * init token not required * add example * file size * proceed button * dont format json * set as token * ignore json * no need for amount * remoev custom solana xrp * platformId * udpate coins * usd rate --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Chain selector (#3082) * add logos * chain combobox * use new chain selector * option chainId to chainId * value chainId * Osmosis support added (#3084) * add osmosis chains * post-fix 'Testnet' to unsupported chain name (when applicable) * Headless UI v2 (#3085) * headless ui * done batch one * done coutnries * done batch two * done batch 3 * done batch 4 * chain selector scroller click * token options scroll click fix * max height * remove extra border * downgrade yarn * fix program hidden * combobox null value * 2.1.0 transition built in dialog --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Add coinbase extension wallet (#3087) * update icons * use 6963 and add coinbase * update icon imports * unload after switching error --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * QR copy (#3088) * add QR warning * more readable * In honor of field (#3089) * honor field * set from intent * closer to label * close to lable * rename form * wiring * Fix token selector search and updates (#3091) * combobox inside popover * search icon on right * rename interface * BG-1417: Cheque FAQ (#3105) * add content * faq content * BG-1423: chain selector updates (#3104) * change type and adjust for chainId '' * shorter * sort chains * display and focus on error * Network dropdown bug fixes (#3106) * add immediate to open on focus * remove hidden input * WP url updated * BG-1424: Improve token search (#3102) * add not listed * mixed * virtualized * per chain json file * biome ignore * add missing * add token placeholder * spacing * Revert "WP url updated" This reverts commit ffb68148308d6078a762e0741cc779814c854ff2. * upgrade to signclient (#3103) * Network select should focus first when all is error (#3109) * more flexible api * use new api * selector value is chainId * remove hookform context * Donate crash + cherry pick from master (#3108) * make default values required * remove undefined * remove placeholder (#3039) * BG-1380: share fixes (#3040) * remove excess * lines and punctuations * handles and notes * BG-1382: Users unable to create programs occasionally (#3050) * fetch new token * comment * refresh token every 5 minutes * add ms multiplier (#3067) * HOTFIX: switch to AWS WP server * HOTFIX: WP server - HTTPS * WP API updated * Revert "WP API updated" This reverts commit 3ecb5d0958a5645a1ddda2d2d6284883362c13d9. * fix source (#3083) --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Crypto form integration test (#3110) * init test and mocks * persisted state * empty form validation msgs * prior to selecting token * error correcting * remove test id * BG-1399: Stripe status handling for manual bank verification (#3107) * Update stripe payment status API to use latest version * Added verify bank account button to 'pending' tab in My Donations * Add 'arrivalDate' in Donations Thanks page * Donation Thanks Page for 'requires_action' status and logged in donor * Show bank verification link for guest donors on thank you page * Removed redundant comment * Renamed 'Verify Bank Account' to 'Action' * Removed unused import * Add type def for specific bank verification fields * Add wordpress assets to post page (#3090) * add in public assets and load via react helmet * remove extra space * dry input * preserve header and footer style --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Stripe form integration test (#3111) * update currency selector with accessible headless components * extract rhf from field * no rhf stripe form * add missing error * rhf hook * rhf * should focus * init setup * prefilled state * validation test and increments * stripe form loading and error * Node proxies (#3113) * optimism proxy * revert mistake * base proxy * terra proxies * stargaze and juno, compress lcd,rpc to nodeUrl * osmosis * kujira * update terra * Add 'ukGiftAid' field in fiat donation payload (#3121) * WP URL updated * Cover processing fee UI (#3112) * processing fees * fee allowance on intent * fix type errors * fee allowance checkbox * flatten * save as fee allowance instead of bool * processing fee row * fee allowance row * remove console log * add fee allowance to estimate gross amount * add to deps list * tip doesnt disable processign fee * total include processing fee * parent set border child set individual padding * no need for custom bottom margin * psersistend state doesnt drive UI show * fix ts error * Copy tweak --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1437: Tribute notif UI (#3122) * fix: pass type * form elements * schema and field sizing * remove unused import * init tribute * stripe checkout tribute wiring * wiring crypto * fix spacing * fix initial size of * msg char counter * FIX: header footer styles (#3124) * only apply wp override in /blog * only apply wp override on /blog * only to blog/:slug * stocks form test (#3126) * Async chain (#3123) * update definition and adjust consumers * cached get chain options * use token definition * only pick subset * actual url * New donations table fields (#3125) * Update '/ap/donations.ts' types with new fields * Fix 'Action' column for fiat bank verification url in mobile table * Fix 'Action' column for fiat bank verification url in donations table * Added 'Recurring' column for donor My Donations tables * Added 'Direct Donation' and 'SF Donation' columns for donor My Donations tables * Added 'appUsed' in nonprofit My Donations table * Added 'paymentMethod' in nonprofit My Donations table * Added 'isRecurring' in nonprofit My Donations table * Single csv report * Add other fields into nonprofit Donations table * Fix 'Load More' button to span full width of table * DAF form test + MSW mocking (#3127) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * Add staging endpoint for S3 file uploading (#3139) * Donate steps - test skips and resets (#3128) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * compress images and use webp format (#3140) * Stripe checkout test - error paths (#3141) * add msw * done crypto using msw * done incrementers * stocks test use msw * fix fetch error * fix build * DAF form test * test skips * tip reset * fix steps test * fix copier warning * remove mock * change donation method * remove unused * client secret loading * by test id * separate file * error * error modals * donate btn * remove debug * UI updates (#3142) * rounded widget form * common donor terms * reuse in preview * update words * revert order * BG-1452: CC always goes along with DAF (#3145) * tooltip detail * cc locking * append stripe if applicable * add cc if daf && no cc * Summary form integration test (#3146) * factor out selector * no form context field and selector * native checkfield * keep description * add accessible error message * uk gift aid test * done tribute fields * top level * Payment tab label: card >> card/bank * init lock (#3147) * Update donations tables (#3144) * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for donor donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO donations table * Renamed 'SF Donation' to 'Donation to Sustainability Fund' for NPO csv file * Set fill function as new 'replaceWithEmptyString' helper function * Updated csv file fields for donor donations * Updated payment method values for NPO donations table and csv file * Changed csv value for 'Donation Origin' to be the same with corresponding NPO donation table column * Set 'Finish Paying' column name to 'Action' for donor intent table * Removed excess '- - -' which consumes 1 column for intent and finalized donor tabs * Set bank verification url action as a button * Update 'Network' column to 'Donation Type' column for donor donations table * Display date in csv file as it appears in respective donation tables for donor and NPO * Display amounts in csv files to 2 decimal places - both NPO and donor tables * Deleted unused 'paymentMethod' helper function and rolled back changes to NPO donations table for donation type * Update column name 'Network' to 'Donation Type' for donor donations table csv * Set 'Finish Paying' column name to 'Action' for donor intent mobile table * Summary step integration test (#3148) * coin gecko mock handlers * test rows * auth cases * descripbe name * use waitFor instead --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Alerts opt out (#3149) * settings route * detailed endows endpoint * userId * alert row * submit handler * query * reuse in endowment link * default checked * update wiring * bump to v3 * add success prompt * preserve bookmark link * correct route * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/Settings.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Update src/pages/UserDashboard/Settings/EndowAlertForm.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * lint fix * spacing --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * endow admin object * handle overflow * bump v2 --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * Terms move from page to checkout (#3160) * t&c in each checkout screen * remove in /donate page * donate widget page remove * widget preview remove * remove unused * remove unused import * donation terms move closer * temp hide UK GiftAid checkbox (#3161) * temp hide UK GiftAid checkbox * temp disable UK GiftAid Tests --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh * v2.4.2 (#3181) * Disable tracking in `/donate-widget` (#3163) * move script to Seo component * override seo in widget page * remove duplicate route * override when inside widget route * donate widget override * `Login` consistency (#3164) * login consistency * vitest upgrade * Auth redirect (#3165) * move hub to app * use hub state instead of local storage * convert to uncontrolled * add isNpo flag * password input autocomplete requirement * autocomplete requirement * state -> fromState * state -> fromState * trigger vaidation when clicking google signin * move user type to top * auth redirect * add comment * protected redirects to signup (#3178) * No edit name (#3177) * disable and add tooltip * bump version * use prompts instead (#3179) * Program info in summary (#3180) * accept program * render program * provide program value --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Bg1489 faqs (#3183) * Email bugs (#3184) * switch to no cors: verified to be still running * move override further down --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * don't load static tokens on unsupported (no infra) chain (#3193) * fix: admin pages reloading on navigation (#3195) * update linkedin tracker (#3199) * v2.4.3 (#3205) * DAF Checkout with chariot (#3143) * Update tsconfig (#3038) * update tsconfig * update type import * dont include type automatically * Program donation dropdown (#3037) * add program attribute * update programId * add program selector on stripe * add program selector in crypt oform * daf program selector * stocks program selector * absolute dropdown * add programId in intent creation * incrementers wrap * add program flag * UI flagged * update tsconfig * update type import * dont include type automatically * prepend general * use programAllowed flag * rename constant * BG-1336: Donate to ap wallet directly (#2978) * Update Polygon and Ethereum testnets to Amoy and Sepolia (#2937) * Update Polygon and Ethereum testnets to Amoy and Sepolia * Format * BG-1253: Pending Payment donation pickup button (#2940) * Add 'Finish Paying' to intent table * Remove redundant endowment fields from Donate page * Add logic to load intent data into Donate page * Update intent type to include token + currency + frequency * Use Currency instead of DetailedCurrency * Update frequency to 'one-time'+'subscription' * Show tip as pct * Remove tx hash column on awaiting payment table * Reset state.transactionId on component unmount * Pass transactionId when creating intents * Pass old intent id in PayPal * Update endpoint * Rename intentTransactionId->oldTransactionId * Add comment * Rename intentTransactionId->oldTransactionId * link / col header fixes --------- Co-authored-by: Andrey * fix twitter acct handle used * V3 endowment (#2941) * BG-1225: Donation success page: Show the name of the nonprofit donor chose (#2869) * Pass recipientName to DonateFiatThanks from PayPal checkout * Pass recipientName in StripePaymentStatus * Donate page: Create PayPal order (donation intent) only on button click (#2873) * Add new 'intent' don. status * Create PayPal order (donation intent) only on button click * Remove redundant isSubmitting state * Refactor createOrder * Revert "Add new 'intent' don. status" This reverts commit 54af8638beaf15ba61ad212a305c9fbd91b24734. * UI Error handling (#2870) Closes BG-1263 Closes BG-1172 This PR aims to separate UI error (UI is unusable, display fallback UI) from user-initiated error (e.g. failed submission, prompt with Modal). Kindly see comments for changes explanation NOTE: renamings, moving of files are not applied yet so that essential changes would stand out. - [ ] rename `useErrorContext` to `useErrorHandler` - [ ] move `useErrorHandler` to `/hooks` - [ ] delete `contexts/ErrorContext` Sample handled UI errors: App encountered error image Page encountered error image Stripe checkout failed image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Slug preview (#2872) * add slug preview ![image](https://github.com/AngelProtocolFinance/angelprotocol-web-app/assets/89639563/7e0a5dd8-62b5-4389-90fb-bb0bd57cc422) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Incorrect card sizes (#2874) * for smaller card sizes (multiple cards per row, where card title alignment matters ) just fill the standard (uniform height) card image area image image * for wide card sizes (single card per rwo), just let the browser pick from srcset and sizes provided and use the rendered size image - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Remove `usdRate` from fiat donation payload and update PayPal proxy endpoint (#2875) * Removed 'usdRate' from 'FiatDonation' payload * Updated PayPal endpoints * BG-1289 Widget word replaced (#2876) Still uising "widget" in site copy. Replaces with "Donation Form". - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - N/A * BG-1281: master fixes (#2877) - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes * Default currency (#2879) * change type * additional loading * include cookie in request * remove additional error ui * BG-1239: Improve / Expand pending donation information (#2880) * Add fiatramp field to DonationRecord type * Fix network sortkey chainName->viaName * Update to always use viaName even for fiat * Fix NetworkDropdown to use Fiat: fiat option type * Add third tab in the Donor's "My Donations" page that would allow them to see all payment intents explicitly (#2868) * Include 'intent' in DonationsQueryParams['status'] * Add new 'Awaiting Payment' tab * fix overlay for tabs * Increase tab width to w-52 * Make more mobile-friendly * BG-1295: Donation increment buttons (#2891) * Add incrementers for USD * Update src/components/donation/Steps/DonateMethods/Stripe/Incrementers.tsx Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Use getValues instead of watch --------- Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Set selected currency in cookie (#2893) * custom host * set cookie * switch to onchange * Update src/constants/urls.ts added mapping in gateway Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Get/set cookie in client (#2896) * cookie helpers * set default code * modify cookie on change * set on endpoint instead * side effect first * comment out (#2898) * BG-1286: compound SF opt-in (#2892) * types and UI * default value * match server * include in fetched * BG-1298: fix img editor issues (#2897) * remove pre-crop * fix bug isDismissible not working * simplify interface * derive values * validate cropped * simplify handlers * validate immediately * remove outdated comment * faq copy changes * Added HomePage (#2894) * Added HomePage Signed-off-by: Navansh * Code Restructuring and Refactoring for Homepage Signed-off-by: Navansh --------- Signed-off-by: Navansh * Landing page fixes (#2899) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * lint fixes pt1 * footer updates * fix hooks * use for...of * Follow up fixes (#2901) * yarn gormat * done lint * fix failing test * revert rename * revert react namespace * react namespace * react namespace --------- Co-authored-by: Andrey Co-authored-by: ap-justin <89639563+ap-justin@users.noreply.github.com> * Convert common arbitrary values to built in tailwind classes (#2902) * misnamed image file * dup wildcard route removed * formatting and other cleanup fixes * spelling fixes * fixes for styles renaming * fix DOM property naming typo * blog posts use dapp URL and remove trailing slash * fix links to marketplace & register page * fix DAPP link to drop app if on prod * remove commented out code * revert svg changes from DOM prop fix * revert svg changes from DOM prop fix * yarn gormat * lint fixes pt1 * done lint * footer updates * fix failing test * fix hooks * use for...of * revert rename * revert react namespace * react namespace * react namespace * blog card classes * delete unused * done blog card bene carousel * more fixes * remove unused controls * remove unused controls * remove one time * unused utils * to tailwind * to navy * to tw util * to tailwind * to tailwind * to tailwind --------- Co-authored-by: Andrey * `DAPP_URL` to `BASE_URL` fix (#2903) * DAPP_URL >> BASE_URL * format/lint fixes --------- Co-authored-by: Andrey * To tsx (#2904) * to tsx * dryner * common media * remove template * remove custom classes * remove brand classes * redirect signins to marketplace, not to root (#2905) Co-authored-by: Andrey * temp hide landing page btns (#2915) Co-authored-by: Andrey * Static pages for legal (#2917) * routes for new legal pages * 3 legal pages copied from prod * fix landing page footerlinks --------- Co-authored-by: Andrey * Home groupings (#2916) * remove nested * animations * blog card * move hero bottom * hero bottom * benefits * testimonials * move footer * nav bar footer * move button * fix lint * Scope custom classes, remove unused (#2919) * move carousel styles * remove svg animation * to module * remove benefits landing * remove util * remove app.css * common css import * Reuse layout (#2918) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo --------- Co-authored-by: Andrey * BG-1243: create crypto intents on Checkout page load + confirm crypto intents on success (#2895) * Create crypto intent on checkout load + confirm on tx success * Use template string in TxSubmit * Extract useCreateCryptoIntent * Show 'Simulating tx...' when no transactionId is present * Remove transactionId state * Refactor * Turn useCryptoIntentCreatorMutation into a query * Revert change to ErrorContext * Remove transformResponse from useConfirmCryptoIntentMutation * Include tip in crypto tx estimation * Rename totalAmount->grossAmount * Legal pages updates (#2922) * updates to legal pages * change Link to anchor tag * link component added to terms page --------- Co-authored-by: Andrey * Landing page fixes (#2921) * reuse layout * remove unused import * move v2 footer to app/footer along with depreciated landing header file; refactor newsletter to use new styles w/ v2 footer; fix footer links & copyright; * remove unused import * footer social links from constants file * fix test * watch sticky instead of scroll * remove no effect * links clean up: dropdown menu & nav logo * hero * done section 2 * overflow * move asset * position chars move assets * remove custom css * embed color * exact * done benefits * done brands * video desktop * animation * alt * spaces * roundness * file name * move assets * done testimonials * done blogs * done blog * external screen classes * testimonials overflow fix * hero hero bottom transition * done hero * carousel blemish * benefits blemish * done animation * page spacing * increate bot padding * blurs * skeleton * add padding * grid footer * responsive styles * intercom hide * remove unused images * icon * slider buttons * blemish transition * spacing * footer spacing * increase blur * Update src/App/Header/index.tsx Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> --------- Co-authored-by: Andrey Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * overflow-x-hidden (#2923) * hidden -> clip (#2924) * BG tip - copy changed * donation split copy changed * split - patch for non-widgetConfig scenario * temp removal of paypal btns from checkout (#2926) * temp removal of paypal btns from checkout * fix build --------- Co-authored-by: Andrey * copy fixes: Widget >> Donation Form * swap in Laira mascot img * adjust schema * move program creator * milestone * remoev initial * new program form * new program update type * fxi type error * update delete * done program editor * add deafult value * milestone buttons * test change * usesubmit only * git reset * remove mb-2 * create program * add milestone * delete method * revert to program editor * form before clean * revert name * back to defaultVals * use values * switch to v8 endowment * update endpoint algolia * registration-update * bump endpoint versions * crypto intent ver * bump version * wise error display --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Andrey Co-authored-by: Navansh * Rolled back stripe donation endpoint (#2944) * up version (#2945) * Update deps (#2948) * update biome and amplify * update stripe and other minor * rest minor * update package manager * revert test * BG-1307 GDPR Banner (#2946) * GDPR banner for non-essential cookies/trackers * transfer to module --------- Co-authored-by: Andrey Co-authored-by: ap-justin * Rolled back crypto-donation endpoint (#2950) * BG-1312: Nonprofits page (#2951) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * BG-1326 Fallback Image updated (#2952) * flying character used as fallback for logo/card img everywhere * new img * BG-1311: Donor info page (#2953) * done hero * increase padding * nonprofit info * done why bg * brands content * extract benefits content * done benefits * new braands * done fiscal sponsorship * move testimonial content * done testimonials * bottom cta done * correct copy * donor info link * update vitest * BG-1320 Homepage fixes (#2943) * loader color * brand img explicit height * tally explicit height * endow card explicit height * testimonial card epxlict height * base layout * path bg * Testimonials fixes to copy for punctuation and other typos/errors (#2947) Co-authored-by: Andrey * Carousel cards mixed up (#2949) Co-authored-by: Andrey * format * fix cherrypick * cherry fix * detail fixes * done hero * move hero bottom * benefits abstract * benefits section * done cta * cta text * add donors link * delete * move img --------- Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> * Added JWT to registration update endpoint (#2954) * update endpoints (#2955) * BG-1327 Banner fallback (#2966) * fallback banner added for profile * admin logo fallback to character * Get user attributes from DB instead of cognito (#2967) * session loader * update types * formatted * remove unused * remove duplicate check * env * User dashboard (#2968) * common layout * rename sidebar header * move sidebar header * factor out header * fix layout * user dashboard * capitalize * copy settings page * edit profile page * dashborad link * create update action * BG-1331: Move donate page inside user dashboard (#2970) * convert to container query * move donations to user dashboard * dont show icon on dashbaord * revert hide icon * Implement share in stripe success page (#2972) * add recipientId * extract share * use extracted * BG-1333 T&C for Widgets (#2973) * Basic T&C added to bottom of Widget + Config preview * simplify widget terms to remove name * move T&C to Content component to access queried profile object * add intent as old (#2977) * add unsupported chainId * skip estimation * token option * crypto qr submit * update copier api * add direct mode * direct option * receiver addr * change copy (#2990) * BG-1341 Widget adaptations (#2976) * hide lines in summary screen when related amounts are 0 (or tipping is disabled) * Stock & DAF donations can set BG tip & split % * Add SF fund explainer and Laira character to Summary view * Address PR feedback * tweak summary info shown w/ Tip/SF logic * BG-1346 Donation Builder: style fixes and design improvement (#2989) * design/style changes to donation form builder * span >> div * tweak styles for padding & alignment on smaller screen layout * Address PR feedback * Nonprofits page improvs (#2991) * change hero img * remove old hero img * add laira imgges * remove waiving char * use latest waiving char * replace waiving laira * replace icon with laira * why bg icons * sf benefits content * formatting * replace waving (#2992) * Donor page changes (#2993) * replace waving * repalce hero image * use sf assets * delete unused * laira icons * benefits order * fixes for testimonals * remove unused file (missed in orig merge) * Home fixes (#2995) * remove unused * replace wavenly with core * change brands heading * add spacing * remove unused module * Donate form screen short carousel (#2997) * remove unused * new screen shots * create carousel * use new carousel * fix size * remove unusd * Remove Leaderboard (#2996) * remove unused leaderboard code & tests * remove additional Leaderboard items * add small padding to bottom of SF msg so doesn't run into payment form (#2998) * Bg 1343 - move tip opt out to settings (#2999) * update types * move component * fix type error * Incrementors adapted to work with all currencies (#3004) * BG-1350 ComplyDog sans Quill (#3005) * complydog JS sans Quill * use local script instead of hitting complydog's server * BG-1344: Program donate checkbox (#3003) * add prog type * prog disable checkbox * retrive attribute * correct endpoints (#3000) * rename variable * Donation state handling (#3002) * local state * improve shape * apply new types * save * widge… * default values and wiring * auto upload of pic * remove ping query * loading text size * remove grouping * isDirty * basic fund profile * field sizing and wrapping * clamp description * save to close only * add authorization * edit profile validation * single form * spacing * featured banner and update types * fund editing * fund already closed error * placeholder tagline * manifest closed * remove unused * unused export --------- Signed-off-by: Navansh Co-authored-by: Nenad Misic Co-authored-by: Juan Paolo Mariano <65009749+jp-mariano@users.noreply.github.com> Co-authored-by: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Co-authored-by: Navansh --- src/App/Header/UserMenu/Funds.tsx | 25 ------------------------- src/App/Header/UserMenu/Menu.tsx | 2 -- src/pages/Funds/Fund.tsx | 6 ------ 3 files changed, 33 deletions(-) delete mode 100644 src/App/Header/UserMenu/Funds.tsx delete mode 100644 src/pages/Funds/Fund.tsx diff --git a/src/App/Header/UserMenu/Funds.tsx b/src/App/Header/UserMenu/Funds.tsx deleted file mode 100644 index 01a2ee7b37..0000000000 --- a/src/App/Header/UserMenu/Funds.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { useUserFundsQuery } from "services/aws/users"; -import { FundLink, Skeleton } from "./EndowmentLink"; - -interface Props { - userId: string; - classes?: string; -} -export function Funds({ userId, classes = "" }: Props) { - const { data: funds = [], isLoading } = useUserFundsQuery(userId); - return ( - - ); -} diff --git a/src/App/Header/UserMenu/Menu.tsx b/src/App/Header/UserMenu/Menu.tsx index 64a1f8ab67..8a63eb55f6 100644 --- a/src/App/Header/UserMenu/Menu.tsx +++ b/src/App/Header/UserMenu/Menu.tsx @@ -5,7 +5,6 @@ import { appRoutes } from "constants/routes"; import { Link } from "react-router-dom"; import type { AuthenticatedUser } from "types/auth"; import { Bookmarks } from "./Bookmarks"; -import { Funds } from "./Funds"; import { Organizations } from "./Organizations"; type Props = { @@ -29,7 +28,6 @@ export default function Menu({ user, signOut, classes }: Props) { My Donations -
BG Admin
diff --git a/src/pages/Funds/Fund.tsx b/src/pages/Funds/Fund.tsx deleted file mode 100644 index aad48f23a2..0000000000 --- a/src/pages/Funds/Fund.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import { useParams } from "react-router-dom"; - -export function Fund() { - const params = useParams(); - return

WIP: Fund: {params.id}

; -} From 7e20ad1f691bb80725a21fcacc46c8d944f39b33 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:05:49 +0800 Subject: [PATCH 33/47] npo funds page --- src/constants/routes.ts | 1 + src/pages/Admin/Charity/Funds/Funds.tsx | 80 +++++++++++++++++++++++++ src/pages/Admin/Charity/Funds/index.ts | 1 + src/pages/Admin/Charity/index.tsx | 1 + src/pages/Admin/constants.ts | 8 +++ src/services/aws/aws.ts | 11 +++- 6 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 src/pages/Admin/Charity/Funds/Funds.tsx create mode 100644 src/pages/Admin/Charity/Funds/index.ts diff --git a/src/constants/routes.ts b/src/constants/routes.ts index 36132d887f..e8fc293241 100644 --- a/src/constants/routes.ts +++ b/src/constants/routes.ts @@ -39,6 +39,7 @@ export const adminRoutes = { settings: "settings", members: "members", media: "media", + funds: "funds", } as const; export enum donateWidgetRoutes { diff --git a/src/pages/Admin/Charity/Funds/Funds.tsx b/src/pages/Admin/Charity/Funds/Funds.tsx new file mode 100644 index 0000000000..e6bb294efe --- /dev/null +++ b/src/pages/Admin/Charity/Funds/Funds.tsx @@ -0,0 +1,80 @@ +import ContentLoader from "components/ContentLoader"; +import Image from "components/Image"; +import QueryLoader from "components/QueryLoader"; +import { appRoutes } from "constants/routes"; +import { Link } from "react-router-dom"; +import { useFundsEndowMemberOfQuery } from "services/aws/aws"; +import type { Fund } from "types/aws"; +import { useAdminContext } from "../../Context"; + +export function Funds() { + const { id } = useAdminContext(); + const query = useFundsEndowMemberOfQuery({ endowId: id }); + return ( +
+

My Fundraisers

+ + + + + + + ), + error: "Failed to get fundraisers", + empty: "No fundraisers found.", + }} + queryState={query} + > + {(funds) => ( + <> + {funds.map((fund) => ( + + ))} + + )} + +
+ ); +} + +const FundItem = (props: Fund.Card) => ( +
+ + {props.name} +

+ {props.active ? "active" : "closed"} +

+ + edit + + + view + +
+); + +export function Skeleton() { + return ( +
+ + +
+ ); +} diff --git a/src/pages/Admin/Charity/Funds/index.ts b/src/pages/Admin/Charity/Funds/index.ts new file mode 100644 index 0000000000..0f4842aa81 --- /dev/null +++ b/src/pages/Admin/Charity/Funds/index.ts @@ -0,0 +1 @@ +export { Funds as Component } from "./Funds"; diff --git a/src/pages/Admin/Charity/index.tsx b/src/pages/Admin/Charity/index.tsx index 6b78e36438..892ed0457c 100644 --- a/src/pages/Admin/Charity/index.tsx +++ b/src/pages/Admin/Charity/index.tsx @@ -35,6 +35,7 @@ export const charityRoute: RouteObject = { ], }, { path: adminRoutes.widget_config, element: }, + { path: adminRoutes.funds, lazy: () => import("./Funds") }, { index: true, lazy: () => import("./Dashboard") }, ...mediaRoutes, ], diff --git a/src/pages/Admin/constants.ts b/src/pages/Admin/constants.ts index c887c261da..ce9184bef5 100644 --- a/src/pages/Admin/constants.ts +++ b/src/pages/Admin/constants.ts @@ -95,6 +95,14 @@ const linkGroup3: LinkGroup = { size: 25, }, }, + { + title: "Fundraisers", + to: sidebarRoutes.funds, + icon: { + type: "HeartFill", + size: 21, + }, + }, ], }; diff --git a/src/services/aws/aws.ts b/src/services/aws/aws.ts index e5ae7ecd45..4c49cf2b85 100644 --- a/src/services/aws/aws.ts +++ b/src/services/aws/aws.ts @@ -19,6 +19,7 @@ import type { EndowmentCard, EndowmentOption, EndowmentsQueryParams, + Fund, } from "types/aws"; import { version as v } from "../helpers"; import type { EndowmentUpdate, IdOrSlug } from "../types"; @@ -157,7 +158,14 @@ export const aws = createApi({ } }, }), - + fundsEndowMemberOf: builder.query({ + providesTags: ["endowment"], + query: ({ endowId }) => { + return { + url: `${v(8)}/endowments/${endowId}/funds`, + }; + }, + }), endowment: builder.query< Endowment, IdOrSlug & { fields?: (keyof Endowment)[] } @@ -248,6 +256,7 @@ export const { useDonationsQuery, useLazyDonationsQuery, useLazyEndowWithEinQuery, + useFundsEndowMemberOfQuery, endpoints: { endowmentCards: { useLazyQuery: useLazyEndowmentCardsQuery }, endowmentOptions: { useLazyQuery: useLazyEndowmentOptionsQuery }, From 04b6dee9642038377672376ba09394f2ef7256b8 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:56:41 +0800 Subject: [PATCH 34/47] expiration in active status --- src/pages/Admin/Charity/Funds/Funds.tsx | 61 ++++++++++++++----------- src/types/aws/ap/index.ts | 5 +- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/src/pages/Admin/Charity/Funds/Funds.tsx b/src/pages/Admin/Charity/Funds/Funds.tsx index e6bb294efe..8ff4afb96c 100644 --- a/src/pages/Admin/Charity/Funds/Funds.tsx +++ b/src/pages/Admin/Charity/Funds/Funds.tsx @@ -2,6 +2,7 @@ import ContentLoader from "components/ContentLoader"; import Image from "components/Image"; import QueryLoader from "components/QueryLoader"; import { appRoutes } from "constants/routes"; +import { useAuthenticatedUser } from "contexts/Auth"; import { Link } from "react-router-dom"; import { useFundsEndowMemberOfQuery } from "services/aws/aws"; import type { Fund } from "types/aws"; @@ -40,32 +41,40 @@ export function Funds() { ); } -const FundItem = (props: Fund.Card) => ( -
- - {props.name} -

- {props.active ? "active" : "closed"} -

- - edit - - - view - -
-); +const FundItem = (props: Fund.Card) => { + const user = useAuthenticatedUser(); + const isActive = new Date().toISOString() <= props.expiration && props.active; + const isEditor = user.funds.includes(props.id); + + return ( +
+ + {props.name} +

+ {isActive ? "active" : "closed"} +

+ + edit + + + view + +
+ ); +}; export function Skeleton() { return ( diff --git a/src/types/aws/ap/index.ts b/src/types/aws/ap/index.ts index d8e8715782..1bfda642f4 100644 --- a/src/types/aws/ap/index.ts +++ b/src/types/aws/ap/index.ts @@ -300,7 +300,10 @@ export namespace Fund { | "members" | "target" | "approvers" - > {} + > { + /** iso | "9999-12-31T23:59:59.000Z" year 9999 */ + expiration: string; + } export interface CardsPage { items: Card[]; From 119c06a668d3937205af9a09be9e516e0f6ec773 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:11:04 +0800 Subject: [PATCH 35/47] remove extra index.ts file --- src/pages/Funds/index.ts | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 src/pages/Funds/index.ts diff --git a/src/pages/Funds/index.ts b/src/pages/Funds/index.ts deleted file mode 100644 index 79cd7aeaea..0000000000 --- a/src/pages/Funds/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from "./Funds"; -export { default as CreateFund } from "./CreateFund"; From f806bef94e4e40ec8c98811dc5ba056bc7274ddb Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 2 Sep 2024 21:08:45 +0800 Subject: [PATCH 36/47] linkedin tracking --- public/scripts/linkedin-tracking.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/linkedin-tracking.js b/public/scripts/linkedin-tracking.js index d1262a0d8b..2b1e0f085b 100644 --- a/public/scripts/linkedin-tracking.js +++ b/public/scripts/linkedin-tracking.js @@ -1,4 +1,4 @@ -_linkedin_partner_id = "6373172"; +_linkedin_partner_id = "4969890"; window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; window._linkedin_data_partner_ids.push(_linkedin_partner_id); From 8293068fb091fa0074cb8b64725a36c45538f224 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Sat, 14 Sep 2024 18:05:35 +0800 Subject: [PATCH 37/47] remove duplicate --- src/pages/Admin/constants.ts | 2 +- src/pages/Funds/CreateFund/CreateFund.tsx | 4 ++-- src/pages/UserDashboard/routes.ts | 8 -------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/pages/Admin/constants.ts b/src/pages/Admin/constants.ts index ce9184bef5..c4141090ab 100644 --- a/src/pages/Admin/constants.ts +++ b/src/pages/Admin/constants.ts @@ -99,7 +99,7 @@ const linkGroup3: LinkGroup = { title: "Fundraisers", to: sidebarRoutes.funds, icon: { - type: "HeartFill", + type: "Heart", size: 21, }, }, diff --git a/src/pages/Funds/CreateFund/CreateFund.tsx b/src/pages/Funds/CreateFund/CreateFund.tsx index d5f6941b2b..7aefbd2471 100644 --- a/src/pages/Funds/CreateFund/CreateFund.tsx +++ b/src/pages/Funds/CreateFund/CreateFund.tsx @@ -112,8 +112,8 @@ export default withAuth(function CreateFund() { fv.targetType === "none" ? `${0}` : fv.targetType === "smart" - ? "smart" - : `${+fv.fixedTarget}`, + ? "smart" + : `${+fv.fixedTarget}`, }; if (fv.expiration) fund.expiration = fv.expiration; diff --git a/src/pages/UserDashboard/routes.ts b/src/pages/UserDashboard/routes.ts index 721d9bd3e3..fd99a7edad 100644 --- a/src/pages/UserDashboard/routes.ts +++ b/src/pages/UserDashboard/routes.ts @@ -43,14 +43,6 @@ export const linkGroups: LinkGroup[] = [ size: 21, }, }, - { - title: "My fundraisers", - to: routes.funds, - icon: { - type: "HeartFill", - size: 21, - }, - }, ], }, ]; From 8d6e7280e9a6fe93f0cbd78b70f9e692164c080a Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:58:40 +0800 Subject: [PATCH 38/47] updated --- src/pages/Funds/CreateFund/CreateFund.tsx | 27 +---------------------- src/pages/Funds/CreateFund/types.ts | 1 - src/pages/Funds/CreateFund/useEndow.ts | 7 +++--- src/types/aws/ap/index.ts | 2 -- 4 files changed, 4 insertions(+), 33 deletions(-) diff --git a/src/pages/Funds/CreateFund/CreateFund.tsx b/src/pages/Funds/CreateFund/CreateFund.tsx index 7aefbd2471..81ebc0cd90 100644 --- a/src/pages/Funds/CreateFund/CreateFund.tsx +++ b/src/pages/Funds/CreateFund/CreateFund.tsx @@ -1,7 +1,6 @@ import { yupResolver } from "@hookform/resolvers/yup"; import { ControlledImgEditor as ImgEditor } from "components/ImgEditor"; import Prompt from "components/Prompt"; -import { LockedSplitSlider } from "components/donation"; import { NativeCheckField as CheckField, NativeField as Field, @@ -49,17 +48,12 @@ export default withAuth(function CreateFund() { settings: { from: "fund", allowBgTip: true, - liquidSplit: 50, }, targetType: "smart", }, }); const { field: banner } = useController({ control, name: "banner" }); const { field: logo } = useController({ control, name: "logo" }); - const { field: liquidSplitPct } = useController({ - control, - name: "settings.liquidSplit", - }); const { field: members } = useController({ control, name: "members", @@ -69,9 +63,6 @@ export default withAuth(function CreateFund() { name: "targetType", }); - //keep track of what user previously set - //revert to it when endow is no longer 1 - const customSplitRef = useRef(50); const customAllowBgTipRef = useRef(true); const endowReqRef = useRef(); @@ -105,7 +96,6 @@ export default withAuth(function CreateFund() { members: fv.members.map((m) => m.id), featured: fv.featured, settings: { - liquidSplitPct: fv.settings.liquidSplit, allowBgTip: fv.settings.allowBgTip, }, target: @@ -182,7 +172,6 @@ export default withAuth(function CreateFund() { endowReqRef.current = undefined; return setValue("settings", { from: "fund", - liquidSplit: customSplitRef.current, allowBgTip: customAllowBgTipRef.current, }); } @@ -193,7 +182,7 @@ export default withAuth(function CreateFund() { const endowReq = getEndow( { id: opt.id, - fields: ["hide_bg_tip", "splitLiqPct", "name"], + fields: ["hide_bg_tip", "name"], }, true ); @@ -208,7 +197,6 @@ export default withAuth(function CreateFund() { setValue("settings", { from: endow.name, allowBgTip: !endow.hide_bg_tip, - liquidSplit: endow.splitLiqPct ?? 50, }); } catch (err) { logger.error(err); @@ -299,19 +287,6 @@ export default withAuth(function CreateFund() { `${withPossesive(settings.from)} config has been applied`}

- - { - const liq = 100 - lockedPct; - liquidSplitPct.onChange(liq); - customSplitRef.current = liq; - }} - /> - ; +export type Endow = Pick; export function useEndow( members: FundMember[], @@ -24,15 +24,14 @@ export function useEndow( getEndow( { id: numId, - fields: ["hide_bg_tip", "splitLiqPct", "name"], + fields: ["hide_bg_tip", "name"], }, true ) .unwrap() - .then(({ hide_bg_tip, splitLiqPct, name }) => { + .then(({ hide_bg_tip, name }) => { onEndowSet({ hide_bg_tip, - splitLiqPct, name, }); }); diff --git a/src/types/aws/ap/index.ts b/src/types/aws/ap/index.ts index 1bfda642f4..63ee1ea702 100644 --- a/src/types/aws/ap/index.ts +++ b/src/types/aws/ap/index.ts @@ -247,8 +247,6 @@ export interface Fund { featured: boolean; active: boolean; settings: { - /** 1 - 100 */ - liquidSplitPct: number; allowBgTip: boolean; }; /** iso */ From f058e6cce928571e1f4913861b63eacb380dd16a Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:21:57 +0800 Subject: [PATCH 39/47] convert to valibot --- src/pages/Funds/CreateFund/CreateFund.tsx | 26 +++--- .../EndowmentSelector/EndowmentSelector.tsx | 12 ++- .../CreateFund/EndowmentSelector/Options.tsx | 4 +- src/pages/Funds/CreateFund/schema.ts | 84 +++++++++++-------- src/pages/Funds/CreateFund/types.ts | 27 ------ src/pages/Funds/CreateFund/useEndow.ts | 2 +- src/pages/Funds/common/GoalSelector.tsx | 3 +- src/pages/Funds/common/index.ts | 1 + src/pages/Funds/common/types.ts | 20 +++++ .../Steps/ContactDetails/Form/index.tsx | 2 - 10 files changed, 94 insertions(+), 87 deletions(-) delete mode 100644 src/pages/Funds/CreateFund/types.ts create mode 100644 src/pages/Funds/common/types.ts diff --git a/src/pages/Funds/CreateFund/CreateFund.tsx b/src/pages/Funds/CreateFund/CreateFund.tsx index 81ebc0cd90..315bd2b1f7 100644 --- a/src/pages/Funds/CreateFund/CreateFund.tsx +++ b/src/pages/Funds/CreateFund/CreateFund.tsx @@ -1,4 +1,4 @@ -import { yupResolver } from "@hookform/resolvers/yup"; +import { valibotResolver } from "@hookform/resolvers/valibot"; import { ControlledImgEditor as ImgEditor } from "components/ImgEditor"; import Prompt from "components/Prompt"; import { @@ -22,8 +22,7 @@ import { useCreateFundMutation } from "services/aws/funds"; import type { Fund } from "types/aws"; import { GoalSelector, MAX_SIZE_IN_BYTES, VALID_MIME_TYPES } from "../common"; import { EndowmentSelector } from "./EndowmentSelector"; -import { schema } from "./schema"; -import type { FormValues as FV } from "./types"; +import { type FV, schema } from "./schema"; export default withAuth(function CreateFund() { const { @@ -36,7 +35,7 @@ export default withAuth(function CreateFund() { formState: { errors, isSubmitting }, watch, } = useForm({ - resolver: yupResolver(schema), + resolver: valibotResolver(schema), defaultValues: { name: "", description: "", @@ -49,7 +48,9 @@ export default withAuth(function CreateFund() { from: "fund", allowBgTip: true, }, - targetType: "smart", + target: { + type: "smart", + }, }, }); const { field: banner } = useController({ control, name: "banner" }); @@ -60,7 +61,7 @@ export default withAuth(function CreateFund() { }); const { field: targetType } = useController({ control, - name: "targetType", + name: "target.type", }); const customAllowBgTipRef = useRef(true); @@ -99,11 +100,11 @@ export default withAuth(function CreateFund() { allowBgTip: fv.settings.allowBgTip, }, target: - fv.targetType === "none" + fv.target.type === "none" ? `${0}` - : fv.targetType === "smart" + : fv.target.type === "smart" ? "smart" - : `${+fv.fixedTarget}`, + : `${+fv.target.value}`, //fixedTarget is required when targetType is fixed }; if (fv.expiration) fund.expiration = fv.expiration; @@ -145,6 +146,7 @@ export default withAuth(function CreateFund() { className="grid border border-gray-l4 rounded-lg p-6 my-4 w-full max-w-4xl" >

Fund information

+ {targetType.value === "fixed" && ( )} @@ -266,7 +268,7 @@ export default withAuth(function CreateFund() { dropzone: "aspect-[1/1] w-60", }} maxSize={MAX_SIZE_IN_BYTES} - error={errors.banner?.file?.message} + error={errors.logo?.file?.message} /> void; +type OnChange = (opts: EndowOption[]) => void; interface Props { - values: EndowmentOption[]; + values: EndowOption[]; onChange: OnChange; classes?: string; disabled?: boolean; @@ -87,8 +85,8 @@ export const EndowmentSelector = forwardRef((props, ref) => { ); }); -interface ISelectedOption extends EndowmentOption { - onDeselect: (thisOpt: EndowmentOption) => void; +interface ISelectedOption extends EndowOption { + onDeselect: (thisOpt: EndowOption) => void; } function SelectedOption({ onDeselect, ...props }: ISelectedOption) { diff --git a/src/pages/Funds/CreateFund/EndowmentSelector/Options.tsx b/src/pages/Funds/CreateFund/EndowmentSelector/Options.tsx index 85a0df5b3a..9c89c12012 100644 --- a/src/pages/Funds/CreateFund/EndowmentSelector/Options.tsx +++ b/src/pages/Funds/CreateFund/EndowmentSelector/Options.tsx @@ -3,7 +3,7 @@ import Image from "components/Image"; import { ErrorStatus, Info, LoadingStatus } from "components/Status"; import useDebouncer from "hooks/useDebouncer"; import { useEndowmentCardsQuery } from "services/aws/aws"; -import type { FundMember } from "../types"; +import type { EndowOption } from "../schema"; interface Props { searchText: string; @@ -52,7 +52,7 @@ export function Options({ classes = "", searchText }: Props) { logo: o.card_img, name: o.name, id: o.id, - } satisfies FundMember + } satisfies EndowOption } className="flex gap-x-2 p-2 data-[selected]:text-blue-d1 data-[selected]:pointer-events-none hover:bg-blue-l4 select-none" > diff --git a/src/pages/Funds/CreateFund/schema.ts b/src/pages/Funds/CreateFund/schema.ts index a030734cc7..4729c1ce5f 100644 --- a/src/pages/Funds/CreateFund/schema.ts +++ b/src/pages/Funds/CreateFund/schema.ts @@ -1,41 +1,57 @@ -import type { ImgLink } from "components/ImgEditor"; -import { genFileSchema } from "schemas/file"; -import { schema as schemaFn, stringNumber } from "schemas/shape"; -import { requiredString } from "schemas/string"; -import { array, string } from "yup"; -import { MAX_SIZE_IN_BYTES, VALID_MIME_TYPES } from "../common"; -import type { FormValues as FV } from "./types"; +import * as v from "valibot"; +import { MAX_SIZE_IN_BYTES, VALID_MIME_TYPES, target } from "../common"; -const fileObj = schemaFn({ - file: genFileSchema(MAX_SIZE_IN_BYTES, VALID_MIME_TYPES).required("required"), +const str = v.pipe(v.string(), v.trim()); + +const fileObject = v.object({ + name: str, + publicUrl: v.pipe(str, v.url()), +}); + +export const imgLink = v.object({ + file: v.optional( + v.pipe( + v.file(), + v.mimeType(VALID_MIME_TYPES, "invalid type"), + v.maxSize(MAX_SIZE_IN_BYTES, "exceeds size limit") + ) + ), + preview: v.pipe(str, v.url()), + ...fileObject.entries, }); -const targetTypeKey: keyof FV = "targetType"; +export const endowOption = v.object({ + id: v.number(), + name: str, + logo: v.optional(v.pipe(str, v.url())), +}); -export const schema = schemaFn({ - name: requiredString, - description: requiredString, - banner: fileObj, - logo: fileObj, - members: array().min(1, "must contain at least one endowment"), - expiration: string() - .transform((v) => { - if (!v) return ""; - return new Date(v).toISOString(); - }) - .datetime("invalid date") - .test( - "", - "must be in the future", - (v) => !v || v >= new Date().toISOString() - ), +export const settings = v.object({ + from: str, + allowBgTip: v.boolean(), +}); - fixedTarget: stringNumber( - (s) => - s.when(targetTypeKey, (values, schema) => { - const [type] = values as [FV["targetType"]]; - return type === "fixed" ? schema.required("required") : schema; - }), - (n) => n.positive("must be greater than 0") +export const schema = v.object({ + name: v.pipe(str, v.nonEmpty("required")), + description: v.pipe(str, v.nonEmpty("required")), + banner: imgLink, + logo: imgLink, + members: v.pipe( + v.array(endowOption), + v.minLength(1, "must contain at least one endowment") ), + featured: v.boolean(), + settings, + expiration: v.pipe( + str, + v.nonEmpty("required"), + v.transform((v) => new Date(v).toISOString()), + v.isoTimestamp("invalid date"), + v.minValue(new Date().toISOString(), "must be in the future") + ), + target, }); + +export interface FundMember extends v.InferOutput {} +export interface EndowOption extends FundMember {} +export type FV = v.InferOutput; diff --git a/src/pages/Funds/CreateFund/types.ts b/src/pages/Funds/CreateFund/types.ts deleted file mode 100644 index 3a4fed5872..0000000000 --- a/src/pages/Funds/CreateFund/types.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { ImgLink } from "components/ImgEditor"; -import type { TargetType } from "../common"; - -export interface FundMember { - id: number; - name: string; - logo?: string; -} - -export interface Settings { - /** endowname or fund */ - from: string; - allowBgTip: boolean; -} - -export interface FormValues { - name: string; - description: string; - logo: ImgLink; - banner: ImgLink; - expiration: string; - featured: boolean; - members: FundMember[]; - settings: Settings; - targetType: TargetType; - fixedTarget: string; -} diff --git a/src/pages/Funds/CreateFund/useEndow.ts b/src/pages/Funds/CreateFund/useEndow.ts index 33eeee6d7a..c16510499b 100644 --- a/src/pages/Funds/CreateFund/useEndow.ts +++ b/src/pages/Funds/CreateFund/useEndow.ts @@ -1,7 +1,7 @@ import { useEffect } from "react"; import { useLazyProfileQuery } from "services/aws/aws"; import type { Endowment } from "types/aws"; -import type { FundMember } from "./types"; +import type { FundMember } from "./schema"; export type Endow = Pick; diff --git a/src/pages/Funds/common/GoalSelector.tsx b/src/pages/Funds/common/GoalSelector.tsx index 91c560fabf..3165de6b3f 100644 --- a/src/pages/Funds/common/GoalSelector.tsx +++ b/src/pages/Funds/common/GoalSelector.tsx @@ -1,6 +1,5 @@ import { Field, Label, Radio, RadioGroup } from "@headlessui/react"; - -export type TargetType = "fixed" | "none" | "smart"; +import type { TargetType } from "./types"; const options: { [T in TargetType]: string } = { smart: "Use smart milestones", diff --git a/src/pages/Funds/common/index.ts b/src/pages/Funds/common/index.ts index fcf509e10b..91ff67f7a7 100644 --- a/src/pages/Funds/common/index.ts +++ b/src/pages/Funds/common/index.ts @@ -1,4 +1,5 @@ import type { ImageMIMEType } from "types/lists"; +export { target, type TargetType } from "./types"; export * from "./GoalSelector"; diff --git a/src/pages/Funds/common/types.ts b/src/pages/Funds/common/types.ts new file mode 100644 index 0000000000..d7fedb6aa6 --- /dev/null +++ b/src/pages/Funds/common/types.ts @@ -0,0 +1,20 @@ +import * as v from "valibot"; +export const target = v.variant("type", [ + v.object({ + type: v.literal("fixed"), + value: v.pipe( + v.string("required"), + v.nonEmpty("required"), + v.transform((x) => +x), + v.number("invalid number"), + v.minValue(0, "must be greater than 0"), + /** so that the inferred type is string */ + v.transform((x) => x.toString()) + ), + }), + v.object({ type: v.literal("smart"), value: v.optional(v.string()) }), + v.object({ type: v.literal("none"), value: v.optional(v.string()) }), +]); + +export type Target = v.InferOutput; +export type TargetType = Target["type"]; diff --git a/src/pages/Registration/Steps/ContactDetails/Form/index.tsx b/src/pages/Registration/Steps/ContactDetails/Form/index.tsx index 08588b9a00..deb9809056 100644 --- a/src/pages/Registration/Steps/ContactDetails/Form/index.tsx +++ b/src/pages/Registration/Steps/ContactDetails/Form/index.tsx @@ -60,8 +60,6 @@ export default function Form({ classes = "" }: { classes?: string }) { } }; - console.log({ errors }); - return ( Date: Sat, 5 Oct 2024 12:14:51 +0800 Subject: [PATCH 40/47] fix file and date schema --- src/pages/Funds/CreateFund/CreateFund.tsx | 1 - src/pages/Funds/CreateFund/schema.ts | 26 ++++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/pages/Funds/CreateFund/CreateFund.tsx b/src/pages/Funds/CreateFund/CreateFund.tsx index 315bd2b1f7..b0d840b7f1 100644 --- a/src/pages/Funds/CreateFund/CreateFund.tsx +++ b/src/pages/Funds/CreateFund/CreateFund.tsx @@ -41,7 +41,6 @@ export default withAuth(function CreateFund() { description: "", logo: { preview: "", publicUrl: "" }, banner: { preview: "", publicUrl: "" }, - expiration: "", featured: true, members: [], settings: { diff --git a/src/pages/Funds/CreateFund/schema.ts b/src/pages/Funds/CreateFund/schema.ts index 4729c1ce5f..9354e386d8 100644 --- a/src/pages/Funds/CreateFund/schema.ts +++ b/src/pages/Funds/CreateFund/schema.ts @@ -9,12 +9,10 @@ const fileObject = v.object({ }); export const imgLink = v.object({ - file: v.optional( - v.pipe( - v.file(), - v.mimeType(VALID_MIME_TYPES, "invalid type"), - v.maxSize(MAX_SIZE_IN_BYTES, "exceeds size limit") - ) + file: v.pipe( + v.file("required"), + v.mimeType(VALID_MIME_TYPES, "invalid type"), + v.maxSize(MAX_SIZE_IN_BYTES, "exceeds size limit") ), preview: v.pipe(str, v.url()), ...fileObject.entries, @@ -42,12 +40,16 @@ export const schema = v.object({ ), featured: v.boolean(), settings, - expiration: v.pipe( - str, - v.nonEmpty("required"), - v.transform((v) => new Date(v).toISOString()), - v.isoTimestamp("invalid date"), - v.minValue(new Date().toISOString(), "must be in the future") + expiration: v.optional( + v.lazy((val) => { + if (!val) return v.string(); + return v.pipe( + v.string(), + v.transform((val) => val && new Date(val).toISOString()), + v.isoTimestamp("invalid date"), + v.minValue(new Date().toISOString(), "must be in the future") + ); + }) ), target, }); From e734896bad69d7c6f04136f8b94c3d099394b844 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Sat, 5 Oct 2024 21:44:38 +0800 Subject: [PATCH 41/47] use fundraiser lib --- package.json | 2 + src/pages/Admin/Charity/Funds/Funds.tsx | 4 +- src/pages/Funds/Cards/Card.tsx | 4 +- src/pages/Funds/Cards/Progress.tsx | 4 +- src/pages/Funds/CreateFund/CreateFund.tsx | 4 +- src/pages/Funds/EditFund/Form.tsx | 27 ++++---- src/pages/Funds/EditFund/schema.ts | 27 ++++++++ src/pages/Funds/EditFund/types.ts | 10 --- src/pages/Funds/EditFund/useRhf.ts | 58 +++------------- src/pages/Funds/Fund/FundContext.ts | 6 +- src/services/aws/aws.ts | 4 +- src/services/aws/funds.ts | 15 +++-- src/types/aws/ap/index.ts | 81 ----------------------- yarn.lock | 23 +++++++ 14 files changed, 100 insertions(+), 169 deletions(-) create mode 100644 src/pages/Funds/EditFund/schema.ts delete mode 100644 src/pages/Funds/EditFund/types.ts diff --git a/package.json b/package.json index 7e91ddd465..18bd37d06f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,9 @@ }, "dependencies": { "@better-giving/assets": "1.0.18", + "@better-giving/fundraiser": "1.0.0-rc.5", "@better-giving/registration": "1.0.24", + "@better-giving/types": "1.0.0-rc.2", "@gsap/react": "2.1.1", "@headlessui/react": "2.1.0", "@hookform/error-message": "2.0.1", diff --git a/src/pages/Admin/Charity/Funds/Funds.tsx b/src/pages/Admin/Charity/Funds/Funds.tsx index 8ff4afb96c..66fcbfe32f 100644 --- a/src/pages/Admin/Charity/Funds/Funds.tsx +++ b/src/pages/Admin/Charity/Funds/Funds.tsx @@ -1,3 +1,4 @@ +import type { FundItem as TFundItem } from "@better-giving/fundraiser"; import ContentLoader from "components/ContentLoader"; import Image from "components/Image"; import QueryLoader from "components/QueryLoader"; @@ -5,7 +6,6 @@ import { appRoutes } from "constants/routes"; import { useAuthenticatedUser } from "contexts/Auth"; import { Link } from "react-router-dom"; import { useFundsEndowMemberOfQuery } from "services/aws/aws"; -import type { Fund } from "types/aws"; import { useAdminContext } from "../../Context"; export function Funds() { @@ -41,7 +41,7 @@ export function Funds() { ); } -const FundItem = (props: Fund.Card) => { +const FundItem = (props: TFundItem) => { const user = useAuthenticatedUser(); const isActive = new Date().toISOString() <= props.expiration && props.active; const isEditor = user.funds.includes(props.id); diff --git a/src/pages/Funds/Cards/Card.tsx b/src/pages/Funds/Cards/Card.tsx index 186c3f7240..1fcadfe37c 100644 --- a/src/pages/Funds/Cards/Card.tsx +++ b/src/pages/Funds/Cards/Card.tsx @@ -1,9 +1,9 @@ +import type { FundItem } from "@better-giving/fundraiser"; import flying_character from "assets/images/flying-character.png"; import Image from "components/Image"; import VerifiedIcon from "components/VerifiedIcon"; import { appRoutes } from "constants/routes"; import { Link } from "react-router-dom"; -import type { Fund } from "types/aws"; import { Progress } from "./Progress"; export default function Card({ @@ -14,7 +14,7 @@ export default function Card({ verified, donation_total_usd, target, -}: Fund.Card) { +}: FundItem) { return (
+ props: Pick ) { if (props.target === "0") { if (!props.donation_total_usd) return; diff --git a/src/pages/Funds/CreateFund/CreateFund.tsx b/src/pages/Funds/CreateFund/CreateFund.tsx index b0d840b7f1..3b03d6362d 100644 --- a/src/pages/Funds/CreateFund/CreateFund.tsx +++ b/src/pages/Funds/CreateFund/CreateFund.tsx @@ -1,3 +1,4 @@ +import type { NewFund } from "@better-giving/fundraiser/schema"; import { valibotResolver } from "@hookform/resolvers/valibot"; import { ControlledImgEditor as ImgEditor } from "components/ImgEditor"; import Prompt from "components/Prompt"; @@ -19,7 +20,6 @@ import { type SubmitHandler, useController, useForm } from "react-hook-form"; import { Link } from "react-router-dom"; import { useLazyProfileQuery } from "services/aws/aws"; import { useCreateFundMutation } from "services/aws/funds"; -import type { Fund } from "types/aws"; import { GoalSelector, MAX_SIZE_IN_BYTES, VALID_MIME_TYPES } from "../common"; import { EndowmentSelector } from "./EndowmentSelector"; import { type FV, schema } from "./schema"; @@ -88,7 +88,7 @@ export default withAuth(function CreateFund() { showModal(Prompt, { type: "loading", children: "Creating fund..." }); - const fund: Fund.New = { + const fund: NewFund = { name: fv.name, description: fv.description, banner: getFullURL(uploadBaseUrl, banner.file.name), diff --git a/src/pages/Funds/EditFund/Form.tsx b/src/pages/Funds/EditFund/Form.tsx index a74ec3dcb4..16fb14ce1d 100644 --- a/src/pages/Funds/EditFund/Form.tsx +++ b/src/pages/Funds/EditFund/Form.tsx @@ -1,3 +1,5 @@ +import type { SingleFund } from "@better-giving/fundraiser"; +import type { FundUpdate } from "@better-giving/fundraiser/schema"; import { ControlledImgEditor as ImgEditor, type ImgLink, @@ -9,13 +11,15 @@ import { useModalContext } from "contexts/ModalContext"; import { getFullURL, uploadFiles } from "helpers/uploadFiles"; import type { SubmitHandler } from "react-hook-form"; import { useCloseFundMutation, useEditFundMutation } from "services/aws/funds"; -import type { Fund } from "types/aws"; import { GoalSelector, MAX_SIZE_IN_BYTES, VALID_MIME_TYPES } from "../common"; import { FeatureBanner } from "./FeatureBanner"; -import type { FV } from "./types"; +import type { FV } from "./schema"; import { useRhf } from "./useRhf"; -export function Form({ classes = "", ...props }: Fund & { classes?: string }) { +export function Form({ + classes = "", + ...props +}: SingleFund & { classes?: string }) { const { showModal } = useModalContext(); const { handleError } = useErrorContext(); const rhf = useRhf(props); @@ -24,8 +28,7 @@ export function Form({ classes = "", ...props }: Fund & { classes?: string }) { const [closeFund, { isLoading: isClosingFund }] = useCloseFundMutation(); const onSubmit: SubmitHandler = async ({ - targetType, - fixedTarget, + target, logo, banner, ...fv @@ -40,15 +43,15 @@ export function Form({ classes = "", ...props }: Fund & { classes?: string }) { }); /// BUILD UPDATE /// - const update: Fund.Update = {}; + const update: FundUpdate = {}; - if (rhf.dirtyFields.targetType || rhf.dirtyFields.fixedTarget) { + if (rhf.dirtyFields.target) { update.target = - targetType === "none" + target.type === "none" ? "0" - : targetType === "smart" + : target.type === "smart" ? "smart" - : (fixedTarget as `${number}`); + : target.value; } if (rhf.dirtyFields.banner) update.banner = bannerUrl; @@ -161,11 +164,11 @@ export function Form({ classes = "", ...props }: Fund & { classes?: string }) { /> {rhf.targetType.value === "fixed" && ( )} diff --git a/src/pages/Funds/EditFund/schema.ts b/src/pages/Funds/EditFund/schema.ts new file mode 100644 index 0000000000..df00985a79 --- /dev/null +++ b/src/pages/Funds/EditFund/schema.ts @@ -0,0 +1,27 @@ +import { fileObject } from "@better-giving/types"; +import * as v from "valibot"; +import { MAX_SIZE_IN_BYTES, VALID_MIME_TYPES, target } from "../common"; + +const str = v.pipe(v.string(), v.trim()); + +export const imgLink = v.object({ + file: v.optional( + v.pipe( + v.file("required"), + v.mimeType(VALID_MIME_TYPES, "invalid type"), + v.maxSize(MAX_SIZE_IN_BYTES, "exceeds size limit") + ) + ), + preview: v.pipe(str, v.url()), + ...fileObject.entries, +}); + +export const schema = v.object({ + name: v.pipe(str, v.nonEmpty("required")), + description: v.pipe(str, v.nonEmpty("required")), + target, + banner: imgLink, + logo: imgLink, +}); + +export type FV = v.InferOutput; diff --git a/src/pages/Funds/EditFund/types.ts b/src/pages/Funds/EditFund/types.ts deleted file mode 100644 index 059ba933fa..0000000000 --- a/src/pages/Funds/EditFund/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ImgLink } from "components/ImgEditor"; -import type { Fund } from "types/aws"; -import type { TargetType } from "../common"; - -export interface FV extends Pick { - targetType: TargetType; - fixedTarget: string; - banner: ImgLink; - logo: ImgLink; -} diff --git a/src/pages/Funds/EditFund/useRhf.ts b/src/pages/Funds/EditFund/useRhf.ts index e68887e2b6..37d8063422 100644 --- a/src/pages/Funds/EditFund/useRhf.ts +++ b/src/pages/Funds/EditFund/useRhf.ts @@ -1,46 +1,9 @@ -import { yupResolver } from "@hookform/resolvers/yup"; -import type { ImgLink } from "components/ImgEditor"; +import type { SingleFund } from "@better-giving/fundraiser"; +import { valibotResolver } from "@hookform/resolvers/valibot"; import { useController, useForm } from "react-hook-form"; -import { genFileSchema } from "schemas/file"; -import { schema as schemaFn, stringNumber } from "schemas/shape"; -import type { Fund } from "types/aws"; -import { string } from "yup"; -import { - MAX_SIZE_IN_BYTES, - type TargetType, - VALID_MIME_TYPES, -} from "../common"; -import type { FV } from "./types"; +import { type FV, schema } from "./schema"; -const fileObj = schemaFn({ - file: genFileSchema(MAX_SIZE_IN_BYTES, VALID_MIME_TYPES), -}); - -const targetTypeKey: keyof FV = "targetType"; -const schema = schemaFn({ - name: string().required("required"), - description: string().required("required"), - fixedTarget: stringNumber( - (str) => { - return str.when(targetTypeKey, (values, schema) => { - const [type] = values as [TargetType]; - return type === "fixed" ? schema.required("required") : schema; - }); - }, - (n) => { - return n.when(targetTypeKey, (values, schema) => { - const [type] = values as [TargetType]; - return type === "fixed" - ? schema.positive("must be greater than 0") - : schema; - }); - } - ), - logo: fileObj, - banner: fileObj, -}); - -export function useRhf(init: Fund) { +export function useRhf(init: SingleFund) { const { register, handleSubmit, @@ -49,17 +12,16 @@ export function useRhf(init: Fund) { resetField, formState: { isSubmitting, errors, isDirty, dirtyFields }, } = useForm({ - resolver: yupResolver(schema), + resolver: valibotResolver(schema), values: { name: init.name, description: init.description, - targetType: + target: init.target === "0" - ? "none" + ? { type: "none" } : init.target === "smart" - ? "smart" - : "fixed", - fixedTarget: init.target === "smart" ? "" : init.target, + ? { type: "smart" } + : { type: "fixed", value: init.target }, logo: { name: "", preview: init.logo, publicUrl: init.logo }, banner: { name: "", preview: init.banner, publicUrl: init.banner }, }, @@ -67,7 +29,7 @@ export function useRhf(init: Fund) { const { field: targetType } = useController({ control, - name: "targetType", + name: "target.type", }); const { field: logo } = useController({ control, name: "logo" }); diff --git a/src/pages/Funds/Fund/FundContext.ts b/src/pages/Funds/Fund/FundContext.ts index 89a2135242..8d0d74ee09 100644 --- a/src/pages/Funds/Fund/FundContext.ts +++ b/src/pages/Funds/Fund/FundContext.ts @@ -1,10 +1,10 @@ +import type { SingleFund } from "@better-giving/fundraiser"; import { isEmpty } from "helpers"; import { createContext, useContext } from "react"; -import type { Fund } from "types/aws"; -export const FundContext = createContext({} as Fund); +export const FundContext = createContext({} as SingleFund); -export const useFundContext = (): Fund => { +export const useFundContext = (): SingleFund => { const val = useContext(FundContext); if (isEmpty(Object.entries(val))) { diff --git a/src/services/aws/aws.ts b/src/services/aws/aws.ts index 4c49cf2b85..e880001b26 100644 --- a/src/services/aws/aws.ts +++ b/src/services/aws/aws.ts @@ -1,3 +1,4 @@ +import type { FundItem } from "@better-giving/fundraiser"; import type { Application, Page, @@ -19,7 +20,6 @@ import type { EndowmentCard, EndowmentOption, EndowmentsQueryParams, - Fund, } from "types/aws"; import { version as v } from "../helpers"; import type { EndowmentUpdate, IdOrSlug } from "../types"; @@ -158,7 +158,7 @@ export const aws = createApi({ } }, }), - fundsEndowMemberOf: builder.query({ + fundsEndowMemberOf: builder.query({ providesTags: ["endowment"], query: ({ endowId }) => { return { diff --git a/src/services/aws/funds.ts b/src/services/aws/funds.ts index b32463b0d5..63733b7397 100644 --- a/src/services/aws/funds.ts +++ b/src/services/aws/funds.ts @@ -1,11 +1,16 @@ +import type { FundsPage, SingleFund } from "@better-giving/fundraiser"; +import type { + FundUpdate, + FundsParams, + NewFund, +} from "@better-giving/fundraiser/schema"; import { TEMP_JWT } from "constants/auth"; -import type { Fund } from "types/aws"; import { version as v } from "../helpers"; import { aws } from "./aws"; export const funds = aws.injectEndpoints({ endpoints: (builder) => ({ - createFund: builder.mutation<{ id: string }, Fund.New>({ + createFund: builder.mutation<{ id: string }, NewFund>({ invalidatesTags: ["funds"], query: (payload) => { return { @@ -16,7 +21,7 @@ export const funds = aws.injectEndpoints({ }; }, }), - editFund: builder.mutation({ + editFund: builder.mutation({ invalidatesTags: ["funds", "fund"], query: ({ id, ...payload }) => { return { @@ -37,7 +42,7 @@ export const funds = aws.injectEndpoints({ }; }, }), - funds: builder.query({ + funds: builder.query({ providesTags: ["funds"], query: (params) => { return { @@ -46,7 +51,7 @@ export const funds = aws.injectEndpoints({ }; }, }), - fund: builder.query({ + fund: builder.query({ providesTags: ["fund"], query: (fundId) => `${v(1)}/funds/${fundId}`, }), diff --git a/src/types/aws/ap/index.ts b/src/types/aws/ap/index.ts index 63ee1ea702..45cf3405f2 100644 --- a/src/types/aws/ap/index.ts +++ b/src/types/aws/ap/index.ts @@ -1,6 +1,5 @@ import type { Except } from "type-fest"; import type { PartialExcept } from "types/utils"; -import type { Environment } from "vitest"; import type { DonateMethodId, UNSDG_NUMS } from "../../lists"; export type Milestone = { @@ -234,83 +233,3 @@ export type UserAttributes = { }; export type UserUpdate = Partial; - -export interface Fund { - /** uuidv4 */ - id: string; - env: Environment; - name: string; - description: string; - banner: string; - logo: string; - members: Pick[]; - featured: boolean; - active: boolean; - settings: { - allowBgTip: boolean; - }; - /** iso */ - expiration?: string; - verified: boolean; - donation_total_usd: number; - /** "0": no target */ - target: "smart" | `${number}`; - /** endowIds that allows this fundraiser on their profile */ - approvers: number[]; -} -export namespace Fund { - export interface New - extends Pick< - Fund, - | "name" - | "description" - | "banner" - | "logo" - | "featured" - | "settings" - | "expiration" - | "target" - > { - /** endowment ids */ - members: number[]; - } - - export interface Update - extends Partial< - Pick< - Fund, - "name" | "description" | "banner" | "logo" | "featured" | "target" - > - > {} - - export interface Card - extends Pick< - Fund, - | "id" - | "name" - | "description" - | "env" - | "logo" - | "featured" - | "active" - | "verified" - | "donation_total_usd" - | "members" - | "target" - | "approvers" - > { - /** iso | "9999-12-31T23:59:59.000Z" year 9999 */ - expiration: string; - } - - export interface CardsPage { - items: Card[]; - page: number; - numPages: number; - } - - export interface CardsQueryParams { - query?: string; - page?: number; - } -} diff --git a/yarn.lock b/yarn.lock index a7b866cb6c..776b292d36 100644 --- a/yarn.lock +++ b/yarn.lock @@ -822,6 +822,18 @@ __metadata: languageName: node linkType: hard +"@better-giving/fundraiser@npm:1.0.0-rc.5": + version: 1.0.0-rc.5 + resolution: "@better-giving/fundraiser@npm:1.0.0-rc.5" + dependencies: + "@better-giving/types": "npm:1.0.0-rc.2" + valibot: "npm:0.42.0" + peerDependencies: + valibot: 0.42.0 + checksum: 10/1c0c631b618790082cd84516fd3e039bd204847876d31f80eb0c47f44f83e6baba304e52cd7c5326412af7f59aa6e65e8a06d8889b3b4eb1287227dc44300ea7 + languageName: node + linkType: hard + "@better-giving/registration@npm:1.0.24": version: 1.0.24 resolution: "@better-giving/registration@npm:1.0.24" @@ -831,6 +843,15 @@ __metadata: languageName: node linkType: hard +"@better-giving/types@npm:1.0.0-rc.2": + version: 1.0.0-rc.2 + resolution: "@better-giving/types@npm:1.0.0-rc.2" + peerDependencies: + valibot: 0.42.0 + checksum: 10/a4b46d4fb5fce7d21982f636ff922f9a335ab754030142ef731944b8a4e682e0b3c19a133dc9d9e05ad8dbb32e513dcb66e59007393ce7ead474ed8559d36174 + languageName: node + linkType: hard + "@biomejs/biome@npm:1.8.1": version: 1.8.1 resolution: "@biomejs/biome@npm:1.8.1" @@ -3426,7 +3447,9 @@ __metadata: resolution: "angelprotocol-web-app@workspace:." dependencies: "@better-giving/assets": "npm:1.0.18" + "@better-giving/fundraiser": "npm:1.0.0-rc.5" "@better-giving/registration": "npm:1.0.24" + "@better-giving/types": "npm:1.0.0-rc.2" "@biomejs/biome": "npm:1.8.1" "@gsap/react": "npm:2.1.1" "@headlessui/react": "npm:2.1.0" From fa9084ae984e9d89ba6d3c4982304a85791a7ab4 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Sat, 5 Oct 2024 22:59:54 +0800 Subject: [PATCH 42/47] params input str --- package.json | 2 +- yarn.lock | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 18bd37d06f..bc2fee39e0 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "dependencies": { "@better-giving/assets": "1.0.18", - "@better-giving/fundraiser": "1.0.0-rc.5", + "@better-giving/fundraiser": "1.0.0-rc.7", "@better-giving/registration": "1.0.24", "@better-giving/types": "1.0.0-rc.2", "@gsap/react": "2.1.1", diff --git a/yarn.lock b/yarn.lock index 776b292d36..c7d6250de8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -822,15 +822,13 @@ __metadata: languageName: node linkType: hard -"@better-giving/fundraiser@npm:1.0.0-rc.5": - version: 1.0.0-rc.5 - resolution: "@better-giving/fundraiser@npm:1.0.0-rc.5" - dependencies: - "@better-giving/types": "npm:1.0.0-rc.2" - valibot: "npm:0.42.0" +"@better-giving/fundraiser@npm:1.0.0-rc.7": + version: 1.0.0-rc.7 + resolution: "@better-giving/fundraiser@npm:1.0.0-rc.7" peerDependencies: + "@better-giving/types": 1.0.0-rc.2 valibot: 0.42.0 - checksum: 10/1c0c631b618790082cd84516fd3e039bd204847876d31f80eb0c47f44f83e6baba304e52cd7c5326412af7f59aa6e65e8a06d8889b3b4eb1287227dc44300ea7 + checksum: 10/5a27fa324891e330139eb50007ec1cafb242d3502573c5a03e6a29de608623395f5a0bd916b161f5a7eefb362e9d5094971d1cf8faa3fadc00896c4495dad4a5 languageName: node linkType: hard @@ -3447,7 +3445,7 @@ __metadata: resolution: "angelprotocol-web-app@workspace:." dependencies: "@better-giving/assets": "npm:1.0.18" - "@better-giving/fundraiser": "npm:1.0.0-rc.5" + "@better-giving/fundraiser": "npm:1.0.0-rc.7" "@better-giving/registration": "npm:1.0.24" "@better-giving/types": "npm:1.0.0-rc.2" "@biomejs/biome": "npm:1.8.1" From abba679739fa475eabe6ee22e6b235c5787959c2 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Sat, 5 Oct 2024 23:13:46 +0800 Subject: [PATCH 43/47] dummy file obj --- src/pages/Funds/CreateFund/schema.ts | 12 +++++++----- src/pages/Funds/EditFund/schema.ts | 7 ++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/pages/Funds/CreateFund/schema.ts b/src/pages/Funds/CreateFund/schema.ts index 9354e386d8..dd9a86bca1 100644 --- a/src/pages/Funds/CreateFund/schema.ts +++ b/src/pages/Funds/CreateFund/schema.ts @@ -3,9 +3,10 @@ import { MAX_SIZE_IN_BYTES, VALID_MIME_TYPES, target } from "../common"; const str = v.pipe(v.string(), v.trim()); +/** not set by user */ const fileObject = v.object({ name: str, - publicUrl: v.pipe(str, v.url()), + publicUrl: str, }); export const imgLink = v.object({ @@ -44,10 +45,11 @@ export const schema = v.object({ v.lazy((val) => { if (!val) return v.string(); return v.pipe( - v.string(), - v.transform((val) => val && new Date(val).toISOString()), - v.isoTimestamp("invalid date"), - v.minValue(new Date().toISOString(), "must be in the future") + str, + v.transform((val) => new Date(val)), + v.date("invalid date"), + v.minValue(new Date(), "must be in the future"), + v.transform((val) => val.toISOString()) ); }) ), diff --git a/src/pages/Funds/EditFund/schema.ts b/src/pages/Funds/EditFund/schema.ts index df00985a79..123e3e8323 100644 --- a/src/pages/Funds/EditFund/schema.ts +++ b/src/pages/Funds/EditFund/schema.ts @@ -1,9 +1,14 @@ -import { fileObject } from "@better-giving/types"; import * as v from "valibot"; import { MAX_SIZE_IN_BYTES, VALID_MIME_TYPES, target } from "../common"; const str = v.pipe(v.string(), v.trim()); +/** not set by user */ +const fileObject = v.object({ + name: str, + publicUrl: str, +}); + export const imgLink = v.object({ file: v.optional( v.pipe( From 9f2f6e2a1a1e319ee93576dc8aa70ec19d22ae50 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Sun, 6 Oct 2024 14:23:57 +0800 Subject: [PATCH 44/47] endow actions --- src/pages/Admin/Charity/Funds/FundItem.tsx | 39 ++++++++++++++++++++ src/pages/Admin/Charity/Funds/Funds.tsx | 43 +--------------------- src/pages/UserDashboard/Funds/Fund.tsx | 30 +++++++++++++++ src/pages/UserDashboard/Funds/Funds.tsx | 32 +--------------- src/services/aws/aws.ts | 12 +----- src/services/aws/endow-funds.ts | 35 ++++++++++++++++++ 6 files changed, 109 insertions(+), 82 deletions(-) create mode 100644 src/pages/Admin/Charity/Funds/FundItem.tsx create mode 100644 src/pages/UserDashboard/Funds/Fund.tsx create mode 100644 src/services/aws/endow-funds.ts diff --git a/src/pages/Admin/Charity/Funds/FundItem.tsx b/src/pages/Admin/Charity/Funds/FundItem.tsx new file mode 100644 index 0000000000..a046bb9631 --- /dev/null +++ b/src/pages/Admin/Charity/Funds/FundItem.tsx @@ -0,0 +1,39 @@ +import type { FundItem as TFundItem } from "@better-giving/fundraiser"; +import { appRoutes } from "constants/routes"; +import { useAuthenticatedUser } from "contexts/Auth"; +import { Link } from "react-router-dom"; + +export const FundItem = (props: TFundItem) => { + const user = useAuthenticatedUser(); + const isActive = new Date().toISOString() <= props.expiration && props.active; + const isEditor = user.funds.includes(props.id); + + return ( +
+ + {props.name} +

+ {isActive ? "active" : "closed"} +

+ + edit + + + view + +
+ ); +}; diff --git a/src/pages/Admin/Charity/Funds/Funds.tsx b/src/pages/Admin/Charity/Funds/Funds.tsx index 66fcbfe32f..839dff60c3 100644 --- a/src/pages/Admin/Charity/Funds/Funds.tsx +++ b/src/pages/Admin/Charity/Funds/Funds.tsx @@ -1,12 +1,8 @@ -import type { FundItem as TFundItem } from "@better-giving/fundraiser"; import ContentLoader from "components/ContentLoader"; -import Image from "components/Image"; import QueryLoader from "components/QueryLoader"; -import { appRoutes } from "constants/routes"; -import { useAuthenticatedUser } from "contexts/Auth"; -import { Link } from "react-router-dom"; -import { useFundsEndowMemberOfQuery } from "services/aws/aws"; +import { useFundsEndowMemberOfQuery } from "services/aws/endow-funds"; import { useAdminContext } from "../../Context"; +import { FundItem } from "./FundItem"; export function Funds() { const { id } = useAdminContext(); @@ -41,41 +37,6 @@ export function Funds() { ); } -const FundItem = (props: TFundItem) => { - const user = useAuthenticatedUser(); - const isActive = new Date().toISOString() <= props.expiration && props.active; - const isEditor = user.funds.includes(props.id); - - return ( -
- - {props.name} -

- {isActive ? "active" : "closed"} -

- - edit - - - view - -
- ); -}; - export function Skeleton() { return (
( +
+ + {props.name} +

+ {props.active ? "active" : "closed"} +

+ + edit + + + view + +
+); diff --git a/src/pages/UserDashboard/Funds/Funds.tsx b/src/pages/UserDashboard/Funds/Funds.tsx index cce70aa63e..6fa8c26122 100644 --- a/src/pages/UserDashboard/Funds/Funds.tsx +++ b/src/pages/UserDashboard/Funds/Funds.tsx @@ -1,11 +1,8 @@ import ContentLoader from "components/ContentLoader"; -import Image from "components/Image"; import QueryLoader from "components/QueryLoader"; -import { appRoutes } from "constants/routes"; import { useAuthenticatedUser } from "contexts/Auth"; -import { Link } from "react-router-dom"; import { useUserFundsQuery } from "services/aws/users"; -import type { UserFund } from "types/aws"; +import { Fund } from "./Fund"; export function Funds() { const user = useAuthenticatedUser(); @@ -40,33 +37,6 @@ export function Funds() { ); } -const Fund = (props: UserFund) => ( -
- - {props.name} -

- {props.active ? "active" : "closed"} -

- - edit - - - view - -
-); - export function Skeleton() { return (
({ - providesTags: ["endowment"], - query: ({ endowId }) => { - return { - url: `${v(8)}/endowments/${endowId}/funds`, - }; - }, - }), + endowment: builder.query< Endowment, IdOrSlug & { fields?: (keyof Endowment)[] } @@ -256,7 +249,6 @@ export const { useDonationsQuery, useLazyDonationsQuery, useLazyEndowWithEinQuery, - useFundsEndowMemberOfQuery, endpoints: { endowmentCards: { useLazyQuery: useLazyEndowmentCardsQuery }, endowmentOptions: { useLazyQuery: useLazyEndowmentOptionsQuery }, diff --git a/src/services/aws/endow-funds.ts b/src/services/aws/endow-funds.ts new file mode 100644 index 0000000000..3976eabdab --- /dev/null +++ b/src/services/aws/endow-funds.ts @@ -0,0 +1,35 @@ +import type { FundItem } from "@better-giving/fundraiser"; +import { version as v } from "../helpers"; +import { aws } from "./aws"; + +export const { useFundsEndowMemberOfQuery, useOptOutMutation } = + aws.injectEndpoints({ + endpoints: (builder) => ({ + fundsEndowMemberOf: builder.query({ + providesTags: ["endow-funds"], + query: ({ endowId }) => { + return { + url: `${v(8)}/endowments/${endowId}/funds`, + }; + }, + }), + optOut: builder.mutation({ + invalidatesTags: ["endow-funds"], + query: (fundId) => { + return { + url: `${v(1)}/funds/${fundId}/opt-out`, + method: "POST", + }; + }, + }), + approve: builder.mutation({ + invalidatesTags: ["endow-funds"], + query: (fundId) => { + return { + url: `${v(1)}/funds/${fundId}/approve`, + method: "POST", + }; + }, + }), + }), + }); From 2d381cf21ecda3bfdf87efa21795ecc7a57b6665 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Sun, 6 Oct 2024 20:50:44 +0800 Subject: [PATCH 45/47] npo actions --- src/pages/Admin/Charity/Funds/FundItem.tsx | 21 ++++++++++++++++++++- src/pages/Admin/Charity/Funds/Funds.tsx | 2 +- src/services/aws/endow-funds.ts | 19 +++++++++++++------ 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/pages/Admin/Charity/Funds/FundItem.tsx b/src/pages/Admin/Charity/Funds/FundItem.tsx index a046bb9631..d7a60dbb79 100644 --- a/src/pages/Admin/Charity/Funds/FundItem.tsx +++ b/src/pages/Admin/Charity/Funds/FundItem.tsx @@ -1,12 +1,16 @@ import type { FundItem as TFundItem } from "@better-giving/fundraiser"; import { appRoutes } from "constants/routes"; import { useAuthenticatedUser } from "contexts/Auth"; +import { useErrorContext } from "contexts/ErrorContext"; import { Link } from "react-router-dom"; +import { useOptOutMutation } from "services/aws/endow-funds"; -export const FundItem = (props: TFundItem) => { +export const FundItem = (props: TFundItem & { endowId: number }) => { const user = useAuthenticatedUser(); const isActive = new Date().toISOString() <= props.expiration && props.active; const isEditor = user.funds.includes(props.id); + const [optOut, { isLoading: isOptingOut }] = useOptOutMutation(); + const { handleError } = useErrorContext(); return (
@@ -34,6 +38,21 @@ export const FundItem = (props: TFundItem) => { > view + {/** show only when this endow is member of fund */} +
); }; diff --git a/src/pages/Admin/Charity/Funds/Funds.tsx b/src/pages/Admin/Charity/Funds/Funds.tsx index 839dff60c3..7d8e85fad6 100644 --- a/src/pages/Admin/Charity/Funds/Funds.tsx +++ b/src/pages/Admin/Charity/Funds/Funds.tsx @@ -28,7 +28,7 @@ export function Funds() { {(funds) => ( <> {funds.map((fund) => ( - + ))} )} diff --git a/src/services/aws/endow-funds.ts b/src/services/aws/endow-funds.ts index 3976eabdab..977faf17f8 100644 --- a/src/services/aws/endow-funds.ts +++ b/src/services/aws/endow-funds.ts @@ -1,7 +1,12 @@ import type { FundItem } from "@better-giving/fundraiser"; +import { TEMP_JWT } from "constants/auth"; import { version as v } from "../helpers"; import { aws } from "./aws"; +interface PathParams { + endowId: number; + fundId: string; +} export const { useFundsEndowMemberOfQuery, useOptOutMutation } = aws.injectEndpoints({ endpoints: (builder) => ({ @@ -13,21 +18,23 @@ export const { useFundsEndowMemberOfQuery, useOptOutMutation } = }; }, }), - optOut: builder.mutation({ + optOut: builder.mutation({ invalidatesTags: ["endow-funds"], - query: (fundId) => { + query: ({ fundId, endowId }) => { return { - url: `${v(1)}/funds/${fundId}/opt-out`, + url: `${v(8)}/endowments/${endowId}/funds/${fundId}/opt-out`, method: "POST", + headers: { authorization: TEMP_JWT }, }; }, }), - approve: builder.mutation({ + approve: builder.mutation({ invalidatesTags: ["endow-funds"], - query: (fundId) => { + query: ({ fundId, endowId }) => { return { - url: `${v(1)}/funds/${fundId}/approve`, + url: `${v(8)}/endowments/${endowId}/funds/${fundId}/approve`, method: "POST", + headers: { authorization: TEMP_JWT }, }; }, }), From f8f7b7d8d373c6427b34aa07b2098786b5444b97 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:02:15 +0800 Subject: [PATCH 46/47] approval prompts --- src/components/Icon/icons.ts | 2 + src/pages/Admin/Charity/Funds/FundItem.tsx | 140 +++++++++++++++------ src/pages/Admin/Charity/Funds/Funds.tsx | 2 +- src/services/aws/endow-funds.ts | 67 +++++----- 4 files changed, 141 insertions(+), 70 deletions(-) diff --git a/src/components/Icon/icons.ts b/src/components/Icon/icons.ts index 223263b370..ece824936d 100644 --- a/src/components/Icon/icons.ts +++ b/src/components/Icon/icons.ts @@ -56,6 +56,7 @@ import { Search, Settings, Shield, + Split, Sprout, SquareArrowOutUpRight, Star, @@ -130,6 +131,7 @@ export const icons = { Save: Save, Search, SecurityScan: Shield, + Split, Sprout, Star, StickyNote, diff --git a/src/pages/Admin/Charity/Funds/FundItem.tsx b/src/pages/Admin/Charity/Funds/FundItem.tsx index d7a60dbb79..b31486709f 100644 --- a/src/pages/Admin/Charity/Funds/FundItem.tsx +++ b/src/pages/Admin/Charity/Funds/FundItem.tsx @@ -1,58 +1,124 @@ import type { FundItem as TFundItem } from "@better-giving/fundraiser"; +import Icon from "components/Icon"; +import Prompt from "components/Prompt"; import { appRoutes } from "constants/routes"; import { useAuthenticatedUser } from "contexts/Auth"; import { useErrorContext } from "contexts/ErrorContext"; +import { useModalContext } from "contexts/ModalContext"; import { Link } from "react-router-dom"; -import { useOptOutMutation } from "services/aws/endow-funds"; +import { + useApproveMutation, + useOptOutMutation, +} from "services/aws/endow-funds"; export const FundItem = (props: TFundItem & { endowId: number }) => { const user = useAuthenticatedUser(); const isActive = new Date().toISOString() <= props.expiration && props.active; const isEditor = user.funds.includes(props.id); const [optOut, { isLoading: isOptingOut }] = useOptOutMutation(); + const [approve, { isLoading: isApproving }] = useApproveMutation(); + const { showModal } = useModalContext(); const { handleError } = useErrorContext(); + const isApproved = props.approvers.includes(props.endowId); + return ( -
- - {props.name} -

- {isActive ? "active" : "closed"} -

- - edit - +
+ - view + {props.name} + + + {isActive ? "active" : "closed"} + - {/** show only when this endow is member of fund */} - + +
+ + + Edit + + {/** fund item won't show once NPO opted out of it: so no need to hide this button */} + + {!isApproved ? ( + + ) : ( +
+ +

Approved

+
+ )} +
); }; diff --git a/src/pages/Admin/Charity/Funds/Funds.tsx b/src/pages/Admin/Charity/Funds/Funds.tsx index 7d8e85fad6..10dc2e1831 100644 --- a/src/pages/Admin/Charity/Funds/Funds.tsx +++ b/src/pages/Admin/Charity/Funds/Funds.tsx @@ -8,7 +8,7 @@ export function Funds() { const { id } = useAdminContext(); const query = useFundsEndowMemberOfQuery({ endowId: id }); return ( -
+

My Fundraisers

({ - fundsEndowMemberOf: builder.query({ - providesTags: ["endow-funds"], - query: ({ endowId }) => { - return { - url: `${v(8)}/endowments/${endowId}/funds`, - }; - }, - }), - optOut: builder.mutation({ - invalidatesTags: ["endow-funds"], - query: ({ fundId, endowId }) => { - return { - url: `${v(8)}/endowments/${endowId}/funds/${fundId}/opt-out`, - method: "POST", - headers: { authorization: TEMP_JWT }, - }; - }, - }), - approve: builder.mutation({ - invalidatesTags: ["endow-funds"], - query: ({ fundId, endowId }) => { - return { - url: `${v(8)}/endowments/${endowId}/funds/${fundId}/approve`, - method: "POST", - headers: { authorization: TEMP_JWT }, - }; - }, - }), +export const { + useFundsEndowMemberOfQuery, + useOptOutMutation, + useApproveMutation, +} = aws.injectEndpoints({ + endpoints: (builder) => ({ + fundsEndowMemberOf: builder.query({ + providesTags: ["endow-funds"], + query: ({ endowId }) => { + return { + url: `${v(8)}/endowments/${endowId}/funds`, + }; + }, }), - }); + optOut: builder.mutation({ + invalidatesTags: ["endow-funds"], + query: ({ fundId, endowId }) => { + return { + url: `${v(8)}/endowments/${endowId}/funds/${fundId}/opt-out`, + method: "POST", + headers: { authorization: TEMP_JWT }, + }; + }, + }), + approve: builder.mutation({ + invalidatesTags: ["endow-funds"], + query: ({ fundId, endowId }) => { + return { + url: `${v(8)}/endowments/${endowId}/funds/${fundId}/approve`, + method: "POST", + headers: { authorization: TEMP_JWT }, + }; + }, + }), + }), +}); From 9a17cfe90951d8e7573a28d065527a5c5ff8ff82 Mon Sep 17 00:00:00 2001 From: ap-justin <89639563+ap-justin@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:20:35 +0800 Subject: [PATCH 47/47] use subgrid --- src/pages/Funds/Cards/Card.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/Funds/Cards/Card.tsx b/src/pages/Funds/Cards/Card.tsx index 1fcadfe37c..fb0b8a60ca 100644 --- a/src/pages/Funds/Cards/Card.tsx +++ b/src/pages/Funds/Cards/Card.tsx @@ -16,10 +16,10 @@ export default function Card({ target, }: FundItem) { return ( -
+
e.currentTarget.classList.add("bg-blue-l3")} /> -
+
{/* nonprofit NAME */}

{verified && ( @@ -39,7 +39,7 @@ export default function Card({ {name}

-

+

{description}