Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Deprecate use of nativeBilling feature flag

Joshen Limb3a0d558ed3a
diff --git a/studio/components/interfaces/Billing/PaymentSummaryPanel/PaymentSummaryPanel.tsx b/studio/components/interfaces/Billing/PaymentSummaryPanel/PaymentSummaryPanel.tsx
index d7a85a79601..58706c93761 100644
--- a/studio/components/interfaces/Billing/PaymentSummaryPanel/PaymentSummaryPanel.tsx
+++ b/studio/components/interfaces/Billing/PaymentSummaryPanel/PaymentSummaryPanel.tsx
@@ -10,7 +10,7 @@ import {
Alert,
} from '@supabase/ui'
-import { useFlag, useStore } from 'hooks'
+import { useStore } from 'hooks'
import { STRIPE_PRODUCT_IDS } from 'lib/constants'
import { SubscriptionPreview } from '../Billing.types'
import { getProductPrice } from '../Billing.utils'
@@ -57,14 +57,9 @@ const PaymentSummaryPanel: FC<Props> = ({
onConfirmPayment,
isSubmitting,
}) => {
- /**
- * Feature flags
- */
- const nativeBilling = useFlag('nativeBilling')
- const [showConfirmModal, setShowConfirmModal] = useState(false)
-
const { ui } = useStore()
const projectRegion = ui.selectedProject?.region
+ const [showConfirmModal, setShowConfirmModal] = useState(false)
const isChangingPlan =
(currentPlan.prod_id !== STRIPE_PRODUCT_IDS.PAYG && currentPlan.prod_id !== selectedPlan?.id) ||
@@ -82,14 +77,14 @@ const PaymentSummaryPanel: FC<Props> = ({
return (
<>
<div
- className="bg-panel-body-light dark:bg-panel-body-dark w-full px-6 lg:px-12 py-10 space-y-8 border-l"
+ className="bg-panel-body-light dark:bg-panel-body-dark w-full space-y-8 border-l px-6 py-10 lg:px-12"
style={{ height: 'calc(100vh - 57px)' }}
>
<p>Payment Summary</p>
{/* Subscription details */}
<div className="space-y-1">
- <p className="text-sm text-scale-1100">Selected subscription</p>
+ <p className="text-scale-1100 text-sm">Selected subscription</p>
<div className="flex items-center justify-between">
<p className={`${isChangingPlan ? 'text-scale-1100 line-through' : ''} text-sm`}>
{getPlanName(currentPlan)}
@@ -109,57 +104,53 @@ const PaymentSummaryPanel: FC<Props> = ({
</div>
{/* Add on details */}
- {nativeBilling && (
- <>
- {projectRegion !== 'af-south-1' && (
- <div className="space-y-1">
- <p className="text-sm">Selected add-ons</p>
- {currentComputeSize === undefined && selectedComputeSize === undefined && (
- <p className="text-scale-1100 text-sm">No add-ons selected</p>
- )}
- {currentComputeSize !== undefined && (
- <div className="flex items-center justify-between">
- <p
- className={`${
- isChangingComputeSize ? 'text-scale-1100 line-through' : ''
- } text-sm`}
- >
- {currentComputeSize.name}
- </p>
- <p
- className={`${
- isChangingComputeSize ? 'text-scale-1100 line-through' : ''
- } text-sm`}
- >
- ${(getProductPrice(currentComputeSize).unit_amount / 100).toFixed(2)}
- </p>
- </div>
- )}
- {isChangingComputeSize && (
- <div className="flex items-center justify-between">
- <p className="text-sm">{selectedComputeSize.name}</p>
- <p className="text-sm">
- ${(getProductPrice(selectedComputeSize).unit_amount / 100).toFixed(2)}
- </p>
- </div>
- )}
- {isChangingComputeSize && (
- <div className="!mt-4">
- <InformationBox
- hideCollapse
- defaultVisibility
- icon={<IconAlertCircle strokeWidth={2} />}
- title="Changing your compute size"
- description="It will take up to 2 minutes for changes to take place, and your project will be unavailable during that time"
- />
- </div>
- )}
+ {projectRegion !== 'af-south-1' && (
+ <div className="space-y-1">
+ <p className="text-sm">Selected add-ons</p>
+ {currentComputeSize === undefined && selectedComputeSize === undefined && (
+ <p className="text-scale-1100 text-sm">No add-ons selected</p>
+ )}
+ {currentComputeSize !== undefined && (
+ <div className="flex items-center justify-between">
+ <p
+ className={`${
+ isChangingComputeSize ? 'text-scale-1100 line-through' : ''
+ } text-sm`}
+ >
+ {currentComputeSize.name}
+ </p>
+ <p
+ className={`${
+ isChangingComputeSize ? 'text-scale-1100 line-through' : ''
+ } text-sm`}
+ >
+ ${(getProductPrice(currentComputeSize).unit_amount / 100).toFixed(2)}
+ </p>
</div>
)}
- </>
+ {isChangingComputeSize && (
+ <div className="flex items-center justify-between">
+ <p className="text-sm">{selectedComputeSize.name}</p>
+ <p className="text-sm">
+ ${(getProductPrice(selectedComputeSize).unit_amount / 100).toFixed(2)}
+ </p>
+ </div>
+ )}
+ {isChangingComputeSize && (
+ <div className="!mt-4">
+ <InformationBox
+ hideCollapse
+ defaultVisibility
+ icon={<IconAlertCircle strokeWidth={2} />}
+ title="Changing your compute size"
+ description="It will take up to 2 minutes for changes to take place, and your project will be unavailable during that time"
+ />
+ </div>
+ )}
+ </div>
)}
- <div className="h-px w-full bg-scale-600" />
+ <div className="bg-scale-600 h-px w-full" />
<PaymentTotal
subscriptionPreview={subscriptionPreview}
@@ -171,13 +162,13 @@ const PaymentSummaryPanel: FC<Props> = ({
<div className="space-y-2">
<p className="text-sm">Select payment method</p>
{isLoadingPaymentMethods ? (
- <div className="flex items-center rounded-md space-x-4 px-4 py-2 bg-scale-400 border border-scale-700">
+ <div className="bg-scale-400 border-scale-700 flex items-center space-x-4 rounded-md border px-4 py-2">
<IconLoader className="animate-spin" size={14} />
- <p className="text-sm text-scale-1100">Retrieving payment methods</p>
+ <p className="text-scale-1100 text-sm">Retrieving payment methods</p>
</div>
) : paymentMethods.length === 0 ? (
- <div className="flex items-center justify-between rounded-md px-4 py-2 bg-scale-100 border border-dashed">
- <div className="flex items-center space-x-4 text-scale-1100">
+ <div className="bg-scale-100 flex items-center justify-between rounded-md border border-dashed px-4 py-2">
+ <div className="text-scale-1100 flex items-center space-x-4">
<IconAlertCircle size={16} strokeWidth={1.5} />
<p className="text-sm">No saved payment methods</p>
</div>
@@ -214,11 +205,11 @@ const PaymentSummaryPanel: FC<Props> = ({
)
})}
<div
- className="py-2 px-3 flex items-center space-x-2 cursor-pointer transition group hover:bg-scale-500"
+ className="hover:bg-scale-500 group flex cursor-pointer items-center space-x-2 py-2 px-3 transition"
onClick={onSelectAddNewPaymentMethod}
>
<IconPlus size={16} />
- <p className="text-scale-1000 transition group-hover:text-scale-1200">
+ <p className="text-scale-1000 group-hover:text-scale-1200 transition">
Add new payment method
</p>
</div>
@@ -247,7 +238,7 @@ const PaymentSummaryPanel: FC<Props> = ({
header="Updating project database instance size"
onCancel={() => setShowConfirmModal(false)}
>
- <div className="py-4 space-y-4">
+ <div className="space-y-4 py-4">
<Modal.Content>
<Alert
withIcon
@@ -259,7 +250,7 @@ const PaymentSummaryPanel: FC<Props> = ({
</Alert>
</Modal.Content>
<Modal.Content>
- <p className="text-sm text-scale-1200">Would you like to update your project now?</p>
+ <p className="text-scale-1200 text-sm">Would you like to update your project now?</p>
</Modal.Content>
<Modal.Seperator />
<Modal.Content>
diff --git a/studio/components/interfaces/Billing/ProUpgrade/ProUpgrade.tsx b/studio/components/interfaces/Billing/ProUpgrade/ProUpgrade.tsx
index dfffe1df6de..a7492312d4f 100644
--- a/studio/components/interfaces/Billing/ProUpgrade/ProUpgrade.tsx
+++ b/studio/components/interfaces/Billing/ProUpgrade/ProUpgrade.tsx
@@ -3,7 +3,7 @@ import { Transition } from '@headlessui/react'
import { useRouter } from 'next/router'
import { Button, IconHelpCircle, Toggle, Modal } from '@supabase/ui'
-import { useFlag, useStore } from 'hooks'
+import { useStore } from 'hooks'
import { post, patch } from 'lib/common/fetch'
import { API_URL, PROJECT_STATUS } from 'lib/constants'
import { getURL } from 'lib/helpers'
@@ -38,11 +38,6 @@ const ProUpgrade: FC<Props> = ({
isLoadingPaymentMethods,
onSelectBack,
}) => {
- /**
- * Feature flags
- */
- const nativeBilling = useFlag('nativeBilling')
-
const { app, ui } = useStore()
const router = useRouter()
@@ -222,7 +217,7 @@ const ProUpgrade: FC<Props> = ({
onChange={() => setIsSpendCapEnabled(!isSpendCapEnabled)}
/>
</div>
- {nativeBilling && projectRegion !== 'af-south-1' && (
+ {projectRegion !== 'af-south-1' && (
<>
<Divider light />
<ComputeSizeSelection