Skip to content

Commit 3a0b705

Browse files
authored
Merge pull request #189 from Developer-DAO/upgrade-nextjs-13.x
Upgrade to Next.js 13.x. Clean up unused code.
2 parents 768f84f + eed1c98 commit 3a0b705

File tree

14 files changed

+3823
-13080
lines changed

14 files changed

+3823
-13080
lines changed

.storybook/main.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

.storybook/preview.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

components/ContentBanner.tsx

Lines changed: 41 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Flex, Heading, Wrap, WrapItem } from '@chakra-ui/react'
2-
import Link from 'next/link'
2+
import NextLink from 'next/link'
33
import Image from 'next/image'
44

55
interface LessonProps {
@@ -27,28 +27,22 @@ export const ContentBanner: React.FC<LessonProps> = (props: LessonProps) => {
2727

2828
return (
2929
<>
30-
<Link key={slug} href={`/lessons/${path}/${slug}`} passHref>
31-
<a>
32-
<Flex direction="column" bg="gray.800" p={5} rounded={5}>
33-
<Flex
34-
direction="row"
35-
justify="space-between"
36-
align="center"
37-
// bg="#35363A"
38-
>
39-
<Flex direction="column" justifyContent="center">
40-
<Flex color="#FFD500">
41-
<Heading
42-
as="h3"
43-
apply="mdx.h3"
44-
fontSize={[14, 14, 16]}
45-
my={2}
46-
>
47-
{title}
48-
</Heading>
49-
</Flex>
30+
<NextLink key={slug} href={`/lessons/${path}/${slug}`} passHref>
31+
<Flex direction="column" bg="gray.800" p={5} rounded={5}>
32+
<Flex
33+
direction="row"
34+
justify="space-between"
35+
align="center"
36+
// bg="#35363A"
37+
>
38+
<Flex direction="column" justifyContent="center">
39+
<Flex color="#FFD500">
40+
<Heading as="h3" apply="mdx.h3" fontSize={[14, 14, 16]} my={2}>
41+
{title}
42+
</Heading>
5043
</Flex>
51-
{/* <Flex
44+
</Flex>
45+
{/* <Flex
5246
bg="#00000f"
5347
fontSize={[0, 6, 8, 10]}
5448
px={2}
@@ -58,33 +52,32 @@ export const ContentBanner: React.FC<LessonProps> = (props: LessonProps) => {
5852
>
5953
Lesson {idx + 1}
6054
</Flex> */}
61-
<Wrap ml={20}>
62-
{icons &&
63-
icons.map((icon: string, idx: number) => (
64-
<WrapItem
65-
key={idx}
66-
bg="#FFFFFF"
67-
p={1.5}
68-
rounded={'50%'}
69-
mx="auto"
70-
title={icon}
71-
>
72-
<Image
73-
src={`/assets/${icon}.png`}
74-
width={16}
75-
height={16}
76-
alt={icon}
77-
/>
78-
</WrapItem>
79-
))}
80-
</Wrap>
81-
</Flex>
82-
<Flex fontSize={[10, 10, 12, 14]} pt={4}>
83-
{description}
84-
</Flex>
55+
<Wrap ml={20}>
56+
{icons &&
57+
icons.map((icon: string, idx: number) => (
58+
<WrapItem
59+
key={idx}
60+
bg="#FFFFFF"
61+
p={1.5}
62+
rounded={'50%'}
63+
mx="auto"
64+
title={icon}
65+
>
66+
<Image
67+
src={`/assets/${icon}.png`}
68+
width={16}
69+
height={16}
70+
alt={icon}
71+
/>
72+
</WrapItem>
73+
))}
74+
</Wrap>
75+
</Flex>
76+
<Flex fontSize={[10, 10, 12, 14]} pt={4}>
77+
{description}
8578
</Flex>
86-
</a>
87-
</Link>
79+
</Flex>
80+
</NextLink>
8881
</>
8982
)
9083
}

components/NavBar.tsx

Lines changed: 73 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ import {
1515
import HamburgerIcon from '@components/HamburgerIcon'
1616
import SchoolOfCodeLogo from '@components/SchoolOfCodeLogo'
1717
import { PomodoroTimer } from '@components/PomodoroTimer'
18-
// import { ConnectButton } from '@rainbow-me/rainbowkit'
1918

2019
function NavBar() {
2120
const router = useRouter()
2221
return (
2322
<Box>
2423
<Flex justify="left" alignItems="center">
25-
<Link variant="logo" href={'/'}>
24+
<Link as={NextLink} variant="logo" href={'/'}>
2625
{router.pathname.endsWith('/[slug]') ? (
2726
<SchoolOfCodeLogo />
2827
) : (
@@ -53,43 +52,46 @@ function NavBar() {
5352
/>
5453
<MenuList backgroundColor={'soc.vividViolet'}>
5554
<MenuItem>
56-
<NextLink href="/" passHref>
57-
<Link
58-
variant={
59-
router.pathname === '/'
60-
? 'top-navigation-active'
61-
: 'top-navigation'
62-
}
63-
>
64-
Home
65-
</Link>
66-
</NextLink>
55+
<Link
56+
as={NextLink}
57+
href="/"
58+
passHref
59+
variant={
60+
router.pathname === '/'
61+
? 'top-navigation-active'
62+
: 'top-navigation'
63+
}
64+
>
65+
Home
66+
</Link>
6767
</MenuItem>
6868
<MenuItem>
69-
<NextLink href="/getting-started" passHref>
70-
<Link
71-
variant={
72-
router.pathname.startsWith('/getting-started')
73-
? 'top-navigation-active'
74-
: 'top-navigation'
75-
}
76-
>
77-
GET STARTED
78-
</Link>
79-
</NextLink>
69+
<Link
70+
as={NextLink}
71+
href="/getting-started"
72+
passHref
73+
variant={
74+
router.pathname.startsWith('/getting-started')
75+
? 'top-navigation-active'
76+
: 'top-navigation'
77+
}
78+
>
79+
GET STARTED
80+
</Link>
8081
</MenuItem>
8182
<MenuItem>
82-
<NextLink href="/lessons" passHref>
83-
<Link
84-
variant={
85-
router.pathname.startsWith('/lessons')
86-
? 'top-navigation-active'
87-
: 'top-navigation'
88-
}
89-
>
90-
Tracks
91-
</Link>
92-
</NextLink>
83+
<Link
84+
as={NextLink}
85+
href="/lessons"
86+
passHref
87+
variant={
88+
router.pathname.startsWith('/lessons')
89+
? 'top-navigation-active'
90+
: 'top-navigation'
91+
}
92+
>
93+
Tracks
94+
</Link>
9395
</MenuItem>
9496
</MenuList>
9597
</Menu>
@@ -103,41 +105,44 @@ function NavBar() {
103105
alignItems="center"
104106
display={{ base: 'none', md: 'none', lg: 'block' }}
105107
>
106-
<NextLink href="/" passHref>
107-
<Link
108-
variant={
109-
router.pathname === '/'
110-
? 'top-navigation-active'
111-
: 'top-navigation'
112-
}
113-
>
114-
Home
115-
</Link>
116-
</NextLink>
108+
<Link
109+
as={NextLink}
110+
href="/"
111+
passHref
112+
variant={
113+
router.pathname === '/'
114+
? 'top-navigation-active'
115+
: 'top-navigation'
116+
}
117+
>
118+
Home
119+
</Link>
117120

118-
<NextLink href="/getting-started" passHref>
119-
<Link
120-
variant={
121-
router.pathname.startsWith('/getting-started')
122-
? 'top-navigation-active'
123-
: 'top-navigation'
124-
}
125-
>
126-
Get Started
127-
</Link>
128-
</NextLink>
121+
<Link
122+
as={NextLink}
123+
href="/getting-started"
124+
passHref
125+
variant={
126+
router.pathname.startsWith('/getting-started')
127+
? 'top-navigation-active'
128+
: 'top-navigation'
129+
}
130+
>
131+
Get Started
132+
</Link>
129133

130-
<NextLink href="/lessons" passHref>
131-
<Link
132-
variant={
133-
router.pathname.startsWith('/lessons')
134-
? 'top-navigation-active'
135-
: 'top-navigation'
136-
}
137-
>
138-
Tracks
139-
</Link>
140-
</NextLink>
134+
<Link
135+
as={NextLink}
136+
href="/lessons"
137+
passHref
138+
variant={
139+
router.pathname.startsWith('/lessons')
140+
? 'top-navigation-active'
141+
: 'top-navigation'
142+
}
143+
>
144+
Tracks
145+
</Link>
141146

142147
{/* <Button colorScheme="gray" variant="solid">
143148
<ConnectButton chainStatus="icon" showBalance={false} />

components/PomodoroTimer.stories.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)