feat: Add user email to StripePricingOrManageButton and UpgradeToPlusButton components (#2951)

# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
This commit is contained in:
Stan Girard 2024-08-07 10:41:04 +02:00 committed by GitHub
parent 13e9fc490b
commit acf0e1db1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 2 deletions

View File

@ -39,6 +39,7 @@ export const StripePricingOrManageButton = ({
></QuivrButton>
</div>
}
user_email={userData?.email ?? ""}
/>
);
};

View File

@ -23,6 +23,7 @@ export const UpgradeToPlusButton = (): JSX.Element => {
color="gold"
/>
}
user_email={userData?.email ?? ""}
/>
);
};

View File

@ -4,14 +4,16 @@ import { Modal } from "../../ui/Modal/Modal";
type StripePricingModalProps = {
Trigger: JSX.Element;
user_email: string;
};
export const StripePricingModal = ({
Trigger,
user_email,
}: StripePricingModalProps): JSX.Element => {
return (
<Modal Trigger={Trigger} CloseTrigger={<div />} unforceWhite={true}>
<StripePricingTable />
<StripePricingTable user_email={user_email} />
</Modal>
);
};

View File

@ -5,7 +5,7 @@ import styles from "./PricingTable.module.scss";
const PRICING_TABLE_ID = process.env.NEXT_PUBLIC_STRIPE_PRICING_TABLE_ID;
const PUBLISHABLE_KEY = process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY;
export const StripePricingTable = (): JSX.Element => {
export const StripePricingTable = ({ user_email }: { user_email: string }): JSX.Element => {
return (
<>
<div className={styles.info_content}>
@ -26,6 +26,7 @@ export const StripePricingTable = (): JSX.Element => {
<stripe-pricing-table
pricing-table-id={PRICING_TABLE_ID}
publishable-key={PUBLISHABLE_KEY}
customer-email={user_email}
></stripe-pricing-table>
</div>
</>