Update example form names

This commit is contained in:
Jinksi 2017-11-18 14:41:27 +10:00
parent 048d875326
commit 9d2c5c4f22
3 changed files with 8 additions and 4 deletions

View file

@ -5,6 +5,10 @@ import { color } from '../globalStyles'
const fetch = window.fetch const fetch = window.fetch
class Form extends Component { class Form extends Component {
static defaultProps = {
name: 'Controlled Form'
}
state = { state = {
name: '', name: '',
email: '', email: '',
@ -14,7 +18,7 @@ class Form extends Component {
disabled: false, disabled: false,
alert: '', alert: '',
action: '/contact/', action: '/contact/',
'form-name': 'Contact' 'form-name': this.props.name
} }
form = null form = null

View file

@ -3,7 +3,7 @@ import styled from 'styled-components'
import { color } from '../globalStyles' import { color } from '../globalStyles'
export default ({ export default ({
name = 'SimpleForm', name = 'Simple Form',
subject = '', // optional subject of the notification email subject = '', // optional subject of the notification email
action = '' action = ''
}) => ( }) => (

View file

@ -15,10 +15,10 @@ export default ({ page, site }) => (
<Marked source={page.content} /> <Marked source={page.content} />
<br /> <br />
<h3>{'<NetlifyControlledForm />'}</h3> <h3>{'<NetlifyControlledForm />'}</h3>
<NetlifyControlledForm /> <NetlifyControlledForm name={'Controlled Form'} />
<br /> <br />
<h3>{'<NetlifySimpleForm />'}</h3> <h3>{'<NetlifySimpleForm />'}</h3>
<NetlifySimpleForm /> <NetlifySimpleForm name='Simple Form' />
<em>Note: these will only work when deployed on Netlify</em> <em>Note: these will only work when deployed on Netlify</em>
<br /> <br />
<em>Also, they are active and I will receive submissions</em> 😉 <em>Also, they are active and I will receive submissions</em> 😉