Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the product pricing widget (#167)
* feat: add the product pricing widget * feat: basic redemption pass for "golden ticket" * feat: purchase lifecycle send emails * chore minor fixes * add changeset * run format * chore type fixes * chore: update dependencies * chore: update dependencies * chore: appease a test apparently it's picky about the syntax of the es target in ts config of projects it depends on 馃 * feat: include invoice link when a merchantChargeId is passed to email template * email style tweaks * adds email login for coursebuilder * fix: build * update lock
- Loading branch information
Showing
81 changed files
with
4,460 additions
and
4,106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
"@coursebuilder/eslint-plugin": patch | ||
"@coursebuilder/adapter-drizzle": patch | ||
"@coursebuilder/email-templates": patch | ||
"@coursebuilder/tsup-config": patch | ||
"@coursebuilder/react-rsc": patch | ||
"utils": patch | ||
"@coursebuilder/core": patch | ||
"create-course-app": patch | ||
--- | ||
|
||
redemptions and purchase recording with an email at the end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
apps/course-builder-web/src/app/(commerce)/products/[slug]/_components/product-pricing.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use client' | ||
|
||
import * as React from 'react' | ||
import { PricingData } from '@/lib/pricing-query' | ||
import { CommerceProps } from '@/pricing/commerce-props' | ||
import { PriceCheckProvider } from '@/pricing/pricing-check-context' | ||
import { PricingWidget } from '@/pricing/pricing-widget' | ||
|
||
export function ProductPricing({ | ||
product, | ||
quantityAvailable, | ||
pricingDataLoader, | ||
commerceProps, | ||
purchasedProductIds, | ||
hasPurchasedCurrentProduct, | ||
}: { | ||
product: any | ||
quantityAvailable: number | ||
commerceProps: CommerceProps | ||
pricingDataLoader: Promise<PricingData> | ||
purchasedProductIds: string[] | ||
hasPurchasedCurrentProduct?: boolean | ||
}) { | ||
console.log({ product, quantityAvailable, commerceProps, pricingDataLoader }) | ||
return ( | ||
<> | ||
{product && ( | ||
<PriceCheckProvider purchasedProductIds={purchasedProductIds}> | ||
<PricingWidget | ||
commerceProps={{ ...commerceProps, products: [product] }} | ||
product={product} | ||
quantityAvailable={quantityAvailable} | ||
pricingDataLoader={pricingDataLoader} | ||
/> | ||
</PriceCheckProvider> | ||
)} | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.