This commit is contained in:
Kenneth Jannette
2024-01-28 18:16:03 -06:00
parent c541715f9b
commit 21121ec911
2 changed files with 33 additions and 21 deletions

View File

@@ -22,19 +22,25 @@ const PaymentModal = ({
fieldsChunkSize,
numberOfAccountsToAdd,
}) => {
console.timeLog();
const monthlySubscriptionPriceToday = selectedPlan[0].pricing[0].amount;
const annualSubscriptionPriceToday = selectedPlan[0].pricing[1].amount * 12;
console.log("monthlySubscriptionPriceToday", monthlySubscriptionPriceToday);
const monthlyAddAccountPrice = selectedPlan[0].pricing[2].amount;
const annualAddAccountPrice = monthlyAddAccountPrice * 12;
const showAdditionaLAccountsView =
(selectedPlan[0]?.value === "partner" && numberOfAccountsToAdd > 0) ||
(selectedPlan[0]?.value === "seniorPartner" && numberOfAccountsToAdd > 0);
const planName = selectedPlan[0].name ? selectedPlan[0].name : null;
const billingPeriod = isAnnual ? "Annually" : "Monthly";
const amountToday = isAnnual
? selectedPlan[0]?.pricing[0]?.amount
: selectedPlan[0]?.pricing[1]?.amount;
console.log("annualAddAccountPrice", annualAddAccountPrice);
console.log("isAnnual", isAnnual);
console.log("numberOfAccountsToAdd", numberOfAccountsToAdd);
? annualSubscriptionPriceToday
: monthlySubscriptionPriceToday;
return (
<Modal show="true" size="lg">
<Modal.Header className="payment-modal-header" closeButton>
@@ -48,7 +54,6 @@ const PaymentModal = ({
<div className="paymodal-summary-right">Subscription Type:</div>
<div className="paymodal-summary-left">{planName}</div>
</div>
<div className="payment-modal-text-wrapper">
<div className="paymodal-summary-right">
Billing Period/Amount:
@@ -57,26 +62,26 @@ const PaymentModal = ({
{billingPeriod} - ${amountToday}
</div>
</div>
<div className="payment-modal-text-wrapper">
<div className="paymodal-summary-right">Addiitonal accounts:</div>
<div className="paymodal-summary-left"></div>
</div>
{isAnnual ? (
<div className="payment-modal-text-wrapper">
<div className="paymodal-summary-right"></div>
<div className="paymodal-summary-left-bonus">
Includes 10% discount for convenient annual billing
</div>
</div>
) : (
<></>
)}
{showAdditionaLAccountsView ? (
<div className="payment-modal-text-wrapper">
<div className="paymodal-summary-right">
Additional Accounts:
</div>
<div className="paymodal-summary-left">
{isAnnual ? (
<p>
{" "}
{numberOfAccountsToAdd}/ x 12 months = $
{annualAddAccountPrice}
</p>
) : (
<p>
{" "}
{numberOfAccountsToAdd}/per month = $
{monthlyAddAccountPrice}
</p>
)}
</div>
</div>
) : (
<></>