Skip to content

Commit 1db8885

Browse files
authored
Merge pull request #237 from Markkos89/staging
feat: infinite refetchs fixed & new db tables
2 parents 1512758 + 9a44ef8 commit 1db8885

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1415
-454
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ yarn-error.log*
3434
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
3535
.env
3636
.env*.local
37+
.env
3738

3839
# vercel
3940
.vercel

next.config.mjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@ const config = {
4646
config.resolve.fallback = { fs: false, net: false, tls: false };
4747
return config;
4848
},
49+
async headers() {
50+
return [
51+
{
52+
// matching all API routes
53+
source: "/api/:path*",
54+
headers: [
55+
{ key: "Access-Control-Allow-Credentials", value: "true" },
56+
{ key: "Access-Control-Allow-Origin", value: "*" },
57+
{
58+
key: "Access-Control-Allow-Methods",
59+
value: "GET,OPTIONS,PATCH,DELETE,POST,PUT",
60+
},
61+
{
62+
key: "Access-Control-Allow-Headers",
63+
value:
64+
"X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version",
65+
},
66+
],
67+
},
68+
];
69+
},
4970
};
5071

5172
export default withMDX(config);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "t3-app-siwe",
2+
"name": "academy-t3-dapp",
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
@@ -35,6 +35,7 @@
3535
"framer-motion": "^10.12.17",
3636
"next": "^13.4.7",
3737
"next-auth": "^4.22.1",
38+
"next-seo": "^6.1.0",
3839
"react": "18.2.0",
3940
"react-dom": "18.2.0",
4041
"react-icons": "^4.10.1",

prisma/seed.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@ async function main() {
1515
// },
1616
// });
1717
// console.log({ user });
18-
// const lesson1 = await prisma.lessons.create({
18+
// const newLesson = await prisma.lessons.create({
1919
// data: {
20-
// quizFileName: "lesson-4-quiz.json",
20+
// quizFileName: "quiz-lesson-4.json",
2121
// },
2222
// });
23-
// console.log({ lesson1 });
24-
const completed2 = await prisma.completedQuizzes.create({
25-
data: {
26-
userId: "cll3hcuim00001wujlay766tk",
27-
lesson: "2",
28-
completed: true,
29-
},
30-
});
31-
console.log({ completed2 });
23+
// console.log({ newLesson });
24+
// const deletedCompletedLog = await prisma.completedQuizzes.deleteMany({});
25+
// console.log({ deletedCompletedLog });
26+
// const completed2 = await prisma.completedQuizzes.create({
27+
// data: {
28+
// userId: "cll3hcuim00001wujlay766tk",
29+
// lesson: "2",
30+
// completed: true,
31+
// },
32+
// });
33+
// console.log({ completed2 });
3234
}
3335

3436
main()

src/components/Hero.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
} from "@chakra-ui/react";
1212
import { ArrowForwardIcon } from "@chakra-ui/icons";
1313
import Image from "next/image";
14+
import NextLink from "next/link";
1415

1516
const Hero = () => {
1617
return (
@@ -43,6 +44,7 @@ const Hero = () => {
4344
</Text>
4445

4546
<Link
47+
as={NextLink}
4648
href={"/getting-started"}
4749
alignSelf={{ base: "center", md: "flex-start" }}
4850
>

src/components/Layout.tsx

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,58 @@
11
import { Box } from "@chakra-ui/react";
22
import Topbar from "./Topbar";
33
import Footer from "./footer/Footer";
4+
import { NextSeo } from "next-seo";
45

56
interface Props {
67
children: React.ReactNode;
8+
title: string;
9+
description?: string;
710
}
811

9-
export default function Layout({ children }: Props) {
12+
export default function Layout({ children, title, description }: Props) {
1013
return (
1114
<>
15+
<NextSeo
16+
title={`Developer DAO Academy | ${title}`}
17+
description={description}
18+
openGraph={{
19+
type: "website",
20+
locale: "en_US",
21+
url: `https://${
22+
process.env.NEXT_PUBLIC_VERCEL_URL as string
23+
}/landing-page-screenshot.png`,
24+
site_name: `Developer DAO Academy`,
25+
title: `Developer DAO Academy | ${title}`,
26+
description: description,
27+
images: [
28+
{
29+
url: `https://${
30+
process.env.NEXT_PUBLIC_VERCEL_URL as string
31+
}/landing-page-screenshot.png`,
32+
alt: "Developer DAO Academy",
33+
type: "image/png",
34+
},
35+
],
36+
}}
37+
twitter={{
38+
handle: "@devdao_academy",
39+
site: "@devdao_academy",
40+
cardType: "summary_large_image",
41+
}}
42+
additionalLinkTags={[
43+
{
44+
rel: "icon",
45+
href: "/favicon/favicon.ico",
46+
},
47+
]}
48+
/>
1249
<Topbar />
1350
<Box
1451
as="main"
1552
p="1.25em"
1653
px="5%"
1754
mx={{ base: "2rem", md: "6rem", lg: "10rem" }}
55+
minH={{ base: "calc(75vh - 3.5rem)" }}
1856
>
1957
{children}
2058
</Box>

src/components/PageSeoLayout.tsx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { NextSeo } from "next-seo";
2+
3+
interface PageSeoLayoutProps {
4+
title: string;
5+
description?: string;
6+
children?: React.ReactNode;
7+
}
8+
9+
const PageSeoLayout = ({
10+
title,
11+
description,
12+
children,
13+
}: PageSeoLayoutProps) => {
14+
return (
15+
<>
16+
<NextSeo
17+
title={`Developer DAO Academy | ${title}`}
18+
description={description}
19+
openGraph={{
20+
type: "website",
21+
locale: "en_US",
22+
url: `https://${
23+
process.env.NEXT_PUBLIC_VERCEL_URL as string
24+
}/landing-page-screenshot.png`,
25+
site_name: `Developer DAO Academy`,
26+
title: `Developer DAO Academy | ${title}`,
27+
description: description,
28+
images: [
29+
{
30+
url: `https://${
31+
process.env.NEXT_PUBLIC_VERCEL_URL as string
32+
}/landing-page-screenshot.png`,
33+
alt: "Developer DAO Academy",
34+
type: "image/png",
35+
},
36+
],
37+
}}
38+
twitter={{
39+
handle: "@devdao_academy",
40+
site: "@devdao_academy",
41+
cardType: "summary_large_image",
42+
}}
43+
additionalLinkTags={[
44+
{
45+
rel: "icon",
46+
href: "/favicon/favicon.ico",
47+
},
48+
]}
49+
/>
50+
{children}
51+
</>
52+
);
53+
};
54+
55+
export default PageSeoLayout;

src/components/Topbar.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ const DesktopNav = () => {
143143
<PopoverTrigger>
144144
<Link
145145
p={2}
146+
as={NextLink}
146147
href={navItem.href ?? "#"}
147148
// fontSize={'sm'}
148149
// fontWeight={500}
@@ -187,6 +188,7 @@ const DesktopNav = () => {
187188
const DesktopSubNav = ({ label, href, subLabel }: NavItem) => {
188189
return (
189190
<Link
191+
as={NextLink}
190192
href={href}
191193
role={"group"}
192194
display={"block"}
@@ -242,7 +244,7 @@ const MobileNavItem = ({ label, children, href }: NavItem) => {
242244
<Stack spacing={4} onClick={children && onToggle}>
243245
<Flex
244246
py={2}
245-
as={Link}
247+
as={NextLink}
246248
href={href ?? "#"}
247249
justify={"space-between"}
248250
align={"center"}
@@ -278,7 +280,7 @@ const MobileNavItem = ({ label, children, href }: NavItem) => {
278280
>
279281
{children &&
280282
children.map((child) => (
281-
<Link key={child.label} py={2} href={child.href}>
283+
<Link key={child.label} as={NextLink} py={2} href={child.href}>
282284
{child.label}
283285
</Link>
284286
))}

src/components/footer/Footer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export default function Footer() {
1616
// bg={useColorModeValue('#00000f', '#1d1e20')}
1717
color={useColorModeValue("gray.700", "gray.200")}
1818
as="footer"
19+
p="1.25em"
20+
px="5%"
21+
mx={{ base: "2rem", md: "6rem", lg: "10rem" }}
1922
>
2023
<Container
2124
as={Stack}

src/components/mdx/ContributorFooter.tsx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ export function ContributorFooter({
2626
{authors.length > 1 ? "Authors" : "Author"}
2727
</Text>
2828
<VStack spacing={4} alignItems="left">
29-
{authors.map((contrib, idx) => {
30-
return (
31-
<Contributor key={idx} handle={contrib} avatarSize="2xl" />
32-
);
33-
})}
29+
{authors.map((contrib, idx) => (
30+
<Contributor key={idx} handle={contrib} avatarSize="2xl" />
31+
))}
3432
</VStack>
3533
</Box>
3634
)}
@@ -41,9 +39,9 @@ export function ContributorFooter({
4139
{reviewers.length > 1 ? "Reviewers" : "Reviewer"}
4240
</Text>
4341
<VStack spacing={4} alignItems="left">
44-
{reviewers.map((contrib, idx) => {
45-
return <Contributor key={idx} handle={contrib} avatarSize="lg" />;
46-
})}
42+
{reviewers.map((contrib, idx) => (
43+
<Contributor key={idx} handle={contrib} avatarSize="lg" />
44+
))}
4745
</VStack>
4846
</Box>
4947
)}
@@ -58,11 +56,9 @@ export function ContributorFooter({
5856
: "Additional Contributor"}
5957
</Text>
6058
<VStack spacing={4} alignItems="left">
61-
{contributors.map((contrib, idx) => {
62-
return (
63-
<Contributor key={idx} handle={contrib} avatarSize="lg" />
64-
);
65-
})}
59+
{contributors.map((contrib, idx) => (
60+
<Contributor key={idx} handle={contrib} avatarSize="lg" />
61+
))}
6662
</VStack>
6763
</Box>
6864
)}

0 commit comments

Comments
 (0)