@@ -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>
|
||||||
@@ -82,7 +78,3 @@ const PaymentModal = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default PaymentModal;
|
export default PaymentModal;
|
||||||
|
|
||||||
/*
|
|
||||||
onHide={onCancel}
|
|
||||||
*/
|
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ const SignupPage = () => {
|
|||||||
if (isBusy) {
|
if (isBusy) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataValues = validateData();
|
const dataValues = validateData();
|
||||||
if (dataValues === null) {
|
if (dataValues === null) {
|
||||||
return;
|
return;
|
||||||
@@ -136,10 +137,12 @@ const SignupPage = () => {
|
|||||||
if (paymentDataValues === null) {
|
if (paymentDataValues === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataValues = validateData();
|
const dataValues = validateData();
|
||||||
if (dataValues === null) {
|
if (dataValues === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIsBusy(true);
|
setIsBusy(true);
|
||||||
const paymentSuccess = handleStripeAuthorization(paymentDataValues);
|
const paymentSuccess = handleStripeAuthorization(paymentDataValues);
|
||||||
if (paymentSuccess) {
|
if (paymentSuccess) {
|
||||||
|
|||||||
Reference in New Issue
Block a user