Skip to content

Commit

Permalink
Convert blog cover images to next/image (#42908)
Browse files Browse the repository at this point in the history
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
  • Loading branch information
steven-tey committed Nov 14, 2022
1 parent ad61e84 commit 0d2a3de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/blog-starter/components/cover-image.tsx
@@ -1,5 +1,6 @@
import cn from 'classnames'
import Link from 'next/link'
import Image from 'next/image'

type Props = {
title: string
Expand All @@ -9,12 +10,14 @@ type Props = {

const CoverImage = ({ title, src, slug }: Props) => {
const image = (
<img
<Image
src={src}
alt={`Cover Image for ${title}`}
className={cn('shadow-sm', {
'hover:shadow-lg transition-shadow duration-200': slug,
})}
width={1300}
height={630}
/>
)
return (
Expand Down

0 comments on commit 0d2a3de

Please sign in to comment.