Skip to content

Commit

Permalink
Add support for metadata.prefixWithThe (#371)
Browse files Browse the repository at this point in the history
* add_support_prefix_with_the

* requested_changes
  • Loading branch information
OlegKrav64 authored Oct 16, 2023
1 parent afbc2c2 commit 9928400
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import {faqLinkCss} from 'src/components/widget/components/Faq/styles';
import {Nonprofit} from 'src/components/widget/types/Nonprofit';
import {PaymentMethod} from 'src/components/widget/types/PaymentMethod';

export function getNonprofitName(nonprofit: Nonprofit) {
return nonprofit.metadata?.prefixWithThe
? `the ${nonprofit.name}`
: nonprofit.name;
}

export function getDisbursementDescription(nonprofit: Nonprofit) {
if (nonprofit.directDisbursement) {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {FunctionalComponent, VNode} from 'preact';
import {useState} from 'preact/hooks';
import {Fragment} from 'preact/jsx-runtime';
import {getFeeDescription} from 'src/components/widget/components/Faq/helpers';
import {
getFeeDescription,
getNonprofitName
} from 'src/components/widget/components/Faq/helpers';
import {
faqItemConateinerCss,
faqItemButtonCss,
Expand Down Expand Up @@ -69,12 +72,12 @@ export const Faq = () => {
<p>
Your donation is made to Every.org, a US 501(c)(3) public charity.
Every.org will immediately send you a receipt by email. On a weekly
basis, Every.org sends funds to {nonprofit.name}.
basis, Every.org sends funds to {getNonprofitName(nonprofit)}.
</p>
<p>
This process ensures your eligibility for a tax-deduction, enables
you to consolidate your gift records, and reduces the burden on{' '}
{nonprofit.name}.
{getNonprofitName(nonprofit)}.
</p>
</Fragment>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {getNonprofitName} from 'src/components/widget/components/Faq/helpers';
import {Fundraiser} from 'src/components/widget/types/Fundraiser';
import {Nonprofit} from 'src/components/widget/types/Nonprofit';

Expand All @@ -11,8 +12,12 @@ export const getTaxDeductibleStatement = (
) => {
const base = `100% of your donation is tax-deductible to the extent allowed by US law.
Your donation is made to Every.org, a tax-exempt US 501(c)(3) charity that
grants unrestricted funds to ${nonprofit.name} on your behalf.
As a legal matter, Every.org must provide any donations to ${nonprofit.name} on an
grants unrestricted funds to ${getNonprofitName(
nonprofit
)} on your behalf.
As a legal matter, Every.org must provide any donations to ${getNonprofitName(
nonprofit
)} on an
unrestricted basis, regardless of any designations or restrictions made by
you.`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface Nonprofit {
nteeCode: string | null;
metadata?: {
disablePrivateNotes?: boolean;
prefixWithThe?: boolean;
};
}

Expand Down

1 comment on commit 9928400

@vercel
Copy link

@vercel vercel bot commented on 9928400 Oct 16, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.