This commit is contained in:
Kenneth Jannette
2024-01-28 18:36:55 -06:00
parent 21121ec911
commit ae3e8ef790
2 changed files with 25 additions and 9 deletions

View File

@@ -8,12 +8,10 @@ import Row from "react-bootstrap/Row";
import "../../styles/modals.scss"; import "../../styles/modals.scss";
const PaymentModal = ({ const PaymentModal = ({
buttonLabelText,
isBusy, isBusy,
paymentData, paymentData,
paymentfields, paymentfields,
handleChangePaymentInput, handleChangePaymentInput,
orderSummary,
handleSignUp, handleSignUp,
setShowPaymentModal, setShowPaymentModal,
handleSignup, handleSignup,
@@ -22,14 +20,16 @@ const PaymentModal = ({
fieldsChunkSize, fieldsChunkSize,
numberOfAccountsToAdd, numberOfAccountsToAdd,
}) => { }) => {
console.timeLog(); const monthlyAddAccountPrice = selectedPlan[0].pricing[2].amount;
const monthlySubscriptionPriceToday = selectedPlan[0].pricing[0].amount; const monthlySubscriptionPriceToday = selectedPlan[0].pricing[0].amount;
const annualSubscriptionPriceToday = selectedPlan[0].pricing[1].amount * 12; const annualSubscriptionPriceToday = selectedPlan[0].pricing[1].amount * 12;
console.log("monthlySubscriptionPriceToday", monthlySubscriptionPriceToday);
const monthlyAddAccountPrice = selectedPlan[0].pricing[2].amount; const additionalAccountsMonthlyPriceToday =
const annualAddAccountPrice = monthlyAddAccountPrice * 12; selectedPlan[0].pricing[2].amount * numberOfAccountsToAdd;
const additionalAccountsAnnualPriceToday =
additionalAccountsMonthlyPriceToday * 12;
const showAdditionaLAccountsView = const showAdditionaLAccountsView =
(selectedPlan[0]?.value === "partner" && numberOfAccountsToAdd > 0) || (selectedPlan[0]?.value === "partner" && numberOfAccountsToAdd > 0) ||
@@ -62,8 +62,18 @@ const PaymentModal = ({
{billingPeriod} - ${amountToday} {billingPeriod} - ${amountToday}
</div> </div>
</div> </div>
<div className="payment-modal-text-wrapper"> <div className="payment-modal-text-wrapper">
<div className="paymodal-summary-right">Addiitonal accounts:</div> <div className="paymodal-summary-right">Addiitonal accounts:</div>
<div className="paymodal-summary-left">
{isAnnual
? additionalAccountsAnnualPriceToday
: additionalAccountsMonthlyPriceToday}
</div>
</div>
<div className="payment-modal-text-wrapper">
<div className="paymodal-summary-right">Total today:</div>
<div className="paymodal-summary-left"></div> <div className="paymodal-summary-left"></div>
</div> </div>
{isAnnual ? ( {isAnnual ? (
@@ -82,6 +92,11 @@ const PaymentModal = ({
<div className="paymodal-summary-right"> <div className="paymodal-summary-right">
Additional Accounts: Additional Accounts:
</div> </div>
<div className="paymodal-summary-left">
{isAnnual
? additionalAccountsAnnualPriceToday
: additionalAccountsMonthlyPriceToday}
</div>
</div> </div>
) : ( ) : (
<></> <></>

View File

@@ -58,11 +58,12 @@ const SignupPage = () => {
}; };
const handleChangeAccountSelect = (e, name) => { const handleChangeAccountSelect = (e, name) => {
console.log("e, name", e, name); console.log("~~~~~~~~~~~~~~e.target.value, name", e.target.value, name);
const num = e.target.value; const num = e.target.value;
setNumberOfAccountsToAdd(num); const temp = Number(num);
setNumberOfAccountsToAdd(temp);
}; };
console.log("numberOfAccountsToAdd", numberOfAccountsToAdd);
const handleChangePaymentInput = (e, name) => { const handleChangePaymentInput = (e, name) => {
const newPaymentData = handleFormDataChange( const newPaymentData = handleFormDataChange(
e, e,