Skip to content

Commit

Permalink
chore: add disabled check to save button
Browse files Browse the repository at this point in the history
  • Loading branch information
naumovski-filip committed Jun 20, 2023
1 parent 2faf833 commit 7722e79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/locales/en/user.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"complete_subscription": "Complete subscription",
"current_plan": "CURRENT PLAN",
"daily_subscription": "Daily subscription",
"downgrade_plan_success": "You've successfully changed the subscription plan. Your new plan will start after the end of the current cycle ( {{date}} ).",
"downgrade_plan_success": "You've successfully changed the subscription plan. Your new plan will start after the end of the current cycle ({{date}}).",
"expiry_date": "Expiry date",
"granted_subscription": "Granted subscription",
"hidden_transactions_one": "One more transaction",
Expand Down
6 changes: 5 additions & 1 deletion src/components/Payment/Payment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ const Payment = ({
/>
))}
<div className={styles.changePlanButtons}>
<Button label={t('user:account.save')} onClick={onChangePlanClick} disabled={changeSubscriptionPlan.isLoading} />
<Button
label={t('user:account.save')}
onClick={onChangePlanClick}
disabled={selectedOfferId === activeSubscription?.accessFeeId || changeSubscriptionPlan.isLoading}
/>
<Button label={t('user:account.cancel')} onClick={() => setIsChangingOffer(false)} variant="text" />
{activeSubscription?.status !== 'cancelled' && (
<Button
Expand Down

0 comments on commit 7722e79

Please sign in to comment.