WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit d227bc3

Browse files
committed
Progress check-in.
1 parent 5ce1b40 commit d227bc3

File tree

11 files changed

+517
-141
lines changed

11 files changed

+517
-141
lines changed

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@
6767
"@dicebear/core": "^9.2.3",
6868
"@fontsource/inter": "^5.2.8",
6969
"@hello-pangea/dnd": "^17.0.0",
70-
"@prisma/adapter-pg": "^6.18.0",
71-
"@prisma/client": "^6.18.0",
72-
"@prisma/extension-read-replicas": "^0.4.1",
70+
"@prisma/adapter-pg": "^7.1.0",
71+
"@prisma/client": "^7.1.0",
72+
"@prisma/extension-read-replicas": "^0.5.0",
7373
"@react-spring/web": "^10.0.3",
7474
"@svgr/cli": "^8.1.0",
75-
"@tanstack/react-query": "^5.90.11",
76-
"@umami/react-zen": "^0.211.0",
77-
"@umami/redis-client": "^0.29.0",
75+
"@tanstack/react-query": "^5.90.12",
76+
"@umami/react-zen": "^0.216.0",
77+
"@umami/redis-client": "^0.30.0",
7878
"bcryptjs": "^3.0.2",
7979
"chalk": "^5.6.2",
8080
"chart.js": "^4.5.1",
@@ -97,7 +97,7 @@
9797
"is-docker": "^3.0.0",
9898
"is-localhost-ip": "^2.0.0",
9999
"isbot": "^5.1.31",
100-
"jsonwebtoken": "^9.0.2",
100+
"jsonwebtoken": "^9.0.3",
101101
"jszip": "^3.10.1",
102102
"kafkajs": "^2.1.0",
103103
"lucide-react": "^0.543.0",
@@ -107,7 +107,7 @@
107107
"npm-run-all": "^4.1.5",
108108
"papaparse": "^5.5.3",
109109
"pg": "^8.16.3",
110-
"prisma": "^6.18.0",
110+
"prisma": "^7.1.0",
111111
"pure-rand": "^7.0.1",
112112
"react": "^19.2.1",
113113
"react-dom": "^19.2.1",
@@ -121,7 +121,7 @@
121121
"serialize-error": "^12.0.0",
122122
"thenby": "^1.3.4",
123123
"ua-parser-js": "^2.0.6",
124-
"uuid": "^11.1.0",
124+
"uuid": "^13.0.0",
125125
"zod": "^4.1.13",
126126
"zustand": "^5.0.9"
127127
},

pnpm-lock.yaml

Lines changed: 417 additions & 101 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prisma/schema.prisma

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ generator client {
66

77
datasource db {
88
provider = "postgresql"
9-
url = env("DATABASE_URL")
109
relationMode = "prisma"
1110
}
1211

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use client';
2+
import { Loading } from '@umami/react-zen';
3+
import { createContext, type ReactNode } from 'react';
4+
import { useBoardQuery } from '@/components/hooks/queries/useBoardQuery';
5+
import type { Board } from '@/generated/prisma/client';
6+
7+
export const BoardContext = createContext<Board>(null);
8+
9+
export function BoardProvider({ boardId, children }: { boardId: string; children: ReactNode }) {
10+
const { data: board, isFetching, isLoading } = useBoardQuery(boardId);
11+
12+
if (isFetching && isLoading) {
13+
return <Loading placement="absolute" />;
14+
}
15+
16+
if (!board) {
17+
return null;
18+
}
19+
20+
return <BoardContext.Provider value={board}>{children}</BoardContext.Provider>;
21+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function BoardBody() {
2+
return <h1>i am bored.</h1>;
3+
}
Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Button, Column, Grid, InlineEditField, Row } from '@umami/react-zen';
1+
import { Button, Column, Grid, Heading, Row, TextField } from '@umami/react-zen';
22
import { useMessages } from '@/components/hooks';
33

44
export function BoardHeader() {
55
const { formatMessage, labels } = useMessages();
66
const defaultName = formatMessage(labels.untitled);
7-
const name = 'My Board';
8-
const description = 'This is my board';
7+
const name = '';
8+
const description = '';
99

1010
const handleNameChange = (name: string) => {
1111
//updateReport({ name: name || defaultName });
@@ -15,29 +15,50 @@ export function BoardHeader() {
1515
//updateReport({ description });
1616
};
1717

18+
return <h1>asdgfviybiyu8oaero8g9873qrgb875qh0g8</h1>;
19+
1820
return (
19-
<Grid columns="1fr 1fr">
21+
<Grid
22+
columns={{ xs: '1fr', md: '1fr 1fr' }}
23+
paddingY="4"
24+
marginBottom="6"
25+
border="bottom"
26+
gapX="6"
27+
>
28+
asdfasdfds
2029
<Column>
2130
<Row>
22-
<InlineEditField
31+
<TextField
32+
variant="quiet"
2333
name="name"
2434
value={name}
35+
defaultValue={name}
2536
placeholder={defaultName}
26-
onCommit={handleNameChange}
27-
/>
37+
onChange={handleNameChange}
38+
autoComplete="off"
39+
style={{ fontSize: '2rem', fontWeight: 700, width: '100%' }}
40+
>
41+
<Heading size="4">{name}</Heading>
42+
</TextField>
2843
</Row>
2944
<Row>
30-
<InlineEditField
45+
<TextField
46+
variant="quiet"
3147
name="description"
3248
value={description}
49+
defaultValue={description}
3350
placeholder={`+ ${formatMessage(labels.addDescription)}`}
34-
onCommit={handleDescriptionChange}
35-
/>
51+
autoComplete="off"
52+
onChange={handleDescriptionChange}
53+
style={{ width: '100%' }}
54+
>
55+
{description}
56+
</TextField>
3657
</Row>
3758
</Column>
38-
<Row justifyContent="flex-end">
59+
<Column justifyContent="center" alignItems="flex-end">
3960
<Button variant="primary">{formatMessage(labels.save)}</Button>
40-
</Row>
61+
</Column>
4162
</Grid>
4263
);
4364
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
'use client';
22
import { Column } from '@umami/react-zen';
33
import { BoardHeader } from '@/app/(main)/boards/[boardId]/BoardHeader';
4+
import { BoardProvider } from '@/app/(main)/boards/BoardProvider';
45
import { PageBody } from '@/components/common/PageBody';
5-
import { useMessages } from '@/components/hooks';
6-
7-
export function BoardPage() {
8-
const { formatMessage, labels } = useMessages();
96

7+
export function BoardPage({ boardId }: { boardId: string }) {
108
return (
11-
<PageBody>
12-
<Column margin="2">
13-
<BoardHeader />
14-
</Column>
15-
</PageBody>
9+
<BoardProvider boardId={boardId}>
10+
<PageBody>
11+
<Column>
12+
<BoardHeader />
13+
</Column>
14+
</PageBody>
15+
</BoardProvider>
1616
);
1717
}

src/components/boards/Board.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { useContext } from 'react';
2+
import { BoardContext } from '@/app/(main)/boards/BoardProvider';
3+
4+
export function useBoard() {
5+
return useContext(BoardContext);
6+
}

src/components/hooks/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client';
22

33
// Context hooks
4+
export * from './context/useBoard';
45
export * from './context/useLink';
56
export * from './context/usePixel';
67
export * from './context/useTeam';
@@ -9,6 +10,7 @@ export * from './context/useWebsite';
910

1011
// Query hooks
1112
export * from './queries/useActiveUsersQuery';
13+
export * from './queries/useBoardQuery';
1214
export * from './queries/useBoardsQuery';
1315
export * from './queries/useDateRangeQuery';
1416
export * from './queries/useDeleteQuery';

0 commit comments

Comments
 (0)