mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## Context Housekeeping to deprecate more deprecated UI components, this one's focusing on the `Scaffold` components. The main visual differences are just the width within PageSections since the new components where the right content takes up a bit more width than the left content. (Ref org billing + usage) Starting the refactor with the organization pages: - Billing - Team - Usage - Settings -> SSO - Settings -> Security - Settings -> Audit Logs - Settings -> Documents
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { createFileRoute, useNavigate } from '@tanstack/react-router'
|
|
import { useEffect } from 'react'
|
|
import { PageContainer } from 'ui-patterns/PageContainer'
|
|
|
|
import { ShimmeringCard } from '@/components/interfaces/Home/ProjectList/ShimmeringCard'
|
|
import { useLastVisitedOrganization } from '@/hooks/misc/useLastVisitedOrganization'
|
|
|
|
export const Route = createFileRoute('/_app/org/')({
|
|
component: OrgIndexPage,
|
|
staticData: {
|
|
orgLayoutTitle: 'Organizations',
|
|
},
|
|
})
|
|
|
|
function OrgIndexPage() {
|
|
const navigate = useNavigate()
|
|
const { lastVisitedOrganization, isSuccess } = useLastVisitedOrganization()
|
|
|
|
useEffect(() => {
|
|
if (isSuccess) {
|
|
if (lastVisitedOrganization) {
|
|
void navigate({ to: '/org/$slug', params: { slug: lastVisitedOrganization } })
|
|
} else {
|
|
void navigate({ to: '/organizations' })
|
|
}
|
|
}
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, [isSuccess, navigate])
|
|
|
|
return (
|
|
<PageContainer className="my-8">
|
|
<div>
|
|
<ul className="my-6 mx-auto grid grid-cols-1 gap-4 sm:grid-cols-1 md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3">
|
|
<ShimmeringCard />
|
|
<ShimmeringCard />
|
|
</ul>
|
|
</div>
|
|
</PageContainer>
|
|
)
|
|
}
|