mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 06:09:08 +03:00
Improve loading state
This commit is contained in:
1 parent
9ab8bd5094
commit
a800de7cec
332 files changed
+29049
-296
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import clientLibsCommonSections from '~/spec/common-client-libs-sections.json'
|
||||
import typeSpec from '~/spec/enrichments/tsdoc_v2/combined.json'
|
||||
import spec from '~/spec/supabase_py_v2.yml' assert { type: 'yml' }
|
||||
import RefSectionHandler from '~/components/reference/RefSectionHandler'
|
||||
import { flattenSections } from '~/lib/helpers'
|
||||
import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths'
|
||||
import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps'
|
||||
import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu'
|
||||
|
||||
const sections = flattenSections(clientLibsCommonSections)
|
||||
const libraryPath = '/python'
|
||||
|
||||
export default function PyReference(props) {
|
||||
return (
|
||||
<RefSectionHandler
|
||||
menuId={MenuId.RefPythonV2}
|
||||
sections={sections}
|
||||
spec={spec}
|
||||
typeSpec={typeSpec}
|
||||
pageProps={props}
|
||||
type="client-lib"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export async function getStaticProps() {
|
||||
return handleRefStaticProps(sections, libraryPath)
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import clientLibsCommonSections from '~/spec/common-client-libs-sections.json'
|
||||
import typeSpec from '~/spec/enrichments/tsdoc_v2/combined.json'
|
||||
import spec from '~/spec/supabase_py_v2.yml' assert { type: 'yml' }
|
||||
import RefSectionHandler from '~/components/reference/RefSectionHandler'
|
||||
import { flattenSections } from '~/lib/helpers'
|
||||
import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths'
|
||||
import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps'
|
||||
import { useRouter } from 'next/router'
|
||||
import RefSEO from '~/components/reference/RefSEO'
|
||||
import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu'
|
||||
|
||||
const sections = flattenSections(clientLibsCommonSections)
|
||||
const libraryPath = '/python'
|
||||
|
||||
export default function PyReference(props) {
|
||||
const router = useRouter()
|
||||
const slug = router.query.slug[0]
|
||||
const filteredSection = sections.filter((section) => section.id === slug)
|
||||
|
||||
const pageTitle = filteredSection[0]?.title
|
||||
? `${filteredSection[0]?.title} | Supabase`
|
||||
: 'Supabase'
|
||||
|
||||
return (
|
||||
<>
|
||||
<RefSEO title={pageTitle} />
|
||||
|
||||
<RefSectionHandler
|
||||
menuId={MenuId.RefPythonV2}
|
||||
sections={filteredSection}
|
||||
spec={spec}
|
||||
typeSpec={typeSpec}
|
||||
pageProps={props}
|
||||
type="client-lib"
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export async function getStaticProps() {
|
||||
return handleRefStaticProps(sections, libraryPath)
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
Reference in new issue
Block a user