feat(tip): support tiered coffee gifts
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { usePaymentLaunchFlow } from "@/app/_hooks/use-payment-launch-flow";
|
||||
import { ROUTES } from "@/router/routes";
|
||||
import type { TipCoffeeType } from "@/lib/tip/tip_coffee";
|
||||
import {
|
||||
usePaymentDispatch,
|
||||
usePaymentState,
|
||||
@@ -15,15 +15,19 @@ import styles from "./tip-screen.module.css";
|
||||
const log = new Logger("TipCheckoutButton");
|
||||
|
||||
export interface TipCheckoutButtonProps {
|
||||
coffeeType: TipCoffeeType;
|
||||
disabled?: boolean;
|
||||
isAuthLoading?: boolean;
|
||||
onOrder: () => void;
|
||||
returnPath: string;
|
||||
}
|
||||
|
||||
export function TipCheckoutButton({
|
||||
coffeeType,
|
||||
disabled = false,
|
||||
isAuthLoading = false,
|
||||
onOrder,
|
||||
returnPath,
|
||||
}: TipCheckoutButtonProps) {
|
||||
const payment = usePaymentState();
|
||||
const paymentDispatch = usePaymentDispatch();
|
||||
@@ -33,6 +37,7 @@ export function TipCheckoutButton({
|
||||
payment,
|
||||
paymentDispatch,
|
||||
subscriptionType: "tip",
|
||||
tipCoffeeType: coffeeType,
|
||||
});
|
||||
|
||||
const isLoading =
|
||||
@@ -71,7 +76,7 @@ export function TipCheckoutButton({
|
||||
{paymentLaunch.shouldShowStripeDialog && paymentLaunch.stripeClientSecret ? (
|
||||
<StripePaymentDialog
|
||||
clientSecret={paymentLaunch.stripeClientSecret}
|
||||
returnPath={ROUTES.tip}
|
||||
returnPath={returnPath}
|
||||
onClose={paymentLaunch.handleStripeClose}
|
||||
onConfirmed={paymentLaunch.handleStripeConfirmed}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user