Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Fix upload to Netlify
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixHenninger committed Aug 18, 2020
1 parent 66bd2d1 commit 398d63c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { Component, createRef, forwardRef } from 'react'
import { ReactReduxContext } from 'react-redux'
import { findDOMNode } from 'react-dom'

import { Formik, Field } from 'formik'
import { Formik, Field, Form } from 'formik'
import { Input } from '../../../Form'

import { FormGroup, Label, FormText,
Expand All @@ -21,12 +22,11 @@ const validateApiKey = value => {

const NetlifyForm = forwardRef(({ onSubmit }, ref) =>
<Formik
ref={ ref }
initialValues={{ site: '', apiKey: '' }}
onSubmit={ onSubmit }
>
{({ errors, touched }) => (
<>
<Form ref={ ref }>
<FormGroup>
<Label for="site">
Study domain/site{' '}
Expand Down Expand Up @@ -56,7 +56,7 @@ const NetlifyForm = forwardRef(({ onSubmit }, ref) =>
You'll need to <a href="https://app.netlify.com/account/applications" target="_blank" rel="noopener noreferrer">create an API token</a> or enter an existing one. We don't save or share this information, so make sure to jot it down!
</FormText>
</FormGroup>
</>
</Form>
)}
</Formik>
)
Expand All @@ -73,7 +73,7 @@ class NetlifyWidget extends Component {
}

triggerSubmit() {
this.formRef.current.submitForm()
findDOMNode(this.formRef.current).requestSubmit()
}

async send(data) {
Expand Down

0 comments on commit 398d63c

Please sign in to comment.