[examples] Bump Next.js to 11.1.0 (#6582)

This commit is contained in:
Steven
2021-08-11 15:41:38 -04:00
committed by GitHub
parent 9af3054d41
commit a07e6fc103
8 changed files with 1604 additions and 285 deletions

View File

@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}

View File

@@ -29,6 +29,6 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
## Deploy on Vercel ## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/import?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

View File

@@ -0,0 +1,3 @@
module.exports = {
reactStrictMode: true,
}

View File

@@ -5,11 +5,16 @@
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start" "start": "next start",
"lint": "next lint"
}, },
"dependencies": { "dependencies": {
"next": "10.x", "next": "11.1.0",
"react": "17.x", "react": "17.0.2",
"react-dom": "17.x" "react-dom": "17.0.2"
},
"devDependencies": {
"eslint": "7.32.0",
"eslint-config-next": "11.1.0"
} }
} }

View File

@@ -1,6 +1,5 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default (req, res) => { export default function handler(req, res) {
res.statusCode = 200 res.status(200).json({ name: 'John Doe' })
res.json({ name: 'John Doe' })
} }

View File

@@ -1,4 +1,5 @@
import Head from 'next/head' import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css' import styles from '../styles/Home.module.css'
export default function Home() { export default function Home() {
@@ -6,6 +7,7 @@ export default function Home() {
<div className={styles.container}> <div className={styles.container}>
<Head> <Head>
<title>Create Next App</title> <title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
</Head> </Head>
@@ -21,12 +23,12 @@ export default function Home() {
<div className={styles.grid}> <div className={styles.grid}>
<a href="https://nextjs.org/docs" className={styles.card}> <a href="https://nextjs.org/docs" className={styles.card}>
<h3>Documentation &rarr;</h3> <h2>Documentation &rarr;</h2>
<p>Find in-depth information about Next.js features and API.</p> <p>Find in-depth information about Next.js features and API.</p>
</a> </a>
<a href="https://nextjs.org/learn" className={styles.card}> <a href="https://nextjs.org/learn" className={styles.card}>
<h3>Learn &rarr;</h3> <h2>Learn &rarr;</h2>
<p>Learn about Next.js in an interactive course with quizzes!</p> <p>Learn about Next.js in an interactive course with quizzes!</p>
</a> </a>
@@ -34,15 +36,15 @@ export default function Home() {
href="https://github.com/vercel/next.js/tree/master/examples" href="https://github.com/vercel/next.js/tree/master/examples"
className={styles.card} className={styles.card}
> >
<h3>Examples &rarr;</h3> <h2>Examples &rarr;</h2>
<p>Discover and deploy boilerplate example Next.js projects.</p> <p>Discover and deploy boilerplate example Next.js projects.</p>
</a> </a>
<a <a
href="https://vercel.com/import?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card} className={styles.card}
> >
<h3>Deploy &rarr;</h3> <h2>Deploy &rarr;</h2>
<p> <p>
Instantly deploy your Next.js site to a public URL with Vercel. Instantly deploy your Next.js site to a public URL with Vercel.
</p> </p>
@@ -57,7 +59,9 @@ export default function Home() {
rel="noopener noreferrer" rel="noopener noreferrer"
> >
Powered by{' '} Powered by{' '}
<img src="/vercel.svg" alt="Vercel Logo" className={styles.logo} /> <span className={styles.logo}>
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
</span>
</a> </a>
</footer> </footer>
</div> </div>

View File

@@ -5,6 +5,7 @@
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100vh;
} }
.main { .main {
@@ -25,14 +26,11 @@
align-items: center; align-items: center;
} }
.footer img {
margin-left: 0.5rem;
}
.footer a { .footer a {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-grow: 1;
} }
.title a { .title a {
@@ -82,7 +80,6 @@
.card { .card {
margin: 1rem; margin: 1rem;
flex-basis: 45%;
padding: 1.5rem; padding: 1.5rem;
text-align: left; text-align: left;
color: inherit; color: inherit;
@@ -90,6 +87,7 @@
border: 1px solid #eaeaea; border: 1px solid #eaeaea;
border-radius: 10px; border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease; transition: color 0.15s ease, border-color 0.15s ease;
width: 45%;
} }
.card:hover, .card:hover,
@@ -99,7 +97,7 @@
border-color: #0070f3; border-color: #0070f3;
} }
.card h3 { .card h2 {
margin: 0 0 1rem 0; margin: 0 0 1rem 0;
font-size: 1.5rem; font-size: 1.5rem;
} }
@@ -112,6 +110,7 @@
.logo { .logo {
height: 1em; height: 1em;
margin-left: 0.5rem;
} }
@media (max-width: 600px) { @media (max-width: 600px) {

File diff suppressed because it is too large Load Diff