mirror of
https://github.com/supabase/supabase.git
synced 2026-10-18 23:59:08 +03:00
* Move all studio files from /studio to /apps/studio. * Move studio specific prettier ignores. * Fix the ui references from studio. * Fix the css imports. * Fix all package.json issues. * Fix the prettier setup for the studio app. * Add .turbo folder to prettierignore. * Fix the github workflows.
59 lines
1.8 KiB
TypeScript
59 lines
1.8 KiB
TypeScript
import { createContext, useEffect, useState } from 'react'
|
|
import { observer, useLocalObservable } from 'mobx-react-lite'
|
|
import VercelIntegrationLayout from 'components/layouts/VercelIntegrationLayout'
|
|
import { Button, IconLoader } from 'ui'
|
|
|
|
const PageContext = createContext(null)
|
|
function IntegrationComplete() {
|
|
const PageState = useLocalObservable(() => ({
|
|
supabaseProjectRef: '',
|
|
next: '',
|
|
loadInitialData() {
|
|
this.getQueryParams()
|
|
},
|
|
getQueryParams() {
|
|
const params = new URLSearchParams(window.location.search)
|
|
this.next = params.get('next') as string
|
|
this.supabaseProjectRef = params.get('supabaseProjectRef') as string
|
|
},
|
|
}))
|
|
const [loading, setLoading] = useState(false)
|
|
|
|
useEffect(() => {
|
|
PageState.loadInitialData()
|
|
}, [])
|
|
|
|
function onContinue() {
|
|
setLoading(true)
|
|
window.location.href = PageState.next
|
|
}
|
|
|
|
return (
|
|
// @ts-ignore
|
|
<PageContext.Provider value={PageState}>
|
|
<VercelIntegrationLayout>
|
|
<div className="mx-auto max-w-sm">
|
|
<IconLoader className="animate-spin" size={30} />
|
|
<p className="pt-4 text-lg">Your new project is spinning up</p>
|
|
<p className="pt-2">This may take up to 2 mins, but you can continue on Vercel.</p>
|
|
<div className="py-4">
|
|
<a
|
|
href={`/project/${PageState.supabaseProjectRef}`}
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
className="hover:text-green-1000"
|
|
>
|
|
Open Supabase Dashboard →
|
|
</a>
|
|
</div>
|
|
|
|
<Button disabled={loading} loading={loading} onClick={onContinue} block>
|
|
Finish
|
|
</Button>
|
|
</div>
|
|
</VercelIntegrationLayout>
|
|
</PageContext.Provider>
|
|
)
|
|
}
|
|
export default observer(IntegrationComplete)
|