Skip to content

Commit ce49bf5

Browse files
authored
fix(navbar): update graphql endpoint. remove sidebar (#289)
1 parent 1dc0439 commit ce49bf5

File tree

6 files changed

+177
-40
lines changed

6 files changed

+177
-40
lines changed

apps/typesync/client/src/Components/CmdPalette.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,23 @@ export function CmdPalette() {
169169
as="ul"
170170
className="max-h-80 scroll-py-2 divide-y divide-gray-500/20 overflow-y-auto"
171171
>
172-
<li className="p-2">
173-
<ul className="text-sm text-gray-400">
174-
{results.map((result) => (
175-
<Option key={result.id} result={result} />
176-
))}
177-
</ul>
178-
</li>
172+
{query === '' && !isLoading && results.length === 0 ? (
173+
<div className="px-6 py-10 text-center text-sm sm:px-14 flex flex-col items-center gap-y-2">
174+
<p className="font-semibold text-gray-900">No apps created</p>
175+
<p className="text-gray-500">
176+
Get started by creating a new App, building the App schema, and generating the hypergraph schema
177+
code. Click the "Create new app" option below
178+
</p>
179+
</div>
180+
) : (
181+
<li className="p-2">
182+
<ul className="text-sm text-gray-400">
183+
{results.map((result) => (
184+
<Option key={result.id} result={result} />
185+
))}
186+
</ul>
187+
</li>
188+
)}
179189
{query === '' && !isLoading ? (
180190
<li className="p-2">
181191
<h2 className="sr-only">Quick actions</h2>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { GraphQLClient } from 'graphql-request';
22

3-
export const graphqlClient = new GraphQLClient('https://hypergraph-v2.up.railway.app/graphql');
3+
export const graphqlClient = new GraphQLClient('https://hypergraph-v2-testnet.up.railway.app/graphql');

apps/typesync/client/src/generated/gql.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/* eslint-disable */
2-
import * as types from './graphql';
32
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
43

4+
import * as types from './graphql';
5+
56
/**
67
* Map of all GraphQL operations in the project.
78
*

apps/typesync/client/src/generated/graphql.ts

Lines changed: 121 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable */
22
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
3+
34
export type Maybe<T> = T | null;
45
export type InputMaybe<T> = Maybe<T>;
56
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -16,6 +17,19 @@ export type Scalars = {
1617
Float: { input: number; output: number; }
1718
};
1819

20+
export type Account = {
21+
__typename?: 'Account';
22+
address: Scalars['String']['output'];
23+
id: Scalars['ID']['output'];
24+
spacesWhereEdtitor?: Maybe<Array<Maybe<Space>>>;
25+
spacesWhereMember?: Maybe<Array<Maybe<Space>>>;
26+
};
27+
28+
export type AddressFilter = {
29+
in?: InputMaybe<Array<Scalars['String']['input']>>;
30+
is?: InputMaybe<Scalars['String']['input']>;
31+
};
32+
1933
export type Block = {
2034
__typename?: 'Block';
2135
dataSourceType?: Maybe<DataSourceType>;
@@ -50,6 +64,7 @@ export type DataType =
5064

5165
export type Entity = {
5266
__typename?: 'Entity';
67+
backlinks: Array<Maybe<Relation>>;
5368
blocks: Array<Maybe<Block>>;
5469
createdAt: Scalars['String']['output'];
5570
createdAtBlock: Scalars['String']['output'];
@@ -65,6 +80,12 @@ export type Entity = {
6580
};
6681

6782

83+
export type EntityBacklinksArgs = {
84+
filter?: InputMaybe<RelationFilter>;
85+
spaceId?: InputMaybe<Scalars['String']['input']>;
86+
};
87+
88+
6889
export type EntityRelationsArgs = {
6990
filter?: InputMaybe<RelationFilter>;
7091
spaceId?: InputMaybe<Scalars['String']['input']>;
@@ -77,26 +98,41 @@ export type EntityValuesArgs = {
7798
};
7899

79100
export type EntityFilter = {
80-
NOT?: InputMaybe<EntityFilter>;
81-
OR?: InputMaybe<Array<EntityFilter>>;
82-
fromRelation?: InputMaybe<RelationFilter>;
101+
backlinks?: InputMaybe<RelationFilter>;
83102
id?: InputMaybe<IdFilter>;
84-
toRelation?: InputMaybe<RelationFilter>;
103+
not?: InputMaybe<EntityFilter>;
104+
or?: InputMaybe<Array<EntityFilter>>;
105+
relations?: InputMaybe<RelationFilter>;
106+
types?: InputMaybe<IdFilter>;
85107
value?: InputMaybe<ValueFilter>;
86108
};
87109

88110
export type IdFilter = {
89111
in?: InputMaybe<Array<Scalars['String']['input']>>;
90112
};
91113

114+
export type Membership = {
115+
__typename?: 'Membership';
116+
address: Scalars['String']['output'];
117+
id: Scalars['ID']['output'];
118+
space?: Maybe<Space>;
119+
spaceId: Scalars['String']['output'];
120+
};
121+
122+
export type Meta = {
123+
__typename?: 'Meta';
124+
blockCursor?: Maybe<Scalars['String']['output']>;
125+
blockNumber?: Maybe<Scalars['String']['output']>;
126+
};
127+
92128
export type NumberFilter = {
93-
NOT?: InputMaybe<NumberFilter>;
94129
exists?: InputMaybe<Scalars['Boolean']['input']>;
95130
greaterThan?: InputMaybe<Scalars['Float']['input']>;
96131
greaterThanOrEqual?: InputMaybe<Scalars['Float']['input']>;
97132
is?: InputMaybe<Scalars['Float']['input']>;
98133
lessThan?: InputMaybe<Scalars['Float']['input']>;
99134
lessThanOrEqual?: InputMaybe<Scalars['Float']['input']>;
135+
not?: InputMaybe<NumberFilter>;
100136
};
101137

102138
export type PointFilter = {
@@ -110,23 +146,36 @@ export type Property = {
110146
entity?: Maybe<Entity>;
111147
id: Scalars['ID']['output'];
112148
relationValueTypes?: Maybe<Array<Maybe<Type>>>;
113-
renderableType?: Maybe<RenderableType>;
149+
renderableType?: Maybe<Scalars['String']['output']>;
114150
};
115151

116152
export type PropertyFilter = {
117153
dataType?: InputMaybe<DataType>;
154+
id?: InputMaybe<IdFilter>;
118155
};
119156

120157
export type Query = {
121158
__typename?: 'Query';
159+
account?: Maybe<Account>;
122160
entities: Array<Maybe<Entity>>;
123161
entity?: Maybe<Entity>;
162+
meta?: Maybe<Meta>;
124163
properties: Array<Maybe<Property>>;
164+
property?: Maybe<Property>;
165+
relation?: Maybe<Relation>;
166+
relations: Array<Maybe<Relation>>;
125167
search: Array<Maybe<Entity>>;
168+
space?: Maybe<Space>;
169+
spaces: Array<Maybe<Space>>;
126170
types: Array<Maybe<Type>>;
127171
};
128172

129173

174+
export type QueryAccountArgs = {
175+
address: Scalars['String']['input'];
176+
};
177+
178+
130179
export type QueryEntitiesArgs = {
131180
filter?: InputMaybe<EntityFilter>;
132181
limit?: InputMaybe<Scalars['Int']['input']>;
@@ -148,7 +197,26 @@ export type QueryPropertiesArgs = {
148197
};
149198

150199

200+
export type QueryPropertyArgs = {
201+
id: Scalars['String']['input'];
202+
};
203+
204+
205+
export type QueryRelationArgs = {
206+
id: Scalars['String']['input'];
207+
};
208+
209+
210+
export type QueryRelationsArgs = {
211+
filter?: InputMaybe<RelationFilter>;
212+
limit?: InputMaybe<Scalars['Int']['input']>;
213+
offset?: InputMaybe<Scalars['Int']['input']>;
214+
spaceId?: InputMaybe<Scalars['String']['input']>;
215+
};
216+
217+
151218
export type QuerySearchArgs = {
219+
filter?: InputMaybe<SearchFilter>;
152220
limit?: InputMaybe<Scalars['Int']['input']>;
153221
offset?: InputMaybe<Scalars['Int']['input']>;
154222
query: Scalars['String']['input'];
@@ -157,6 +225,18 @@ export type QuerySearchArgs = {
157225
};
158226

159227

228+
export type QuerySpaceArgs = {
229+
id: Scalars['String']['input'];
230+
};
231+
232+
233+
export type QuerySpacesArgs = {
234+
filter?: InputMaybe<SpaceFilter>;
235+
limit?: InputMaybe<Scalars['Int']['input']>;
236+
offset?: InputMaybe<Scalars['Int']['input']>;
237+
};
238+
239+
160240
export type QueryTypesArgs = {
161241
limit?: InputMaybe<Scalars['Int']['input']>;
162242
offset?: InputMaybe<Scalars['Int']['input']>;
@@ -181,21 +261,52 @@ export type Relation = {
181261
};
182262

183263
export type RelationFilter = {
264+
fromEntity?: InputMaybe<EntityFilter>;
184265
fromEntityId?: InputMaybe<Scalars['String']['input']>;
266+
relationEntity?: InputMaybe<EntityFilter>;
267+
relationEntityId?: InputMaybe<Scalars['String']['input']>;
268+
toEntity?: InputMaybe<EntityFilter>;
185269
toEntityId?: InputMaybe<Scalars['String']['input']>;
270+
type?: InputMaybe<IdFilter>;
186271
typeId?: InputMaybe<Scalars['String']['input']>;
187272
};
188273

189-
export type RenderableType =
190-
| 'IMAGE'
191-
| 'URL';
274+
export type SearchFilter = {
275+
not?: InputMaybe<SearchFilter>;
276+
or?: InputMaybe<Array<SearchFilter>>;
277+
types?: InputMaybe<IdFilter>;
278+
};
279+
280+
export type Space = {
281+
__typename?: 'Space';
282+
daoAddress: Scalars['String']['output'];
283+
editors?: Maybe<Array<Membership>>;
284+
entity?: Maybe<Entity>;
285+
id: Scalars['ID']['output'];
286+
mainVotingAddress?: Maybe<Scalars['String']['output']>;
287+
members?: Maybe<Array<Membership>>;
288+
membershipAddress?: Maybe<Scalars['String']['output']>;
289+
personalAddress?: Maybe<Scalars['String']['output']>;
290+
spaceAddress: Scalars['String']['output'];
291+
type: SpaceType;
292+
};
293+
294+
export type SpaceFilter = {
295+
editor?: InputMaybe<AddressFilter>;
296+
id?: InputMaybe<IdFilter>;
297+
member?: InputMaybe<AddressFilter>;
298+
};
299+
300+
export type SpaceType =
301+
| 'PERSONAL'
302+
| 'PUBLIC';
192303

193304
export type TextFilter = {
194-
NOT?: InputMaybe<TextFilter>;
195305
contains?: InputMaybe<Scalars['String']['input']>;
196306
endsWith?: InputMaybe<Scalars['String']['input']>;
197307
exists?: InputMaybe<Scalars['Boolean']['input']>;
198308
is?: InputMaybe<Scalars['String']['input']>;
309+
not?: InputMaybe<TextFilter>;
199310
startsWith?: InputMaybe<Scalars['String']['input']>;
200311
};
201312

apps/typesync/client/src/routes/__root.tsx

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
'use client';
22

3-
import { MagnifyingGlassIcon } from '@heroicons/react/20/solid';
3+
import { RectangleGroupIcon } from '@heroicons/react/24/outline';
4+
import { MagnifyingGlassIcon, PlusIcon } from '@heroicons/react/24/solid';
45
import { GithubLogoIcon } from '@phosphor-icons/react';
56
import type { QueryClient } from '@tanstack/react-query';
67
import { Link, Outlet, createRootRouteWithContext } from '@tanstack/react-router';
78
import type { GraphQLClient } from 'graphql-request';
89
import { useAtom } from 'jotai';
910

10-
import { AppSpacesNavbar, navbarExpandedAtom } from '../Components/AppsNavbar.js';
1111
import { CmdPalette, cmdPaletteOpenAtom } from '../Components/CmdPalette.js';
1212
import { appsQueryOptions } from '../hooks/useAppQuery.js';
1313
import { useOSQuery } from '../hooks/useOSQuery.js';
14-
import { classnames } from '../utils/classnames.js';
1514

1615
export type RouterContext = Readonly<{
1716
queryClient: QueryClient;
@@ -28,28 +27,44 @@ export const Route = createRootRouteWithContext<RouterContext>()({
2827

2928
function Layout() {
3029
const { data: os } = useOSQuery();
30+
3131
const [, setCmdPaletteOpen] = useAtom(cmdPaletteOpenAtom);
32-
const [navbarExpanded] = useAtom(navbarExpandedAtom);
3332

3433
return (
3534
<div>
36-
<div className="fixed inset-y-0 z-50 w-72 flex flex-col h-full">
37-
<div className="flex grow flex-col overflow-y-auto h-full">
38-
<Link
39-
to="/"
40-
className="flex h-16 shrink-0 items-center justify-center text-xl border-b border-gray-200 dark:border-slate-800 bg-white dark:bg-slate-950 cursor-pointer"
41-
>
42-
Hypergraph TypeSync
43-
</Link>
44-
<div className={classnames('bg-white dark:bg-slate-900 2xl:w-72 h-full', navbarExpanded ? 'w-72' : 'w-16')}>
45-
<AppSpacesNavbar />
35+
<div>
36+
<div className="sticky top-0 z-40 flex h-16 shrink-0 items-center justify-between gap-x-4 border-b border-gray-200 dark:border-slate-800 bg-white dark:bg-slate-950 shadow-sm px-4">
37+
<div className="flex w-fit items-center h-16">
38+
<Link
39+
to="/"
40+
className="flex h-16 shrink-0 items-center justify-center text-xl border-b border-gray-200 dark:border-slate-800 bg-white dark:bg-slate-950 cursor-pointer"
41+
>
42+
Hypergraph TypeSync
43+
</Link>
4644
</div>
47-
</div>
48-
</div>
49-
50-
<div className={classnames('2xl:pl-72', navbarExpanded ? 'pl-72' : 'pl-16')}>
51-
<div className="sticky top-0 z-40 flex h-16 shrink-0 items-center justify-end gap-x-4 border-b border-gray-200 dark:border-slate-800 bg-white dark:bg-slate-950 shadow-sm px-4">
52-
<div className="flex flex-1 items-center justify-end self-end w-fit gap-x-6 h-16">
45+
<nav className="flex flex-1 items-center h-16 shrink-0 space-x-3 2xl:space-x-4">
46+
<Link
47+
to="/"
48+
activeOptions={{ exact: true }}
49+
activeProps={{ className: 'bg-indigo-500 text-white' }}
50+
inactiveProps={{ className: 'bg-white dark:bg-slate-950 text-gray-950 dark:text-white' }}
51+
className="hover:bg-gray-100 dark:hover:bg-slate-700 rounded-md px-3 py-2 text-sm font-medium inline-flex items-center justify-center gap-x-1"
52+
>
53+
<RectangleGroupIcon className="size-4 -mt-0.5" aria-hidden="true" />
54+
Dashboard
55+
</Link>
56+
<Link
57+
to="/apps/create"
58+
activeOptions={{ exact: true }}
59+
activeProps={{ className: 'bg-indigo-500 text-white' }}
60+
inactiveProps={{ className: 'bg-white dark:bg-slate-950 text-gray-950 dark:text-white' }}
61+
className="hover:bg-gray-100 dark:hover:bg-slate-700 rounded-md px-3 py-2 text-sm font-medium inline-flex items-center justify-center gap-x-1"
62+
>
63+
<PlusIcon className="size-4 -mt-0.5" aria-hidden="true" />
64+
New App
65+
</Link>
66+
</nav>
67+
<div className="flex items-center justify-end self-end w-fit gap-x-6 h-16">
5368
<button
5469
type="button"
5570
className="min-w-fit w-72 inline-flex items-center justify-between cursor-pointer rounded-4xl text-gray-900 dark:text-gray-300 shadow-sm gap-x-2 pl-2 pr-3 py-1 bg-gray-200 hover:bg-gray-300 dark:bg-slate-800 dark:hover:bg-slate-700"

apps/typesync/graphql.codegen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const config = {
1414
overwrite: true,
1515
generates: {
1616
'./client/src/generated/': {
17-
schema: 'https://hypergraph-v2.up.railway.app/graphql',
17+
schema: 'https://hypergraph-v2-testnet.up.railway.app/graphql',
1818
documents: ['./client/src/**/*.{ts,tsx}'],
1919
preset: 'client',
2020
config: pluginConfig,

0 commit comments

Comments
 (0)