Ajout du nom dans le UI

This commit is contained in:
Victor Turgeon
2022-12-08 18:25:49 -05:00
parent 7f252bc030
commit a8c62a86ab
3 changed files with 21 additions and 4 deletions

View File

@@ -27,6 +27,7 @@ const CARD_OPTIONS = {
const PaymentForm = ({ cost }) => {
const [success, setSuccess] = useState(false);
const [cardName, setCardName] = useState("");
const stripe = useStripe();
const elements = useElements();
@@ -82,6 +83,7 @@ const PaymentForm = ({ cost }) => {
{!success ?
<form onSubmit={handleSubmit}>
<fieldset className="FormGroup">
<input className="FormRow" placeholder="Cardholder Name" id="cardholder-name" type="text" value={cardName} onChange={e => setCardName(e.target.value)} />
<div className="FormRow">
<CardElement options={CARD_OPTIONS} />
</div>