1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Update with-ant-design example (#5141)

There is no need to wrap every page with a component when you can use the custom document.
This commit is contained in:
Rafael Almeida 2018-09-12 12:24:37 -03:00 committed by Tim Neutkens
parent b79bbecb13
commit 5d147a82c4
3 changed files with 75 additions and 73 deletions

View file

@ -1,14 +0,0 @@
import Head from 'next/head'
export default ({ children }) =>
<div>
<Head>
<meta name='viewport' content='width=device-width, initial-scale=1' />
<meta charSet='utf-8' />
<link rel='stylesheet' href='/_next/static/style.css' />
</Head>
<style jsx global>{`
body {
}
`}</style>
{children}
</div>

View file

@ -0,0 +1,19 @@
import Document, { Head, Main, NextScript } from 'next/document'
export default class MyDocument extends Document {
render () {
return (
<html>
<Head>
<meta name='viewport' content='width=device-width, initial-scale=1' />
<meta charSet='utf-8' />
<link rel='stylesheet' href='/_next/static/style.css' />
</Head>
<body>
<Main />
<NextScript />
</body>
</html>
)
}
}

View file

@ -1,11 +1,9 @@
import Layout from '../index.js'
import { Form, Select, InputNumber, DatePicker, Switch, Slider, Button } from 'antd'
const FormItem = Form.Item
const Option = Select.Option
export default () => (
<Layout>
<div style={{ marginTop: 100 }}>
<Form layout='horizontal'>
<FormItem
@ -66,5 +64,4 @@ export default () => (
</FormItem>
</Form>
</div>
</Layout>
)