Skip to content

Commit 8672a91

Browse files
committed
adding Helmet & renaming Shelf creation 🥩
1 parent ae848f8 commit 8672a91

File tree

13 files changed

+212
-181
lines changed

13 files changed

+212
-181
lines changed

‎index.html

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
<!doctype html>
22
<html lang="en">
33
<head>
4-
<meta charset="UTF-8" />
5-
<link rel="shortcut icon" type="image/svg+xml" href="/inner-d.svg"/>
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
8-
<meta property="og:title" content="dAcademy">
9-
<meta property="og:description" content="A de-store of knowledge. Learn, Verify, Achieve: Protocol for a Decentralized Education">
10-
<meta property="og:image" content="/dacademy-logo.png">
11-
<meta property="og:url" content="https://dacade.my">
12-
<meta property="og:site_name" content="dAcademy">
134
<title>dAcademy</title>
145
</head>
156
<body class="dark">

‎package-lock.json

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

‎package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"next-themes": "^0.4.3",
4848
"react": "^18.3.1",
4949
"react-dom": "^18.3.1",
50+
"react-helmet-async": "^2.0.5",
5051
"react-hook-form": "^7.53.2",
5152
"react-hot-toast": "^2.4.1",
5253
"react-image-crop": "^11.0.7",

‎src/components/Book/Submission.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ export const Submission = () => {
5858
<h3 className="flex text-center items-center justify-center">
5959
Please
6060
<a onClick={() => {
61-
(window.ethereum?.request as (o: {}) => void)({
61+
(window.ethereum?.request as
62+
(o: { method: string, params: Array<Record<string, string>> }) => void
63+
)({
6264
method: 'wallet_switchEthereumChain',
6365
params: [{ chainId: `0x${book.chainId.toString(16)}`}],
6466
})

‎src/components/Upload/UploadPlaybook.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export function UploadPlaybook() {
196196
toHex(randomBuffer),
197197
]
198198

199-
console.debug({ args })
199+
console.debug({ createChain: args })
200200

201201
abortSignal.throwIfAborted()
202202
writeContract({

‎src/data/factories.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"10": "0x0d006D9e862B362180eb602e5973Fd1fdb6f78dd",
3-
"11155420": "0xB12a7345D75e87fB2075ACEad99569a05ea0ebe8",
3+
"11155420": "0x1516d70663B0624E30fF4C9c5F066393AA7E95b1",
44
"31337": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
55
}

‎src/main.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
import { Toaster as HotToaster } from 'react-hot-toast'
1616
import { Provider as JotaiProvider } from 'jotai'
1717
import { DevTools as JotaiDevTools } from 'jotai-devtools'
18+
import { Helmet, HelmetProvider } from 'react-helmet-async'
1819
import { routeTree } from './routeTree.gen'
1920
import 'jotai-devtools/styles.css'
2021
import './styles/index.css'
@@ -74,17 +75,32 @@ const AppKitProvider = ({ children }: { children: ReactNode }) => (
7475
</WagmiProvider>
7576
)
7677

78+
const helmetContext = {}
79+
7780
const root=document.getElementById('root')!
7881
if(!root.innerHTML){
7982
createRoot(root).render(
8083
<StrictMode>
8184
<HotToaster position="bottom-center"/>
82-
<AppKitProvider>
83-
<JotaiProvider>
85+
<AppKitProvider>
86+
<JotaiProvider>
87+
<HelmetProvider context={helmetContext}>
88+
<Helmet>
89+
<title>dAcademy</title>
90+
<meta charSet="UTF-8"/>
91+
<link rel="icon" type="image/svg+xml" href="/inner-d.svg"/>
92+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
93+
<meta property="og:title" content="dAcademy"/>
94+
<meta property="og:description" content="A de-store of knowledge. Learn, Verify, Achieve: Protocol for a Decentralized Education"/>
95+
<meta property="og:image" content="/dacademy-logo.png"/>
96+
<meta property="og:url" content="https://dacade.my"/>
97+
<meta property="og:site_name" content="dAcademy"/>
98+
</Helmet>
8499
<RouterProvider {...{ router }}/>
85-
<JotaiDevTools/>
86-
</JotaiProvider>
87-
</AppKitProvider>
100+
<JotaiDevTools/>
101+
</HelmetProvider>
102+
</JotaiProvider>
103+
</AppKitProvider>
88104
</StrictMode>,
89105
)
90106
}

‎src/routeTree.gen.ts

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import { Route as rootRoute } from './routes/__root'
1919
const IndexLazyImport = createFileRoute('/')()
2020
const UserIndexLazyImport = createFileRoute('/user/')()
2121
const UploadIndexLazyImport = createFileRoute('/upload/')()
22-
const ShelfCreationIndexLazyImport = createFileRoute('/shelf-creation/')()
2322
const OrgIndexLazyImport = createFileRoute('/org/')()
2423
const CurationIndexLazyImport = createFileRoute('/curation/')()
2524
const UserUserLazyImport = createFileRoute('/user/$user')()
25+
const ShelfNewLazyImport = createFileRoute('/shelf/new')()
2626
const OrgIdLazyImport = createFileRoute('/org/$id')()
2727
const BookSlugIndexLazyImport = createFileRoute('/book/$slug/')()
2828
const BookSlugChapterIndexLazyImport = createFileRoute(
@@ -49,14 +49,6 @@ const UploadIndexLazyRoute = UploadIndexLazyImport.update({
4949
getParentRoute: () => rootRoute,
5050
} as any).lazy(() => import('./routes/upload/index.lazy').then((d) => d.Route))
5151

52-
const ShelfCreationIndexLazyRoute = ShelfCreationIndexLazyImport.update({
53-
id: '/shelf-creation/',
54-
path: '/shelf-creation/',
55-
getParentRoute: () => rootRoute,
56-
} as any).lazy(() =>
57-
import('./routes/shelf-creation/index.lazy').then((d) => d.Route),
58-
)
59-
6052
const OrgIndexLazyRoute = OrgIndexLazyImport.update({
6153
id: '/org/',
6254
path: '/org/',
@@ -77,6 +69,12 @@ const UserUserLazyRoute = UserUserLazyImport.update({
7769
getParentRoute: () => rootRoute,
7870
} as any).lazy(() => import('./routes/user/$user.lazy').then((d) => d.Route))
7971

72+
const ShelfNewLazyRoute = ShelfNewLazyImport.update({
73+
id: '/shelf/new',
74+
path: '/shelf/new',
75+
getParentRoute: () => rootRoute,
76+
} as any).lazy(() => import('./routes/shelf/new.lazy').then((d) => d.Route))
77+
8078
const OrgIdLazyRoute = OrgIdLazyImport.update({
8179
id: '/org/$id',
8280
path: '/org/$id',
@@ -117,6 +115,13 @@ declare module '@tanstack/react-router' {
117115
preLoaderRoute: typeof OrgIdLazyImport
118116
parentRoute: typeof rootRoute
119117
}
118+
'/shelf/new': {
119+
id: '/shelf/new'
120+
path: '/shelf/new'
121+
fullPath: '/shelf/new'
122+
preLoaderRoute: typeof ShelfNewLazyImport
123+
parentRoute: typeof rootRoute
124+
}
120125
'/user/$user': {
121126
id: '/user/$user'
122127
path: '/user/$user'
@@ -138,13 +143,6 @@ declare module '@tanstack/react-router' {
138143
preLoaderRoute: typeof OrgIndexLazyImport
139144
parentRoute: typeof rootRoute
140145
}
141-
'/shelf-creation/': {
142-
id: '/shelf-creation/'
143-
path: '/shelf-creation'
144-
fullPath: '/shelf-creation'
145-
preLoaderRoute: typeof ShelfCreationIndexLazyImport
146-
parentRoute: typeof rootRoute
147-
}
148146
'/upload/': {
149147
id: '/upload/'
150148
path: '/upload'
@@ -181,10 +179,10 @@ declare module '@tanstack/react-router' {
181179
export interface FileRoutesByFullPath {
182180
'/': typeof IndexLazyRoute
183181
'/org/$id': typeof OrgIdLazyRoute
182+
'/shelf/new': typeof ShelfNewLazyRoute
184183
'/user/$user': typeof UserUserLazyRoute
185184
'/curation': typeof CurationIndexLazyRoute
186185
'/org': typeof OrgIndexLazyRoute
187-
'/shelf-creation': typeof ShelfCreationIndexLazyRoute
188186
'/upload': typeof UploadIndexLazyRoute
189187
'/user': typeof UserIndexLazyRoute
190188
'/book/$slug': typeof BookSlugIndexLazyRoute
@@ -194,10 +192,10 @@ export interface FileRoutesByFullPath {
194192
export interface FileRoutesByTo {
195193
'/': typeof IndexLazyRoute
196194
'/org/$id': typeof OrgIdLazyRoute
195+
'/shelf/new': typeof ShelfNewLazyRoute
197196
'/user/$user': typeof UserUserLazyRoute
198197
'/curation': typeof CurationIndexLazyRoute
199198
'/org': typeof OrgIndexLazyRoute
200-
'/shelf-creation': typeof ShelfCreationIndexLazyRoute
201199
'/upload': typeof UploadIndexLazyRoute
202200
'/user': typeof UserIndexLazyRoute
203201
'/book/$slug': typeof BookSlugIndexLazyRoute
@@ -208,10 +206,10 @@ export interface FileRoutesById {
208206
__root__: typeof rootRoute
209207
'/': typeof IndexLazyRoute
210208
'/org/$id': typeof OrgIdLazyRoute
209+
'/shelf/new': typeof ShelfNewLazyRoute
211210
'/user/$user': typeof UserUserLazyRoute
212211
'/curation/': typeof CurationIndexLazyRoute
213212
'/org/': typeof OrgIndexLazyRoute
214-
'/shelf-creation/': typeof ShelfCreationIndexLazyRoute
215213
'/upload/': typeof UploadIndexLazyRoute
216214
'/user/': typeof UserIndexLazyRoute
217215
'/book/$slug/': typeof BookSlugIndexLazyRoute
@@ -223,10 +221,10 @@ export interface FileRouteTypes {
223221
fullPaths:
224222
| '/'
225223
| '/org/$id'
224+
| '/shelf/new'
226225
| '/user/$user'
227226
| '/curation'
228227
| '/org'
229-
| '/shelf-creation'
230228
| '/upload'
231229
| '/user'
232230
| '/book/$slug'
@@ -235,10 +233,10 @@ export interface FileRouteTypes {
235233
to:
236234
| '/'
237235
| '/org/$id'
236+
| '/shelf/new'
238237
| '/user/$user'
239238
| '/curation'
240239
| '/org'
241-
| '/shelf-creation'
242240
| '/upload'
243241
| '/user'
244242
| '/book/$slug'
@@ -247,10 +245,10 @@ export interface FileRouteTypes {
247245
| '__root__'
248246
| '/'
249247
| '/org/$id'
248+
| '/shelf/new'
250249
| '/user/$user'
251250
| '/curation/'
252251
| '/org/'
253-
| '/shelf-creation/'
254252
| '/upload/'
255253
| '/user/'
256254
| '/book/$slug/'
@@ -261,10 +259,10 @@ export interface FileRouteTypes {
261259
export interface RootRouteChildren {
262260
IndexLazyRoute: typeof IndexLazyRoute
263261
OrgIdLazyRoute: typeof OrgIdLazyRoute
262+
ShelfNewLazyRoute: typeof ShelfNewLazyRoute
264263
UserUserLazyRoute: typeof UserUserLazyRoute
265264
CurationIndexLazyRoute: typeof CurationIndexLazyRoute
266265
OrgIndexLazyRoute: typeof OrgIndexLazyRoute
267-
ShelfCreationIndexLazyRoute: typeof ShelfCreationIndexLazyRoute
268266
UploadIndexLazyRoute: typeof UploadIndexLazyRoute
269267
UserIndexLazyRoute: typeof UserIndexLazyRoute
270268
BookSlugIndexLazyRoute: typeof BookSlugIndexLazyRoute
@@ -274,10 +272,10 @@ export interface RootRouteChildren {
274272
const rootRouteChildren: RootRouteChildren = {
275273
IndexLazyRoute: IndexLazyRoute,
276274
OrgIdLazyRoute: OrgIdLazyRoute,
275+
ShelfNewLazyRoute: ShelfNewLazyRoute,
277276
UserUserLazyRoute: UserUserLazyRoute,
278277
CurationIndexLazyRoute: CurationIndexLazyRoute,
279278
OrgIndexLazyRoute: OrgIndexLazyRoute,
280-
ShelfCreationIndexLazyRoute: ShelfCreationIndexLazyRoute,
281279
UploadIndexLazyRoute: UploadIndexLazyRoute,
282280
UserIndexLazyRoute: UserIndexLazyRoute,
283281
BookSlugIndexLazyRoute: BookSlugIndexLazyRoute,
@@ -296,10 +294,10 @@ export const routeTree = rootRoute
296294
"children": [
297295
"/",
298296
"/org/$id",
297+
"/shelf/new",
299298
"/user/$user",
300299
"/curation/",
301300
"/org/",
302-
"/shelf-creation/",
303301
"/upload/",
304302
"/user/",
305303
"/book/$slug/",
@@ -312,6 +310,9 @@ export const routeTree = rootRoute
312310
"/org/$id": {
313311
"filePath": "org/$id.lazy.tsx"
314312
},
313+
"/shelf/new": {
314+
"filePath": "shelf/new.lazy.tsx"
315+
},
315316
"/user/$user": {
316317
"filePath": "user/$user.lazy.tsx"
317318
},
@@ -321,9 +322,6 @@ export const routeTree = rootRoute
321322
"/org/": {
322323
"filePath": "org/index.lazy.tsx"
323324
},
324-
"/shelf-creation/": {
325-
"filePath": "shelf-creation/index.lazy.tsx"
326-
},
327325
"/upload/": {
328326
"filePath": "upload/index.lazy.tsx"
329327
},

‎src/routes/book/$slug/$chapter/index.lazy.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ export const Route = createLazyFileRoute('/book/$slug/$chapter/')({
1414
})
1515

1616
export function Book() {
17+
const { slug, chapter } = Route.useParams()
1718
try {
18-
const { slug, chapter } = Route.useParams()
19-
20-
return (
19+
return (
2120
<LoggingErrorBoundary>
2221
<BookProvider chapter={Number(chapter)} {...{ slug}}>
2322
<article

‎src/routes/index.lazy.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useEffect } from 'react'
21
import { GraduationCap, UploadCloud } from 'lucide-react'
32
import { useAtom } from 'jotai'
43
import { createLazyFileRoute, Link } from '@tanstack/react-router'
@@ -19,11 +18,6 @@ export const Route = createLazyFileRoute('/')({
1918
function Index() {
2019
const [isGridVisible] = useAtom(isGridVisibleAtom)
2120

22-
// Scroll to the top of the page when the component mounts
23-
useEffect(() => {
24-
window.scrollTo(0, 0);
25-
}, []); // Empty dependency array ensures this runs only once on mount
26-
2721
return (
2822
<div>
2923
{isGridVisible && <div className="animated-grid-bg"></div>}

0 commit comments

Comments
 (0)