Skip to content

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

Scaffold enterprise request page and temp fix weird transition ui issue

Joshen Limc8875fd43396
diff --git a/studio/components/interfaces/Billing/EnterpriseRequest.tsx b/studio/components/interfaces/Billing/EnterpriseRequest.tsx
index 2d581cfb5fb..9194aa952de 100644
--- a/studio/components/interfaces/Billing/EnterpriseRequest.tsx
+++ b/studio/components/interfaces/Billing/EnterpriseRequest.tsx
@@ -1,6 +1,7 @@
import { FC } from 'react'
import { Transition } from '@headlessui/react'
import { Button, Form, Input, IconArrowLeft } from '@supabase/ui'
+import { timeout } from 'lib/helpers'
interface Props {
visible: boolean
@@ -15,50 +16,72 @@ const EnterpriseRequest: FC<Props> = ({ visible, onSelectBack }) => {
message: '',
}
+ const onValidate = (values: any) => {
+ console.log('onValidate', values)
+ }
+
+ const onSubmit = async (values: any, { setSubmitting }: any) => {
+ setSubmitting(true)
+ await timeout(1000)
+ console.log('onSubmit', values)
+ setSubmitting(false)
+ }
+
return (
<Transition
show={visible}
enter="transition ease-out duration-300"
enterFrom="transform opacity-0 translate-x-10"
enterTo="transform opacity-100 translate-x-0"
- leave="transition ease-in duration-75"
- leaveFrom="transform opacity-100"
- leaveTo="transform opacity-0 -translate-x-10"
+ // leave="transition ease-in duration-75"
+ // leaveFrom="transform opacity-100"
+ // leaveTo="transform opacity-0 -translate-x-10"
>
- <div className="space-y-8">
- <div className="relative">
- <div className="absolute top-[2px] -left-24">
- <Button type="text" icon={<IconArrowLeft />} onClick={onSelectBack}>
- Back
- </Button>
- </div>
- <div className="space-y-1">
- <h4 className="text-xl">Customised plans tailored for your business needs</h4>
- <p className="text-scale-1100">
- Let us know a few details and we’ll be in contact with you!
- </p>
+ {/*
+ Fix for weird UI bug whereby transitions dont clear immediately
+ causing the UI to stack over each other for a split second
+ */}
+ {visible && (
+ <div className="space-y-8 w-4/5">
+ <div className="relative">
+ <div className="absolute top-[2px] -left-24">
+ <Button type="text" icon={<IconArrowLeft />} onClick={onSelectBack}>
+ Back
+ </Button>
+ </div>
+ <div className="space-y-1">
+ <h4 className="text-xl">Customised plans tailored for your business needs</h4>
+ <p className="text-scale-1100">
+ Let us know a few details and we’ll be in contact with you!
+ </p>
+ </div>
+ <Form
+ validateOnBlur
+ initialValues={initialValues}
+ validate={onValidate}
+ onSubmit={onSubmit}
+ >
+ {({ isSubmitting }: { isSubmitting: boolean }) => (
+ <div className="space-y-12 py-16">
+ <div className="space-y-4">
+ <Input layout="horizontal" label="Name" id="name" name="name" />
+ <Input layout="horizontal" label="Email" id="email" name="email" />
+ <Input layout="horizontal" label="Company" id="company" name="company" />
+ </div>
+ <Input.TextArea
+ id="message"
+ name="message"
+ label="Let us know what you intend to use Supabase for"
+ />
+ <Button htmlType="submit" loading={isSubmitting}>
+ Submit request
+ </Button>
+ </div>
+ )}
+ </Form>
</div>
- <Form
- validateOnBlur
- initialValues={initialValues}
- onSubmit={async (values: any, { setSubmitting }: any) => {}}
- validate={(values) => {}}
- >
- {({ isSubmitting }: { isSubmitting: boolean }) => (
- <div className="space-y-4 py-3">
- <Input layout="horizontal" label="Name" id="name" name="name" />
- <Input layout="horizontal" label="Email" id="email" name="email" />
- <Input layout="horizontal" label="Company" id="company" name="company" />
- <Input.TextArea
- label="Let us know what you intend to use Supabase for"
- id="message"
- name="message"
- />
- </div>
- )}
- </Form>
</div>
- </div>
+ )}
</Transition>
)
}
diff --git a/studio/components/interfaces/Billing/PlanSelection/PlanSelection.tsx b/studio/components/interfaces/Billing/PlanSelection/PlanSelection.tsx
index 2c0dfbbe8ec..f8abed9a9b5 100644
--- a/studio/components/interfaces/Billing/PlanSelection/PlanSelection.tsx
+++ b/studio/components/interfaces/Billing/PlanSelection/PlanSelection.tsx
@@ -21,9 +21,9 @@ const PlanSelection: FC<Props> = ({ visible, billingPlans, currentPlan, onSelect
enter="transition ease-out duration-300"
enterFrom="transform opacity-0 -translate-x-10"
enterTo="transform opacity-100 translate-x-0"
- leave="transition ease-in duration-75"
- leaveFrom="transform opacity-100"
- leaveTo="transform opacity-0 -translate-x-10"
+ // leave="transition ease-in duration-75"
+ // leaveFrom="transform opacity-100"
+ // leaveTo="transform opacity-0 -translate-x-10"
>
<div className="space-y-8">
<h4 className="text-xl">Change your project's subscription</h4>
diff --git a/studio/components/layouts/BillingLayout.tsx b/studio/components/layouts/BillingLayout.tsx
index e516eae2218..eef77b0a6c0 100644
--- a/studio/components/layouts/BillingLayout.tsx
+++ b/studio/components/layouts/BillingLayout.tsx
@@ -44,9 +44,7 @@ const BillingLayout: FC<Props> = ({ children }) => {
</div>
</div>
<div className="overflow-auto">
- <section className="mx-auto max-w-4xl relative my-10 has-slide-in slide-in">
- {children}
- </section>
+ <section className="mx-auto max-w-4xl relative my-10">{children}</section>
</div>
</div>
</BaseLayout>
diff --git a/studio/components/ui/Dialogs/ConfirmDialog.js b/studio/components/ui/Dialogs/ConfirmDialog.js
index 9c476ef29af..cf6b5afb5df 100644
--- a/studio/components/ui/Dialogs/ConfirmDialog.js
+++ b/studio/components/ui/Dialogs/ConfirmDialog.js
@@ -41,10 +41,7 @@ const ConfirmModal = ({
<Form
initialValues={{}}
validateOnBlur
- onSubmit={() => {
- console.log('onSubmit')
- onConfirm()
- }}
+ onSubmit={() => onConfirm()}
validate={() => {
let errors = []
return errors
diff --git a/studio/pages/project/[ref]/settings/billing/update.tsx b/studio/pages/project/[ref]/settings/billing/update.tsx
index 0c57d32c6ad..8de5023517f 100644
--- a/studio/pages/project/[ref]/settings/billing/update.tsx
+++ b/studio/pages/project/[ref]/settings/billing/update.tsx
@@ -49,11 +49,6 @@ const BillingUpdate: NextPage = () => {
}
}
- /**
- * Existing UI bug: Transition isn't smooth between screens, next "state" is getting rendered too early
- * Resolve later, don't wanna get stuck now lol
- */
-
return (
<BillingLayout>
<PlanSelection