Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function OnchainCheckout() {
incrementQuantity,
decrementQuantity,
onOnchainPurchase,
onSendDeposit,
//onSendDeposit,
} = useOnchainPurchaseContext();

const [isLoading, setIsLoading] = useState(false);
Expand Down Expand Up @@ -195,16 +195,26 @@ export function OnchainCheckout() {

<QuantityControls
quantity={quantity}
isLoading={isLoading}
isSendingDeposit={isSendingDeposit}
globalDisabled={globalDisabled}
hasSufficientBalance={hasSufficientBalance}
bridgeFrom={bridgeFrom}
onIncrement={incrementQuantity}
onDecrement={decrementQuantity}
onPurchase={handlePurchase}
onBridge={onSendDeposit}
/>
>
<iframe
src="https://pay.coinbase.com/v2/api-onramp/apple-pay?sessionToken=MWYwZDc4YzYtYzRjOC02NzNlLWFiOWQtNmEyMzg1ODBlYzg2&useApplePaySandbox=true"
className="w-full h-12 border-0"
allow="payment"
/>
{/* <Button
className="w-full"
isLoading={isLoading || isSendingDeposit}
disabled={globalDisabled}
onClick={bridgeFrom !== null ? onSendDeposit : handlePurchase}
>
{bridgeFrom ? "Bridge" : `Buy ${quantity}`}
</Button> */}
Copy link

Choose a reason for hiding this comment

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

Bug: Purchase and bridge functionality completely disabled by comment

The main purchase/bridge Button component is commented out, leaving users unable to complete purchases or bridge operations. The test iframe replaces the actual functional button, breaking the core checkout flow. This appears to be unfinished test code that was accidentally committed before being production-ready.

Fix in Cursor Fix in Web

</QuantityControls>
</>
)}
</LayoutFooter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
import { Button, MinusIcon, PlusIcon } from "@cartridge/ui";
import { ReactNode } from "react";

interface QuantityControlsProps {
quantity: number;
isLoading: boolean;
isSendingDeposit: boolean;
globalDisabled: boolean;
hasSufficientBalance: boolean;
bridgeFrom: string | null;
onIncrement: () => void;
onDecrement: () => void;
onPurchase: () => void;
onBridge: () => void;
children: ReactNode;
}

export function QuantityControls({
quantity,
isLoading,
isSendingDeposit,
globalDisabled,
hasSufficientBalance,
bridgeFrom,
onIncrement,
onDecrement,
onPurchase,
onBridge,
children,
}: QuantityControlsProps) {
const purchaseLabel = bridgeFrom ? "Bridge" : `Buy ${quantity}`;
const isQuantityDisabled =
(globalDisabled && hasSufficientBalance) || isSendingDeposit;

Expand All @@ -45,14 +39,7 @@ export function QuantityControls({
>
<PlusIcon size="xs" variant="solid" />
</Button>
<Button
className="w-full"
isLoading={isLoading || isSendingDeposit}
disabled={globalDisabled}
onClick={bridgeFrom !== null ? onBridge : onPurchase}
>
{purchaseLabel}
</Button>
{children}
</div>
);
}
Loading