Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull Request Overview
This pull request updates the tax-deductible statement language in the donate widget footer to match the main site's language and adds support for customizable tax deductible statements.
- Updates tax deductible statement language to be consistent with main site
- Adds support for DAF (Donor Advised Fund) specific messaging
- Introduces custom tax deductible statement functionality
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Nonprofit.ts | Adds new metadata fields for custom tax deductible statements and grantee names |
| helpers.tsx | Updates tax deductible statement logic with DAF support and custom messaging capabilities |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| metadata?: { | ||
| customTaxDeductible?: boolean; | ||
| disablePrivateNotes?: boolean; | ||
| granteeName?: boolean; |
There was a problem hiding this comment.
The granteeName field should be typed as string rather than boolean since it's used to return a name value in the getGranteeName function.
| granteeName?: boolean; | |
| granteeName?: string; |
| if (nonprofit.metadata?.granteeName) { | ||
| return nonprofit.metadata?.granteeName; |
There was a problem hiding this comment.
This code expects granteeName to be a string value to return, but the type definition shows it as a boolean. This will cause incorrect behavior when the field is true but no actual name is provided.
| if (nonprofit.metadata?.granteeName) { | |
| return nonprofit.metadata?.granteeName; | |
| // Only return granteeName if it is a non-empty string | |
| if (typeof nonprofit.metadata?.granteeName === 'string' && nonprofit.metadata?.granteeName.trim() !== '') { | |
| return nonprofit.metadata.granteeName; |
| noPermission = `Please note ${nonprofitNameWithVerb} not provided permission for this solicitation or reviewed or approved the content of this peer-to-peer fundraiser.`; | ||
| } | ||
|
|
||
| const customTaxDeductible = nonprofit.metadata?.customTaxDeductible || ""; |
There was a problem hiding this comment.
The customTaxDeductible field is typed as boolean but used as a string here. Consider changing the type to string or handle the boolean value appropriately.
| const customTaxDeductible = nonprofit.metadata?.customTaxDeductible || ""; | |
| let customTaxDeductible = ""; | |
| if (typeof nonprofit.metadata?.customTaxDeductible === "string") { | |
| customTaxDeductible = nonprofit.metadata.customTaxDeductible; | |
| } else if (typeof nonprofit.metadata?.customTaxDeductible === "boolean") { | |
| // If true, show a default message; if false, show nothing | |
| customTaxDeductible = nonprofit.metadata.customTaxDeductible | |
| ? "This donation is tax-deductible." | |
| : ""; | |
| } |
No description provided.