Skip to content

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

Midway billing cards

Joshen Limee3772f50eb3
diff --git a/studio/components/interfaces/Billing/Plans/Plans.constants.ts b/studio/components/interfaces/Billing/Plans/Plans.constants.ts
new file mode 100644
index 00000000000..8c08a917087
--- /dev/null
+++ b/studio/components/interfaces/Billing/Plans/Plans.constants.ts
@@ -0,0 +1,41 @@
+import { BillingPlan } from './Plans.types'
+
+export const BILLING_PLANS: BillingPlan[] = [
+ {
+ name: 'Free',
+ price: 0,
+ description: 'Zero commitment, perfect for hobby projects and experiments',
+ isPopular: false,
+ pointers: [
+ 'Postgres database, API server, authentication, storage',
+ 'Unlimited team members',
+ 'Community support',
+ ],
+ },
+ {
+ name: 'Pro',
+ price: 25,
+ description: 'Designated support team, account manager and technical specialist',
+ isPopular: true,
+ pointers: [
+ 'Optimized database instances',
+ 'Usage-based billing, no limits',
+ 'Automated back-ups',
+ 'Designated support',
+ 'Unlimited audit trails',
+ ],
+ },
+ {
+ name: 'Enterprise',
+ price: null,
+ description: 'Custom tailored services to suit your specific business needs',
+ isPopular: false,
+ pointers: [
+ 'Bespoked architecture',
+ 'SSO / SAML',
+ 'SOC2 security',
+ 'Automated scaling',
+ 'Dedicated support team & SLAs',
+ ],
+ },
+]
diff --git a/studio/components/interfaces/Billing/Plans/Plans.tsx b/studio/components/interfaces/Billing/Plans/Plans.tsx
new file mode 100644
index 00000000000..fad15a08bdd
--- /dev/null
+++ b/studio/components/interfaces/Billing/Plans/Plans.tsx
@@ -0,0 +1,35 @@
+import { Badge } from '@supabase/ui'
+import { FC } from 'react'
+import { BILLING_PLANS } from './Plans.constants'
+
+interface Props {}
+
+const Plans: FC<Props> = ({}) => {
+ return (
+ <div className="flex justify-between space-x-4">
+ {BILLING_PLANS.map((plan) => {
+ return (
+ <div className="w-1/3 bg-gray-300 border border-gray-500 rounded-md px-6 py-7">
+ <div className="flex items-center space-x-4">
+ <p className="text-lg">{plan.name}</p>
+ {plan.isPopular && <Badge>Popular</Badge>}
+ </div>
+ <p className="text-scale-1100 text-sm mt-2">{plan.description}</p>
+ <div className="py-4">
+ {plan.price === null ? (
+ <p className="text-2xl text-center">Contact us</p>
+ ) : (
+ <div className="flex items-end justify-center">
+ <p className="text-3xl">${plan.price}</p>
+ <p className="text-sm text-scale-1100 relative -top-[2px]"> /month</p>
+ </div>
+ )}
+ </div>
+ </div>
+ )
+ })}
+ </div>
+ )
+}
+
+export default Plans
diff --git a/studio/components/interfaces/Billing/Plans/Plans.types.ts b/studio/components/interfaces/Billing/Plans/Plans.types.ts
new file mode 100644
index 00000000000..a5d2519dced
--- /dev/null
+++ b/studio/components/interfaces/Billing/Plans/Plans.types.ts
@@ -0,0 +1,7 @@
+export interface BillingPlan {
+ name: string
+ price: number | null
+ description: string
+ pointers: string[]
+ isPopular: boolean
+}
diff --git a/studio/components/interfaces/Billing/index.ts b/studio/components/interfaces/Billing/index.ts
index a1d37a31beb..ecbde0b031e 100644
--- a/studio/components/interfaces/Billing/index.ts
+++ b/studio/components/interfaces/Billing/index.ts
@@ -1,6 +1,7 @@
import PAYGUsage from './PAYGUsage/PAYGUsage'
import Subscription from './Subscription/Subscription'
+import Plans from './Plans/Plans'
export * from './Subscription/Subscription.types'
export * from './PAYGUsage/PAYGUsage.constants'
-export { PAYGUsage, Subscription }
+export { PAYGUsage, Subscription, Plans }
diff --git a/studio/components/layouts/BillingLayout.tsx b/studio/components/layouts/BillingLayout.tsx
new file mode 100644
index 00000000000..e516eae2218
--- /dev/null
+++ b/studio/components/layouts/BillingLayout.tsx
@@ -0,0 +1,56 @@
+import Link from 'next/link'
+import { FC, ReactNode } from 'react'
+import { useStore } from 'hooks'
+import { Button, IconX } from '@supabase/ui'
+import BaseLayout from 'components/layouts'
+
+interface Props {
+ children: ReactNode
+}
+
+const BillingLayout: FC<Props> = ({ children }) => {
+ const { ui } = useStore()
+
+ return (
+ <BaseLayout hideHeader hideIconBar>
+ <div className="flex flex-col h-full w-full">
+ {/* Header */}
+ <div className="px-3 py-2 border-b dark:border-dark flex items-center space-x-3">
+ <Link href={`/project/${ui.selectedProject?.ref}/settings/billing`}>
+ <a>
+ <Button type="text" size="tiny">
+ <IconX size={22} strokeWidth={1.5} />
+ </Button>
+ </a>
+ </Link>
+ <div className="flex items-center space-x-2">
+ <p className="text-sm text-scale-1100">{ui.selectedOrganization?.name}</p>
+ <span className="text-scale-800">
+ <svg
+ viewBox="0 0 24 24"
+ width="16"
+ height="16"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ fill="none"
+ shapeRendering="geometricPrecision"
+ >
+ <path d="M16 3.549L7.12 20.600"></path>
+ </svg>
+ </span>
+ <p className="text-sm text-scale-1100">{ui.selectedProject?.name}</p>
+ </div>
+ </div>
+ <div className="overflow-auto">
+ <section className="mx-auto max-w-4xl relative my-10 has-slide-in slide-in">
+ {children}
+ </section>
+ </div>
+ </div>
+ </BaseLayout>
+ )
+}
+
+export default BillingLayout
diff --git a/studio/components/layouts/index.ts b/studio/components/layouts/index.ts
index cd935838e4e..a69ec6327bb 100644
--- a/studio/components/layouts/index.ts
+++ b/studio/components/layouts/index.ts
@@ -10,6 +10,7 @@ import StorageLayout from './StorageLayout/StorageLayout'
import AccountLayout from './AccountLayout/AccountLayout'
import WizardLayout from './WizardLayout'
import VercelIntegrationLayout from './VercelIntegrationLayout'
+import BillingLayout from './BillingLayout'
export {
AuthLayout,
@@ -22,5 +23,6 @@ export {
AccountLayout,
WizardLayout,
VercelIntegrationLayout,
+ BillingLayout,
}
export default ProjectLayout
diff --git a/studio/pages/project/[ref]/settings/billing/update.tsx b/studio/pages/project/[ref]/settings/billing/update.tsx
index e69de29bb2d..d6a53234e00 100644
--- a/studio/pages/project/[ref]/settings/billing/update.tsx
+++ b/studio/pages/project/[ref]/settings/billing/update.tsx
@@ -0,0 +1,23 @@
+import { NextPage } from 'next'
+import { useState } from 'react'
+import { observer } from 'mobx-react-lite'
+
+import { withAuth, useStore } from 'hooks'
+import { BillingLayout } from 'components/layouts'
+import { Plans } from 'components/interfaces/Billing'
+
+const BillingUpdate: NextPage = () => {
+ const { app, ui } = useStore()
+ console.log(ui.selectedProject)
+
+ return (
+ <BillingLayout>
+ <div className="space-y-4">
+ <h4 className="text-xl">Change your project's subscription</h4>
+ <Plans />
+ </div>
+ </BillingLayout>
+ )
+}
+
+export default withAuth(observer(BillingUpdate))