Add next/image component to Universe

This commit is contained in:
Marcus Blättermann 2023-01-24 08:06:58 +01:00
parent e599a13247
commit d5d02f46ff
No known key found for this signature in database
GPG Key ID: A1E1F04008AC450D
3 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import ImageNext from 'next/image'
import Link from './link'
import { H5 } from './typography'
@ -18,8 +19,7 @@ export default function Card({ title, to, image, header, small, onClick, childre
<H5 className={classes.title}>
{image && (
<div className={classes.image}>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={image} width={35} alt="" />
<ImageNext src={image} height={35} width={35} alt="" />
</div>
)}
{title && (

View File

@ -51,8 +51,7 @@ export default function Title({
{image && (
<div className={classes.image}>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={image} width={100} height={100} alt="" />
<Image src={image} width={100} height={100} alt="" />
</div>
)}
</div>

View File

@ -81,10 +81,11 @@ const UniverseContent = ({ content = [], categories, theme, pageContext, mdxComp
}
const url = `/universe/project/${id}`
const header = youtube && (
// eslint-disable-next-line @next/next/no-img-element
<img
<Image
src={`https://img.youtube.com/vi/${youtube}/0.jpg`}
alt=""
width="480"
height="360"
style={{
clipPath: 'inset(12.9% 0)',
marginBottom: 'calc(-12.9% + 1rem)',