Skip to content

Commit

Permalink
Adds extra logic to CheckoutButton
Browse files Browse the repository at this point in the history
  • Loading branch information
lmac-1 committed Feb 21, 2023
1 parent 5f20a5a commit 949fe39
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions components/CheckoutButton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { useState } from "react";

export default function CheckoutButton() {
const [status, setStatus] = useState("idle");

return (
<button className="bg-emerald-50 mt-3 hover:bg-emerald-500 hover:text-white transition-colors duration-500 text-emerald-500 py-3 px-5 rounded-md w-100">
Proceed to checkout
</button>
<article className="mt-3 flex flex-col">
{/* <div className="text-red-700 text-xs mb-3 h-5 text-center">
Unable to connect to Stripe Checkout
</div> */}
<button className="bg-emerald-50 hover:bg-emerald-500 hover:text-white transition-colors duration-500 text-emerald-500 py-3 px-5 rounded-md w-100">
{status !== "loading" ? "Proceed to checkout" : "Loading..."}
</button>
</article>
);
}

1 comment on commit 949fe39

@vercel
Copy link

@vercel vercel bot commented on 949fe39 Feb 23, 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.