Skip to content

Commit 2e939c3

Browse files
committed
chore: update free plan migrate
1 parent 59fcf04 commit 2e939c3

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/components/userPlanAndBillings/UpgradePlanNavigationItem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export const UpgradePlanNavigationItem = () => {
5151
navigate('/pricing');
5252
};
5353

54+
console.log(pricingPlanStatus, 'plan status');
55+
5456
return (
5557
<Skeleton isLoading={isPricingPlanStatusLoading}>
5658
<Box

src/components/userPlanAndBillings/hooks/useMigrateToFreePlan.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export const useMigrateToFreePlan = ({ pricingPlanStatus, isLoading, refetch }:
2323
currency: 'USDC',
2424
network: chainId,
2525
verificationProof: 'test',
26-
email: '',
2726
duration: '1',
2827
},
2928
{

src/modules/purchasePlan/components/PurchaseSummery.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ const PurchaseSummery: FC<PurchaseSummeryProps> = ({ selectedPlan }) => {
5050
const [errorMessage, setErrorMessage] = useState<string | null | undefined>(null);
5151
const [paymentId, setPaymentId] = useState<string | null | undefined>(null);
5252

53-
const totalAmount = selectedPlan?.value ? selectedPlan?.value * (selectedPricingPlanTab === 'yearly' ? 12 : 1) : 0;
53+
// multiply by 0.85(85%) because we are applying a discount of 15% for yearly plan
54+
const totalAmount = selectedPlan?.value
55+
? selectedPlan?.value * (selectedPricingPlanTab === 'yearly' ? 12 * 0.85 : 1)
56+
: 0;
5457

5558
const { mutate: handleInitatePayment } = useInitiatePaymentInfo();
5659
const { data: paymentDetails, refetch: refetchFetchPaymentDetails } = useGetPaymentDetails({ paymentId: paymentId! });
@@ -118,7 +121,8 @@ const PurchaseSummery: FC<PurchaseSummeryProps> = ({ selectedPlan }) => {
118121
setIsLoading(true);
119122
modalControl.open();
120123

121-
const paymentAmount = selectedPricingPlanTab === 'yearly' ? selectedPlan?.value * 12 : selectedPlan?.value;
124+
// multiply by 0.85(85%) because we are applying a discount of 15% for yearly plan
125+
const paymentAmount = selectedPricingPlanTab === 'yearly' ? selectedPlan?.value * 12 * 0.85 : selectedPlan?.value;
122126
const provider = new ethers.providers.Web3Provider(window.ethereum);
123127

124128
try {
@@ -322,7 +326,7 @@ const PurchaseSummery: FC<PurchaseSummeryProps> = ({ selectedPlan }) => {
322326
padding="spacing-xs spacing-sm"
323327
>
324328
<Text variant="h5-semibold">Total Price</Text>
325-
<Text variant="h3-bold">{totalAmount} USDC</Text>
329+
<Text variant="h3-bold">{totalAmount.toFixed(2)} USDC</Text>
326330
{balance && isWalletConnected && (
327331
<Text
328332
color="text-tertiary"

0 commit comments

Comments
 (0)