Skip to content

Conversation

@markulrich
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Sep 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
donate-button Ready Ready Preview Sep 24, 2025 8:29pm

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The granteeName field should be typed as string rather than boolean since it's used to return a name value in the getGranteeName function.

Suggested change
granteeName?: boolean;
granteeName?: string;

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +10
if (nonprofit.metadata?.granteeName) {
return nonprofit.metadata?.granteeName;
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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;

Copilot uses AI. Check for mistakes.
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 || "";
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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."
: "";
}

Copilot uses AI. Check for mistakes.
@markulrich markulrich merged commit fe3f644 into main Sep 25, 2025
6 checks passed
@markulrich markulrich deleted the mu/up-tax-ded branch September 25, 2025 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants