Skip to content

Commit 400563c

Browse files
Preparing links to updgrade Next to 13
1 parent 7e99616 commit 400563c

File tree

6 files changed

+57
-66
lines changed

6 files changed

+57
-66
lines changed

components/containers/Card.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export default function Card({
1111
{linkText}
1212
</a>
1313
) : (
14-
<Link href={link}>{linkText}</Link>
14+
<Link href={link} legacyBehavior>
15+
{linkText}
16+
</Link>
1517
);
1618
return (
1719
<div

components/layout/Footer.js

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import Link from 'next/link';
21
import footerStyles from '@/styles/Footer.module.scss';
32
import { linksNav, linksSocial } from '@/utils/links';
43
import NewsletterSubscribe from '@/components/mailchimp/NewsletterSubscribe';
@@ -10,24 +9,26 @@ export default function Footer() {
109
<footer className={footerStyles.footer}>
1110
<NewsletterSubscribe />
1211
<Container customClass={footerStyles.footer__inner}>
13-
<Link href='/'>
14-
<a className={footerStyles.footer__logo} title='Go to the Homepage'>
15-
<Image
16-
src='/images/svg/logo.svg'
17-
height={250}
18-
width={250}
19-
alt='Our footer logo'
20-
/>
21-
</a>
22-
</Link>
12+
<a
13+
href='/'
14+
className={footerStyles.footer__logo}
15+
title='Go to the Homepage'
16+
>
17+
<Image
18+
src='/images/svg/logo.svg'
19+
height={250}
20+
width={250}
21+
alt='Our footer logo'
22+
/>
23+
</a>
2324
<div className={footerStyles.footer__navSocialsDiv}>
2425
<nav className={footerStyles.footer__nav} aria-label='Main'>
2526
<ul className={footerStyles.footer__navList}>
2627
{linksNav.map(link => (
2728
<li className={footerStyles.footer__navItem} key={link.text}>
28-
<Link href={link.href}>
29-
<a title={link.text}>{link.text}</a>
30-
</Link>
29+
<a href={link.href} title={link.text}>
30+
{link.text}
31+
</a>
3132
</li>
3233
))}
3334
</ul>
@@ -41,17 +42,15 @@ export default function Footer() {
4142
className={footerStyles.footer__socialItem}
4243
key={link.text}
4344
>
44-
<Link href={link.href}>
45-
<a title={link.text} target='_blank'>
46-
<Image
47-
href={link.href}
48-
src={link.src}
49-
height={65}
50-
width={47}
51-
alt={link.alt}
52-
/>
53-
</a>
54-
</Link>
45+
<a href={link.href} title={link.text} target='_blank'>
46+
<Image
47+
href={link.href}
48+
src={link.src}
49+
height={65}
50+
width={47}
51+
alt={link.alt}
52+
/>
53+
</a>
5554
</li>
5655
))}
5756
</ul>

components/layout/Nav.js

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useState, useEffect, useRef } from 'react';
2-
import Link from 'next/link';
32
import Image from 'next/image';
43
import { useRouter } from 'next/router';
54
import Container from '@/components/containers/Container';
@@ -57,48 +56,44 @@ export default function Nav() {
5756
<div ref={containerRef}>
5857
<nav className={styles.nav}>
5958
<div className={styles.nav__logo}>
60-
<Link href='/' passHref>
61-
<a>
62-
<Image
63-
src='/images/svg/logo.svg'
64-
height={115}
65-
width={180}
66-
alt='Logo'
67-
title='Go to the Homepage'
68-
/>
69-
</a>
70-
</Link>
59+
<a href='/' passhref='true'>
60+
<Image
61+
src='/images/svg/logo.svg'
62+
height={115}
63+
width={180}
64+
alt='Logo'
65+
title='Go to the Homepage'
66+
/>
67+
</a>
7168
</div>
7269
<ul
7370
className={`${styles.nav__links} ${active ? styles.active : ''}`}
7471
>
7572
{linksNav.map(({ text, href, id }) => {
7673
return (
7774
<li className={styles.nav__item} key={id}>
78-
<Link href={href}>
79-
<a
80-
className={`${styles.nav__link} ${
81-
router.pathname == href ? `${styles.current}` : ''
82-
}`}
83-
title={text}
84-
>
85-
{text}
86-
</a>
87-
</Link>
75+
<a
76+
href={href}
77+
className={`${styles.nav__link} ${
78+
router.pathname == href ? `${styles.current}` : ''
79+
}`}
80+
title={text}
81+
>
82+
{text}
83+
</a>
8884
</li>
8985
);
9086
})}
9187
<li className={styles.nav__item}>
92-
<Link href='mailto:[email protected]?subject=Project collaborator application'>
93-
<a
94-
className={`${styles.nav__button} ${
95-
active ? styles.active : ''
96-
}`}
97-
title='Join us'
98-
>
99-
Join us
100-
</a>
101-
</Link>
88+
<a
89+
href='mailto:[email protected]?subject=Project collaborator application'
90+
className={`${styles.nav__button} ${
91+
active ? styles.active : ''
92+
}`}
93+
title='Join us'
94+
>
95+
Join us
96+
</a>
10297
</li>
10398
</ul>
10499
<button

pages/404.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ export default function NotFound() {
66
<h1>Ooops...</h1>
77
<h2>That page cannot be found :(</h2>
88
<p>
9-
Go back to the{' '}
10-
<Link href='/'>
11-
<a>Homepage</a>
12-
</Link>
9+
Go back to the <Link href='/'>Homepage</Link>
1310
</p>
1411
</div>
1512
);

pages/blog/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ export default function Blog() {
77
<p>We're building this page. Stay tuned!</p>
88
<ul>
99
<li>
10-
<Link href='/blog/first-post'>
11-
<a>First Post</a>
12-
</Link>
10+
<Link href='/blog/first-post'>First Post</Link>
1311
</li>
1412
</ul>
1513
</div>

pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default function Home() {
4141
altTag: 'Join the project',
4242
content:
4343
'Are you learning web development and need mentorship? Are you a web dev looking for help or a code buddy for a project?',
44-
link: "/about'",
44+
link: '/about',
4545
linkText: 'Learn more',
4646
},
4747
{

0 commit comments

Comments
 (0)