Skip to content

Commit 0073e8d

Browse files
committed
replace next/legacy/image with next/image
1 parent 3e45225 commit 0073e8d

File tree

7 files changed

+21
-43
lines changed

7 files changed

+21
-43
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
8484
### Added
8585

8686
### Fixed
87+
- replaced next/legacy/image with next/image
88+
- removed unused function in api/register.js

components/containers/Card.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Image from 'next/legacy/image';
1+
import Image from 'next/image';
22
import Link from 'next/link';
33
import styles from '@/styles/Card.module.scss';
44

@@ -21,13 +21,7 @@ export default function Card({
2121
>
2222
{image && (
2323
<div className={styles.card__image}>
24-
<Image
25-
src={image}
26-
alt={altTag}
27-
className={styles.img}
28-
layout='fill'
29-
objectFit='cover'
30-
/>
24+
<Image src={image} alt={altTag} className={styles.img} fill />
3125
</div>
3226
)}
3327

components/containers/Member.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Image from 'next/legacy/image';
1+
import Image from 'next/image';
22
import styles from '@/styles/Member.module.scss';
33

44
export default function Member({
@@ -15,7 +15,7 @@ export default function Member({
1515
<div className={styles.card}>
1616
{image && (
1717
<div className={styles.card__image}>
18-
<Image src={image} alt={name} className={styles.img} layout='fill' />
18+
<Image src={image} alt={name} className={styles.img} fill />
1919
</div>
2020
)}
2121

@@ -28,8 +28,8 @@ export default function Member({
2828
<Image
2929
src='/images/svg/linkedin-portfolio.svg'
3030
alt='LinkedIn'
31-
height='25px'
32-
width='25px'
31+
height={25}
32+
width={25}
3333
/>
3434
<a
3535
href={`https://linkedin.com/in/${linkedIn}`}
@@ -45,8 +45,8 @@ export default function Member({
4545
<Image
4646
src='/images/svg/globe.svg'
4747
alt='Web Site'
48-
height='25px'
49-
width='25px'
48+
height={25}
49+
width={25}
5050
/>
5151
<a
5252
href={`https://${portfolio}`}

components/containers/TwoColumn.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Image from 'next/legacy/image';
1+
import Image from 'next/image';
22
import ButtonLink from '@/components/buttons/ButtonLink';
33
import Container from '@/components/containers/Container';
44
import styles from '@/styles/TwoColumn.module.scss';
@@ -57,12 +57,7 @@ export default function TwoColumn({
5757
{secondTextColumn && secondTextColumn}
5858
{!secondTextColumn && image && (
5959
<div className={styles.inner__image}>
60-
<Image
61-
src={image}
62-
alt={altTag}
63-
className={styles.img}
64-
layout='fill'
65-
/>
60+
<Image src={image} alt={altTag} className={styles.img} fill />
6661
</div>
6762
)}
6863
</Container>

components/layout/Nav.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useState, useEffect, useRef } from 'react';
2-
import Image from 'next/legacy/image';
32
import { useRouter } from 'next/router';
43
import Container from '@/components/containers/Container';
54
import styles from '@/styles/Nav.module.scss';
@@ -55,17 +54,14 @@ export default function Nav() {
5554
<Container>
5655
<div ref={containerRef}>
5756
<nav className={styles.nav}>
58-
<div className={styles.nav__logo}>
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>
68-
</div>
57+
<a href='/' passhref='true'>
58+
<img
59+
className={styles.nav__logo}
60+
src='/images/svg/logo.svg'
61+
alt='Logo'
62+
title='Go to the Homepage'
63+
/>
64+
</a>
6965
<ul
7066
className={`${styles.nav__links} ${active ? styles.active : ''}`}
7167
>

pages/api/register.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
const sleep = () =>
2-
new Promise(resolve => {
3-
setTimeout(() => {
4-
resolve();
5-
}, 350);
6-
});
7-
81
export default async function handler(req, res) {
92
const SECRET_KEY = process.env.RECAPTCHA_SECRET_KEY;
103

@@ -35,9 +28,6 @@ export default async function handler(req, res) {
3528
const captchaValidation = await response.json();
3629

3730
if (captchaValidation.success) {
38-
// Replace this with the API that will save the data received
39-
// to your backend
40-
await sleep();
4131
// Return 200 if everything is successful
4232
return res.status(200).send('OK');
4333
}

styles/Card.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161

6262
.img {
6363
border-radius: 0.25rem;
64+
object-fit: cover;
6465
}
6566
}
6667

0 commit comments

Comments
 (0)