From 2403b288c232eccff75d36b144c7bf2a30605b59 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Thu, 19 Jun 2025 14:59:23 +0200 Subject: [PATCH 1/2] listing public spaces --- apps/events/src/routes/index.tsx | 20 ++++++++- .../src/HypergraphAppContext.tsx | 7 ++- .../src/HypergraphSpaceContext.tsx | 9 +--- .../hypergraph-react/src/hooks/use-spaces.ts | 45 +++++++++++++++++++ packages/hypergraph-react/src/index.ts | 1 + 5 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 packages/hypergraph-react/src/hooks/use-spaces.ts diff --git a/apps/events/src/routes/index.tsx b/apps/events/src/routes/index.tsx index 6bf951b1..f2ca8eac 100644 --- a/apps/events/src/routes/index.tsx +++ b/apps/events/src/routes/index.tsx @@ -2,7 +2,7 @@ import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Input } from '@/components/ui/input'; import { store } from '@graphprotocol/hypergraph'; -import { useHypergraphApp } from '@graphprotocol/hypergraph-react'; +import { useHypergraphApp, useSpaces } from '@graphprotocol/hypergraph-react'; import { Link, createFileRoute } from '@tanstack/react-router'; import { useSelector } from '@xstate/store/react'; import { useEffect, useState } from 'react'; @@ -12,6 +12,7 @@ export const Route = createFileRoute('/')({ }); function Index() { + const { data: publicSpaces } = useSpaces({ mode: 'public' }); const spaces = useSelector(store, (state) => state.context.spaces); const [spaceName, setSpaceName] = useState(''); @@ -89,6 +90,8 @@ function Index() { Create space + +

Private Spaces

+

Public Spaces

+ +

Account Inboxes