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

View File

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

View File

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