diff --git a/src/components/settings/settings-page.tsx b/src/components/settings/settings-page.tsx index ab867e9f..dae383cf 100644 --- a/src/components/settings/settings-page.tsx +++ b/src/components/settings/settings-page.tsx @@ -142,135 +142,10 @@ class SettingsPage extends React.Component { ; } - // ! because we know this is set, as we have a paid user - const sub = userSubscription!; - return Settings - -
- - Account - -
- - - Account email - - - { userEmail } - - - - Subscription status - - - { - ({ - 'active': 'Active', - 'trialing': 'Active (trial)', - 'past_due': Past due , - 'deleted': sub.expiry && isFuture(sub.expiry) - ? `Active (until ${sub.expiry.toLocaleDateString()})` - : 'Cancelled' - }[sub.status]) || 'Unknown' - } - { isAccountUpdateInProcess && - - } - - - - Subscription plan - - - { - subscriptionPlans.state === 'fulfilled' - ? (subscriptionPlans.value as SubscriptionPlans)[sub.sku]?.name - // If the accounts API is unavailable for plan metadata for some reason, we can just - // format the raw SKU to get something workable, no worries: - : _.startCase(sub.sku) - } - - - - { - ({ - 'active': 'Next renews', - 'trialing': 'Renews', - 'past_due': 'Next payment attempt', - 'deleted': 'Ends', - }[sub.status]) || 'Current period ends' - } - - - { - distanceInWordsStrict(new Date(), sub.expiry, { - addSuffix: true, - partialMethod: 'round' - }) - } ({ - format(sub.expiry.toString(), 'Do [of] MMMM YYYY') - }) - - - - - { sub.lastReceiptUrl && - - View latest invoice - - } - { canManageSubscription && <> - { sub.updateBillingDetailsUrl && - - Update billing details - - } - - Cancel subscription - { isAccountUpdateInProcess && - - } - - } - Log out - - - - Questions? Email billing@httptoolkit.com - -
- - {/* - The above shows for both active paid users, and recently paid users whose most recent - payments failed. For those users, we drop other Pro features, but keep the settings - UI so they can easily log out, update billing details or cancel fully. - - The rest is active paid users only: - */} - { user.isPaidUser() && <> { _.isString(serverVersion.value) &&