rsnext/examples/with-ant-design/pages/index.js
Marcus Silva 0b9475624f
chore: remove-redundant-example-import (#13175)
This issue is related to #12964 

**I changed the following examples:**
`with-zeit-fetch` 
`with-why-did-you-render`
`with-styletron`
`custom-server-fastify`
`custom-server-express`
`with-why-did-you-render`
`custom-server-hapi`
`custom-server-koa`
`custom-server-polka`
`custom-server-typescript`
`progressive-render`
`ssr-caching`
`svg-components`
`using-preact`
`with-ant-design`
2020-05-22 16:13:37 +00:00

104 lines
2.6 KiB
JavaScript

import { Form, Select, InputNumber, Switch, Slider, Button } from 'antd'
// Custom DatePicker that uses Day.js instead of Moment.js
import DatePicker from '../components/DatePicker'
import { SmileFilled } from '@ant-design/icons'
import Link from 'next/link'
const FormItem = Form.Item
const Option = Select.Option
const content = {
marginTop: '100px',
}
export default function Home() {
return (
<div style={content}>
<div className="text-center mb-5">
<Link href="#">
<a className="logo mr-0">
<SmileFilled size={48} strokeWidth={1} />
</a>
</Link>
<p className="mb-0 mt-3 text-disabled">Welcome to the world !</p>
</div>
<div>
<Form layout="horizontal">
<FormItem
label="Input Number"
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<InputNumber
size="large"
min={1}
max={10}
style={{ width: 100 }}
defaultValue={3}
name="inputNumber"
/>
</FormItem>
<FormItem
label="Switch"
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<Switch defaultChecked name="switch" />
</FormItem>
<FormItem
label="Slider"
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<Slider defaultValue={70} />
</FormItem>
<FormItem
label="Select"
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<Select
size="large"
defaultValue="lucy"
style={{ width: 192 }}
name="select"
>
<Option value="jack">jack</Option>
<Option value="lucy">lucy</Option>
<Option value="disabled" disabled>
disabled
</Option>
<Option value="yiminghe">yiminghe</Option>
</Select>
</FormItem>
<FormItem
label="DatePicker"
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<DatePicker name="startDate" />
</FormItem>
<FormItem
style={{ marginTop: 48 }}
wrapperCol={{ span: 8, offset: 8 }}
>
<Button size="large" type="primary" htmlType="submit">
OK
</Button>
<Button size="large" style={{ marginLeft: 8 }}>
Cancel
</Button>
</FormItem>
</Form>
</div>
</div>
)
}