Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions apps/connect/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CreateSpaceCard } from '@/components/CreateSpaceCard';
import { SpacesCard } from '@/components/SpacesCard';
import { Loading } from '@/components/ui/Loading';
import { usePrivateSpaces } from '@/hooks/use-private-spaces';
import { usePublicSpaces } from '@/hooks/use-public-spaces';
import { useIdentityToken } from '@privy-io/react-auth';
import { createFileRoute } from '@tanstack/react-router';

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

function Authorized() {
const { isPending: privateSpacesPending, error: privateSpacesError, data: privateSpacesData } = usePrivateSpaces();
const {
isPending: publicSpacesPending,
error: publicSpacesError,
data: publicSpacesData,
} = usePublicSpaces(import.meta.env.VITE_HYPERGRAPH_API_URL);

return (
<div className="flex grow flex-col items-center justify-center">
<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">
<div className="relative min-h-80 lg:row-span-2">
<SpacesCard
spaces={privateSpacesData ?? []}
spaces={[...(privateSpacesData ?? []), ...(publicSpacesData ?? [])]}
status={
privateSpacesPending ? 'loading' : privateSpacesError ? { error: privateSpacesError.message } : undefined
privateSpacesPending || publicSpacesPending
? 'loading'
: privateSpacesError || publicSpacesError
? { error: privateSpacesError?.message || publicSpacesError?.message || 'Unknown error' }
: undefined
}
className="lg:absolute lg:inset-0"
/>
Expand Down
17 changes: 9 additions & 8 deletions apps/events/src/components/create-events.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Graph, type Op } from '@graphprotocol/grc-20';
import type { Connect } from '@graphprotocol/hypergraph';
import { publishOps, useHypergraphApp } from '@graphprotocol/hypergraph-react';
import { mapping } from '../mapping';
import { Button } from './ui/button';

const createEvents = async ({
Expand All @@ -12,10 +13,10 @@ const createEvents = async ({

const { id: jobOfferTypeId, ops: createJobOfferTypeOps } = Graph.createEntity({
name: 'My Test Job Offer',
types: ['a107c081-3089-4a94-8208-6a10775557d2'],
types: mapping.JobOffer.typeIds,
values: [
{
property: '20d18713-5352-4e1f-987c-d853bf9f8831',
property: mapping.JobOffer.properties?.salary as string,
value: '80000',
},
],
Expand All @@ -24,10 +25,10 @@ const createEvents = async ({

const { id: jobOfferTypeId2, ops: createJobOfferTypeOps2 } = Graph.createEntity({
name: 'My Test Job Offer 2',
types: ['a107c081-3089-4a94-8208-6a10775557d2'],
types: mapping.JobOffer.typeIds,
values: [
{
property: '20d18713-5352-4e1f-987c-d853bf9f8831',
property: mapping.JobOffer.properties?.salary as string,
value: '90000',
},
],
Expand All @@ -39,18 +40,18 @@ const createEvents = async ({

const { id: companyTypeId, ops: createCompanyTypeOps } = Graph.createEntity({
name: 'My Test Company',
types: ['e8932986-67a9-4fff-89a6-07f03973014c'],
types: mapping.Company.typeIds,
relations: {
'96beadca-0846-4e56-9628-c196f7f3c4cd': [{ toEntity: jobOfferTypeId }, { toEntity: jobOfferTypeId2 }],
[mapping.Company.relations?.jobOffers as string]: [{ toEntity: jobOfferTypeId }, { toEntity: jobOfferTypeId2 }],
},
});
ops.push(...createCompanyTypeOps);

const { ops: createEventTypeOps } = Graph.createEntity({
name: 'My Test Event',
types: ['6b8dbe76-389f-4bde-acdd-db9d5e387882'],
types: mapping.Event.typeIds,
relations: {
'd8e4ea54-cb8c-4dca-9c2b-64dbbbe78397': [{ toEntity: companyTypeId }],
[mapping.Event.relations?.sponsors as string]: [{ toEntity: companyTypeId }],
},
});
ops.push(...createEventTypeOps);
Expand Down
Loading