Skip to content

Commit 0be96a2

Browse files
committed
feat: saving wallet connection with a Layout and prisma update
1 parent 90b0d93 commit 0be96a2

File tree

9 files changed

+69
-43
lines changed

9 files changed

+69
-43
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@emotion/styled": "^11.11.0",
1818
"@fontsource/inter": "^5.0.3",
1919
"@next-auth/prisma-adapter": "^1.0.7",
20-
"@prisma/client": "^4.16.1",
20+
"@prisma/client": "^5.0.0",
2121
"@tanstack/react-query": "^4.29.19",
2222
"@trpc/client": "^10.33.0",
2323
"@trpc/next": "^10.33.0",
@@ -61,7 +61,7 @@
6161
"postcss": "^8.4.24",
6262
"prettier": "^2.8.8",
6363
"prettier-plugin-tailwindcss": "^0.3.0",
64-
"prisma": "^4.16.1",
64+
"prisma": "^5.0.0",
6565
"react-syntax-highlighter": "^15.5.0",
6666
"remark-frontmatter": "^4.0.1",
6767
"tailwindcss": "^3.3.2",

prisma/schema.prisma

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
generator client {
2-
provider = "prisma-client-js"
3-
previewFeatures = ["jsonProtocol"]
2+
provider = "prisma-client-js"
43
}
54

65
datasource db {

src/components/Layout.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Box } from "@chakra-ui/react";
2+
import Topbar from "./Topbar";
3+
4+
interface Props {
5+
children: React.ReactNode;
6+
}
7+
8+
export default function Layout({ children }: Props) {
9+
return (
10+
<>
11+
<Topbar />
12+
<Box
13+
as="main"
14+
p="1.25em"
15+
px="5%"
16+
mx={{ base: "2rem", md: "6rem", lg: "10rem" }}
17+
>
18+
{children}
19+
</Box>
20+
</>
21+
);
22+
}

src/components/Topbar.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {
3939
import { InjectedConnector } from "wagmi/connectors/injected";
4040
import { useEffect, useState } from "react";
4141

42-
export default function WithSubnavigation() {
42+
export default function Topbar() {
4343
const { isOpen, onToggle } = useDisclosure();
4444
const router = useRouter();
4545

@@ -109,7 +109,12 @@ export default function WithSubnavigation() {
109109
}, []);
110110

111111
return (
112-
<Box>
112+
<Box
113+
as="header"
114+
p="1.25em"
115+
px="5%"
116+
mx={{ base: "2rem", md: "6rem", lg: "10rem" }}
117+
>
113118
<Flex
114119
// bg={useColorModeValue('white', 'gray.800')}
115120
color={useColorModeValue("gray.600", "white")}

src/pages/_app.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ const MyApp: AppType<{ session: Session | null }> = ({
6363
<ChakraProvider theme={theme}>
6464
<WagmiConfig config={config}>
6565
<SessionProvider session={session} refetchInterval={0}>
66-
<Box
66+
{/* <Box
6767
p="1.25em"
6868
px="5%"
6969
mx={{ base: "2rem", md: "6rem", lg: "10rem" }}
70-
>
71-
<Topbar />
72-
<MDXProvider components={Components}>
73-
<Component {...pageProps} />{" "}
74-
</MDXProvider>
75-
</Box>
70+
> */}
71+
{/* <Topbar /> */}
72+
<MDXProvider components={Components}>
73+
<Component {...pageProps} />
74+
</MDXProvider>
75+
{/* </Box> */}
7676
</SessionProvider>
7777
</WagmiConfig>
7878
</ChakraProvider>

src/pages/getting-started.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import path from "path";
2222
import matter from "gray-matter";
2323
import { CONTENT_PATH } from "@/lib/constants";
2424
import { useEffect, useState } from "react";
25+
import Layout from "@/components/Layout";
2526

2627
interface Lesson {
2728
frontMatter: any;
@@ -52,9 +53,9 @@ const GettingStarted: React.FC<LessonProps> = ({ lessons }) => {
5253
}, [lessons]);
5354

5455
return (
55-
<>
56+
<Layout>
5657
<Flex
57-
as="main"
58+
// as="main"
5859
py={5}
5960
px={[4, 10, 16]}
6061
direction="column"
@@ -234,7 +235,7 @@ const GettingStarted: React.FC<LessonProps> = ({ lessons }) => {
234235
</Box>
235236
</Stack>
236237
</Flex>
237-
</>
238+
</Layout>
238239
);
239240
};
240241

src/pages/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { Box } from "@chakra-ui/react";
21
import type { NextPage } from "next";
32
import Hero from "@/components/Hero";
3+
import Layout from "@/components/Layout";
44

55
const Home: NextPage = () => {
66
return (
7-
<main>
8-
<Box as="main">
9-
<Hero />
10-
</Box>
11-
</main>
7+
<Layout>
8+
<Hero />
9+
</Layout>
1210
);
1311
};
1412

src/pages/lessons/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import path from "path";
44
import matter from "gray-matter";
55
import { ContentBanner } from "@/components/ContentBanner";
66
import { CONTENT_PATH } from "@/lib/constants";
7+
import Layout from "@/components/Layout";
78

89
interface Lesson {
910
path: string;
@@ -31,8 +32,8 @@ const Lessons: React.FC<LessonProps> = ({ lessons }: { lessons: Lesson[] }) => {
3132
}, {});
3233

3334
return (
34-
<>
35-
<Flex as="main" py={5} px={[4, 10, 16]} direction="column" minH="90vh">
35+
<Layout>
36+
<Flex py={5} px={[4, 10, 16]} direction="column" minH="90vh">
3637
<Stack spacing={5} direction="column">
3738
<>
3839
{Object.entries(result).map((track, idx: number) => {
@@ -56,7 +57,7 @@ const Lessons: React.FC<LessonProps> = ({ lessons }: { lessons: Lesson[] }) => {
5657
</>
5758
</Stack>
5859
</Flex>
59-
</>
60+
</Layout>
6061
);
6162
};
6263

yarn.lock

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,22 +1602,22 @@
16021602
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f"
16031603
integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==
16041604

1605-
"@prisma/client@^4.16.1":
1606-
version "4.16.1"
1607-
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-4.16.1.tgz#030bf59ee51f223bae2a8e7c49827528756cf03a"
1608-
integrity sha512-CoDHu7Bt+NuDo40ijoeHP79EHtECsPBTy3yte5Yo3op8TqXt/kV0OT5OrsWewKvQGKFMHhYQ+ePed3zzjYdGAw==
1605+
"@prisma/client@^5.0.0":
1606+
version "5.0.0"
1607+
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.0.0.tgz#9f0cd4164f4ffddb28bb1811c27eb7fa1e01a087"
1608+
integrity sha512-XlO5ELNAQ7rV4cXIDJUNBEgdLwX3pjtt9Q/RHqDpGf43szpNJx2hJnggfFs7TKNx0cOFsl6KJCSfqr5duEU/bQ==
16091609
dependencies:
1610-
"@prisma/engines-version" "4.16.0-66.b20ead4d3ab9e78ac112966e242ded703f4a052c"
1610+
"@prisma/engines-version" "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584"
16111611

1612-
"@prisma/engines-version@4.16.0-66.b20ead4d3ab9e78ac112966e242ded703f4a052c":
1613-
version "4.16.0-66.b20ead4d3ab9e78ac112966e242ded703f4a052c"
1614-
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-4.16.0-66.b20ead4d3ab9e78ac112966e242ded703f4a052c.tgz#54fd17f9a9080e13e2f75613fd35afb7875e3715"
1615-
integrity sha512-tMWAF/qF00fbUH1HB4Yjmz6bjh7fzkb7Y3NRoUfMlHu6V+O45MGvqwYxqwBjn1BIUXkl3r04W351D4qdJjrgvA==
1612+
"@prisma/engines-version@4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584":
1613+
version "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584"
1614+
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584.tgz#b36eda5620872d3fac810c302a7e46cf41daa033"
1615+
integrity sha512-HHiUF6NixsldsP3JROq07TYBLEjXFKr6PdH8H4gK/XAoTmIplOJBCgrIUMrsRAnEuGyRoRLXKXWUb943+PFoKQ==
16161616

1617-
"@prisma/engines@4.16.1":
1618-
version "4.16.1"
1619-
resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-4.16.1.tgz#ee487620dc5135fd175ac7494b1c60c9f12c1e4b"
1620-
integrity sha512-gpZG0kGGxfemgvK/LghHdBIz+crHkZjzszja94xp4oytpsXrgt/Ice82MvPsWMleVIniKuARrowtsIsim0PFJQ==
1617+
"@prisma/engines@5.0.0":
1618+
version "5.0.0"
1619+
resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-5.0.0.tgz#5249650eabe77c458c90f2be97d8210353c2e22e"
1620+
integrity sha512-kyT/8fd0OpWmhAU5YnY7eP31brW1q1YrTGoblWrhQJDiN/1K+Z8S1kylcmtjqx5wsUGcP1HBWutayA/jtyt+sg==
16211621

16221622
"@rushstack/eslint-patch@^1.1.3":
16231623
version "1.3.2"
@@ -6568,12 +6568,12 @@ pretty-format@^3.8.0:
65686568
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-3.8.0.tgz#bfbed56d5e9a776645f4b1ff7aa1a3ac4fa3c385"
65696569
integrity sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==
65706570

6571-
prisma@^4.16.1:
6572-
version "4.16.1"
6573-
resolved "https://registry.yarnpkg.com/prisma/-/prisma-4.16.1.tgz#c6d723a4326138a72489098a6c39a698a670fbbf"
6574-
integrity sha512-C2Xm7yxHxjFjjscBEW4tmoraPHH/Vyu/A0XABdbaFtoiOZARsxvOM7rwc2iZ0qVxbh0bGBGBWZUSXO/52/nHBQ==
6571+
prisma@^5.0.0:
6572+
version "5.0.0"
6573+
resolved "https://registry.yarnpkg.com/prisma/-/prisma-5.0.0.tgz#f6571c46dc2478172cb7bc1bb62d74026a2c2630"
6574+
integrity sha512-KYWk83Fhi1FH59jSpavAYTt2eoMVW9YKgu8ci0kuUnt6Dup5Qy47pcB4/TLmiPAbhGrxxSz7gsSnJcCmkyPANA==
65756575
dependencies:
6576-
"@prisma/engines" "4.16.1"
6576+
"@prisma/engines" "5.0.0"
65776577

65786578
prismjs@^1.27.0:
65796579
version "1.29.0"

0 commit comments

Comments
 (0)