mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This PR introduces breaking changes by renaming components. - Rename `next/image` to `next/legacy/image` - Rename `next/future/image` to `next/image` The diff is very confusing because both components are very similar so git got confused.
43 lines
898 B
JavaScript
43 lines
898 B
JavaScript
import React from 'react'
|
|
import Image from 'next/legacy/image'
|
|
import style from '../style.module.css'
|
|
|
|
const Page = () => {
|
|
return (
|
|
<div id="main-container" className={style.mainContainer}>
|
|
<h1>Image Style Inheritance</h1>
|
|
<Image
|
|
id="img-fixed"
|
|
layout="fixed"
|
|
src="/test.jpg"
|
|
width="400"
|
|
height="400"
|
|
/>
|
|
|
|
<Image
|
|
id="img-intrinsic"
|
|
layout="intrinsic"
|
|
src="/test.jpg"
|
|
width="400"
|
|
height="400"
|
|
/>
|
|
|
|
<div style={{ position: 'relative', width: '200px', height: '200px' }}>
|
|
<Image id="img-fill" layout="fill" src="/test.jpg" objectFit="cover" />
|
|
</div>
|
|
|
|
<Image
|
|
id="img-responsive"
|
|
layout="responsive"
|
|
src="/test.jpg"
|
|
width="400"
|
|
height="400"
|
|
/>
|
|
|
|
<footer>Footer</footer>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Page
|