Created
December 17, 2019 11:34
-
-
Save indreklasn/9b4f071a0d46a601bc77f58ef8de041e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { Form, Button, Input } from 'antd'; | |
import { createNote } from '../api' | |
const NoteForm = ({ form, notes, setNotes }) => { | |
const { getFieldDecorator, validateFields, resetFields } = form; | |
function handleSubmit(e) { | |
e.preventDefault(); | |
} | |
return ( | |
<Form style={{marginBottom: '25px'}} layout="horizontal" onSubmit={handleSubmit}> | |
<Form.Item> | |
{getFieldDecorator('note', { | |
rules: [], | |
})( | |
<Input | |
className="note-input" | |
size="large" | |
placeholder="Add New Note" | |
/>, | |
<Button>Create</Button> | |
)} | |
</Form.Item> | |
</Form> | |
) | |
} | |
const WrappedNoteForm = Form.create({name: 'notes_form'})(NoteForm) | |
export default WrappedNoteForm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment