From e8db267a18ae31e5a3d48c212f4da793bbe5096d Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 26 Apr 2021 15:04:45 -0700 Subject: [PATCH] IO-912 Reformat payment modal --- .../payment-form/payment-form.component.jsx | 314 +++++++++--------- .../payment-form.totalpayments.component.jsx | 2 +- .../payment-modal/payment-modal.container.jsx | 1 + 3 files changed, 164 insertions(+), 153 deletions(-) diff --git a/client/src/components/payment-form/payment-form.component.jsx b/client/src/components/payment-form/payment-form.component.jsx index d010c8259..f6086ef5e 100644 --- a/client/src/components/payment-form/payment-form.component.jsx +++ b/client/src/components/payment-form/payment-form.component.jsx @@ -9,6 +9,7 @@ import Alert from "../alert/alert.component"; import DatePickerFormItem from "../form-date-picker/form-date-picker.component"; import CurrencyInput from "../form-items-formatted/currency-form-item.component"; import JobSearchSelect from "../job-search-select/job-search-select.component"; +import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import PaymentFormTotalPayments from "./payment-form.totalpayments.component"; const mapStateToProps = createStructuredSelector({ @@ -30,161 +31,170 @@ export function PaymentFormComponent({ return (
- - - - cur.jobid && prev.jobid !== cur.jobid} - > - {() => { - return ( - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {t("general.labels.none")} - {t("general.labels.email")} - {t("general.labels.print")} - - - - {!!!bodyshop.stripe_acct_id ? ( -
{t("payments.labels.signup")}
- ) : null} - - - {() => { - if (form.getFieldValue("useStripe")) + + + + + cur.jobid && prev.jobid !== cur.jobid} + > + {() => { return ( - + ); + }} + + - return null; - }} - - {stripeState.error ? ( - - ) : null} + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + {!bodyshop.stripe_acct_id ? ( +
+ {t("payments.labels.signup")} +
+ ) : null} + + + {() => { + if (form.getFieldValue("useStripe")) + return ( + + ); + + return null; + }} + + {stripeState.error ? ( + + ) : null} +
+ + + {t("general.labels.none")} + {t("general.labels.email")} + {t("general.labels.print")} + + +
); } diff --git a/client/src/components/payment-form/payment-form.totalpayments.component.jsx b/client/src/components/payment-form/payment-form.totalpayments.component.jsx index abc476880..ff362ae39 100644 --- a/client/src/components/payment-form/payment-form.totalpayments.component.jsx +++ b/client/src/components/payment-form/payment-form.totalpayments.component.jsx @@ -18,7 +18,7 @@ export default function PaymentFormTotalPayments({ jobid }) { if (loading) return ; if (error) return ; - if (!data) return
Select a job
; + if (!data) return <>; const totalPayments = data.jobs_by_pk.payments.reduce((acc, val) => { return acc.add(Dinero({ amount: (val.amount || 0) * 100 })); }, Dinero()); diff --git a/client/src/components/payment-modal/payment-modal.container.jsx b/client/src/components/payment-modal/payment-modal.container.jsx index d161ae49a..e96dc28cd 100644 --- a/client/src/components/payment-modal/payment-modal.container.jsx +++ b/client/src/components/payment-modal/payment-modal.container.jsx @@ -191,6 +191,7 @@ function BillEnterModalContainer({ visible={visible} okText={t("general.actions.save")} onOk={() => form.submit()} + width="50%" onCancel={handleCancel} okButtonProps={{ loading: loading,