Skip to content

Commit 0251615

Browse files
committed
fix: update project skeleton when unpausing project
1 parent 2510f4e commit 0251615

3 files changed

Lines changed: 40 additions & 2 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Skeleton } from 'ui'
2+
3+
export const TopSectionSkeleton = () => {
4+
return (
5+
<div className="flex flex-col gap-y-4">
6+
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 py-0 w-full items-center">
7+
<div className="flex flex-col">
8+
<div className="flex flex-row flex-wrap items-center gap-4 w-full">
9+
<div>
10+
<div className="flex items-center gap-x-2">
11+
<Skeleton className="h-9 w-48" />
12+
<Skeleton className="h-6 w-16" />
13+
</div>
14+
<Skeleton className="h-5 w-64 mt-3" />
15+
</div>
16+
</div>
17+
<div className="mt-8">
18+
<div className="grid grid-cols-1 md:grid-cols-2 gap-2 md:gap-6 flex-wrap">
19+
<Skeleton className="h-[72px] w-full" />
20+
<Skeleton className="h-[72px] w-full" />
21+
<Skeleton className="h-[72px] w-full" />
22+
<Skeleton className="h-[72px] w-full" />
23+
</div>
24+
</div>
25+
</div>
26+
<div>
27+
<Skeleton className="w-full h-[400px] md:h-[500px] rounded-md" />
28+
</div>
29+
</div>
30+
</div>
31+
)
32+
}

apps/studio/components/interfaces/ProjectHome/TopSection.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ import { ReactFlowProvider } from 'reactflow'
1414
import { Badge, cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
1515

1616
import { InstanceConfiguration } from '../Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration'
17+
import { TopSectionSkeleton } from './TopSection.Skeleton'
1718

1819
export const TopSection = () => {
1920
const isOrioleDb = useIsOrioleDb()
20-
const { data: project } = useSelectedProjectQuery()
21+
const { data: project, isPending: isLoadingProject } = useSelectedProjectQuery()
2122
const { data: organization } = useSelectedOrganizationQuery()
2223
const { data: parentProject } = useProjectDetailQuery({ ref: project?.parent_project_ref })
2324

@@ -41,6 +42,10 @@ export const TopSection = () => {
4142
return <ProjectPausedState />
4243
}
4344

45+
if (isLoadingProject) {
46+
return <TopSectionSkeleton />
47+
}
48+
4449
return (
4550
<div className="flex flex-col gap-y-4">
4651
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 py-0 w-full items-center">

apps/studio/data/config/project-endpoint-query.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export const useProjectApiUrl = (
3434
const protocol = settings?.app_config?.protocol ?? 'https'
3535
const endpoint = settings?.app_config?.endpoint
3636

37-
const hostEndpoint = isSuccessProjectSettings ? `${protocol}://${endpoint}` : undefined
37+
const hostEndpoint =
38+
isSuccessProjectSettings && endpoint ? `${protocol}://${endpoint}` : undefined
3839
const resolvedEndpoint = isCustomDomainsActive ? customEndpoint : hostEndpoint
3940
const storageEndpoint = settings?.app_config?.storage_endpoint
4041
? `${IS_PLATFORM ? 'https' : protocol}://${settings?.app_config?.storage_endpoint}`

0 commit comments

Comments
 (0)