This commit is contained in:
Kenneth Jannette
2024-01-19 19:51:26 -06:00
parent 74606afc72
commit 39852a5915
2 changed files with 31 additions and 34 deletions

View File

@@ -20,38 +20,6 @@ const PaymentModal = ({
}) => { }) => {
const fieldsChunkSize = 2; const fieldsChunkSize = 2;
const ModalForm = () => {
return splitEvery(Object.keys(paymentfields), fieldsChunkSize).map(
(names, j) => (
<Row key={`row${j}-modal`}>
{names.map((name, i) => (
<Col
key={`${name}${i + fieldsChunkSize * j}-modal`}
className="mb-3"
>
<TextInput
key={`${name}-modal-input`}
name={name}
value={paymentData[name].value}
onChange={(e) => handleChangePaymentInput(e, name)}
error={paymentData[name].error}
message={paymentData[name].message}
label={
paymentData[name].value.length === 0
? paymentfields[name].label
: ""
}
type={paymentfields[name].type}
values={paymentfields[name].values}
disabled={isBusy}
/>
</Col>
))}
</Row>
)
);
};
return ( return (
<Modal show="true" size="lg"> <Modal show="true" size="lg">
<Modal.Header closeButton> <Modal.Header closeButton>
@@ -60,7 +28,35 @@ const PaymentModal = ({
<Modal.Body> <Modal.Body>
<div className="payment-modal-text-wrapper">{modalText}</div> <div className="payment-modal-text-wrapper">{modalText}</div>
<Form className="payment-form"> <Form className="payment-form">
<ModalForm /> {splitEvery(Object.keys(paymentfields), fieldsChunkSize).map(
(names, j) => (
<Row key={`row${j}-modal`}>
{names.map((name, i) => (
<Col
key={`${name}${i + fieldsChunkSize * j}-modal`}
className="mb-3"
>
<TextInput
key={`${name}-modal-input`}
name={name}
value={paymentData[name].value}
onChange={(e) => handleChangePaymentInput(e, name)}
error={paymentData[name].error}
message={paymentData[name].message}
label={
paymentData[name].value.length === 0
? paymentfields[name].label
: ""
}
type={paymentfields[name].type}
values={paymentfields[name].values}
disabled={isBusy}
/>
</Col>
))}
</Row>
)
)}
</Form> </Form>
</Modal.Body> </Modal.Body>
<Modal.Footer> <Modal.Footer>

View File

@@ -116,11 +116,12 @@ const SignupPage = () => {
if (isBusy) { if (isBusy) {
return; return;
} }
/*
const dataValues = validateData(); const dataValues = validateData();
if (dataValues === null) { if (dataValues === null) {
return; return;
} }
*/
setShowPaymentModal(true); setShowPaymentModal(true);
}; };