fix(payment): allow renewing active subscriptions
This commit is contained in:
@@ -32,7 +32,6 @@ import {
|
||||
SubscriptionBanner,
|
||||
SubscriptionBenefitsCard,
|
||||
SubscriptionCheckoutButton,
|
||||
SubscriptionCtaButton,
|
||||
SubscriptionPaymentMethod,
|
||||
SubscriptionPlanCard,
|
||||
SubscriptionUserRow,
|
||||
@@ -213,11 +212,6 @@ export function SubscriptionScreen({
|
||||
payment.isCheckingVipStatus;
|
||||
const canActivate =
|
||||
selectedPlan !== null && payment.agreed && !isPaymentBusy;
|
||||
const isVip =
|
||||
subscriptionType === "vip" &&
|
||||
(user.currentUser?.isVip === true ||
|
||||
payment.vipStatus?.isVip === true ||
|
||||
payment.isPaid);
|
||||
|
||||
const name = user.currentUser?.username ?? FALLBACK_USERNAME;
|
||||
const avatarUrl = user.currentUser?.avatarUrl ?? null;
|
||||
@@ -312,32 +306,24 @@ export function SubscriptionScreen({
|
||||
)}
|
||||
</section>
|
||||
|
||||
{!isVip ? (
|
||||
<section className={styles.paymentMethodSlot}>
|
||||
<SubscriptionPaymentMethod
|
||||
value={payment.payChannel}
|
||||
disabled={isPaymentBusy}
|
||||
onChange={(payChannel) =>
|
||||
paymentDispatch({
|
||||
type: "PaymentPayChannelChanged",
|
||||
payChannel,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</section>
|
||||
) : null}
|
||||
<section className={styles.paymentMethodSlot}>
|
||||
<SubscriptionPaymentMethod
|
||||
value={payment.payChannel}
|
||||
disabled={isPaymentBusy}
|
||||
onChange={(payChannel) =>
|
||||
paymentDispatch({
|
||||
type: "PaymentPayChannelChanged",
|
||||
payChannel,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</section>
|
||||
|
||||
<div className={styles.ctaSlot}>
|
||||
{isVip ? (
|
||||
<SubscriptionCtaButton type="button" disabled>
|
||||
VIP Activated
|
||||
</SubscriptionCtaButton>
|
||||
) : (
|
||||
<SubscriptionCheckoutButton
|
||||
disabled={!canActivate}
|
||||
subscriptionType={subscriptionType}
|
||||
/>
|
||||
)}
|
||||
<SubscriptionCheckoutButton
|
||||
disabled={!canActivate}
|
||||
subscriptionType={subscriptionType}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={styles.agreementSlot}>
|
||||
|
||||
Reference in New Issue
Block a user