This commit is contained in:
Kenneth Jannette
2024-01-19 15:32:48 -06:00
parent c4e175b4c2
commit 21cf110cf2
2 changed files with 11 additions and 8 deletions

View File

@@ -28,8 +28,7 @@ const PaymentModal = ({
setPaymentdata,
}) => {
const fieldsChunkSize = 2;
console.log("paymentfields", paymentfields);
/*
const ModalForm = () => {
return splitEvery(
Object.keys(paymentfields).slice(0, -2),
@@ -38,6 +37,7 @@ const PaymentModal = ({
<Row key={`row${j}`}>
{names.map((name, i) => (
<Col key={`${name}${i + fieldsChunkSize * j}`} className="mb-3">
{console.log("paymentdata", paymentdata)}
<TextInput
name={name}
value={paymentdata[name].value}
@@ -58,7 +58,7 @@ const PaymentModal = ({
</Row>
));
};
*/
return (
<Modal show="true" onHide={onCancel} size="lg">
<Modal.Header closeButton>
@@ -66,7 +66,9 @@ const PaymentModal = ({
</Modal.Header>
<Modal.Body>
<span>{modalText}</span>
<Form className="signup-form">{/* <ModalForm />*/}</Form>
<Form className="signup-form">
<ModalForm />
</Form>
</Modal.Body>
<Modal.Footer>
<Button

View File

@@ -33,7 +33,7 @@ const SignupPage = () => {
const [isBusy, setIsBusy] = useState(false);
const [data, setData] = useState(getFormDataDefaults(signupfields));
const [paymentdata, setPaymentdata] = useState(
getFormDataDefaults(signupfields)
getFormDataDefaults(paymentfields)
);
const [showPaymentModal, setShowPaymentModal] = useState(false);
@@ -47,7 +47,7 @@ const SignupPage = () => {
const handleChangePaymentInput = (e, name) => {
const newData = handleFormDataChange(e, name, data, signupfields);
if (newData !== null) {
setData(newData);
setPaymentdata(newData);
}
};
@@ -184,6 +184,7 @@ const SignupPage = () => {
<Row key={`row${j}`}>
{names.map((name, i) => (
<Col key={`${name}${i + fieldsChunkSize * j}`} className="mb-3">
{console.log("data", data)}
<TextInput
name={name}
value={data[name].value}
@@ -278,11 +279,11 @@ const SignupPage = () => {
onCancel={handleCancel}
handleChangePaymentInput={handleChangePaymentInput}
handleSignup={handleSignup}
paymentdata={paymentdata}
paymentfields={paymentfields}
setPaymentdata={setPaymentdata}
paymentdata={paymentdata}
buttonLabelText="Signup"
modalText="Please enter payment information"
modalText="Annual/Monthly option description"
/>
) : null}
</div>