Skip to content

Commit 4e0db11

Browse files
committed
list public spaces on the connect index
1 parent 0a45cae commit 4e0db11

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

apps/connect/src/routes/index.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { CreateSpaceCard } from '@/components/CreateSpaceCard';
22
import { SpacesCard } from '@/components/SpacesCard';
33
import { Loading } from '@/components/ui/Loading';
44
import { usePrivateSpaces } from '@/hooks/use-private-spaces';
5+
import { usePublicSpaces } from '@/hooks/use-public-spaces';
56
import { useIdentityToken } from '@privy-io/react-auth';
67
import { createFileRoute } from '@tanstack/react-router';
78

@@ -27,15 +28,24 @@ function Index() {
2728

2829
function Authorized() {
2930
const { isPending: privateSpacesPending, error: privateSpacesError, data: privateSpacesData } = usePrivateSpaces();
31+
const {
32+
isPending: publicSpacesPending,
33+
error: publicSpacesError,
34+
data: publicSpacesData,
35+
} = usePublicSpaces(import.meta.env.VITE_HYPERGRAPH_API_URL);
3036

3137
return (
3238
<div className="flex grow flex-col items-center justify-center">
3339
<div className="grid w-xl max-w-full flex-col gap-6 lg:w-4xl lg:grid-cols-2 lg:gap-8 2xl:w-6xl">
3440
<div className="relative min-h-80 lg:row-span-2">
3541
<SpacesCard
36-
spaces={privateSpacesData ?? []}
42+
spaces={[...(privateSpacesData ?? []), ...(publicSpacesData ?? [])]}
3743
status={
38-
privateSpacesPending ? 'loading' : privateSpacesError ? { error: privateSpacesError.message } : undefined
44+
privateSpacesPending || publicSpacesPending
45+
? 'loading'
46+
: privateSpacesError || publicSpacesError
47+
? { error: privateSpacesError?.message || publicSpacesError?.message || 'Unknown error' }
48+
: undefined
3949
}
4050
className="lg:absolute lg:inset-0"
4151
/>

0 commit comments

Comments
 (0)