import { Query, Mutation } from 'react-apollo' import { adopt } from 'react-adopt' import { Formik, Form } from 'formik' import { TextInput } from '../lib/forms' import { BLOCKS, CREATE_BLOCK } from '../lib/graphql' import Overlay from './overlay' const ContentInput = props => { const [displayForm, setDisplayForm] = React.useState(false) const toggleForm = ev => { ev.preventDefault() setDisplayForm(!displayForm) } return ( {({ data, error, loading }) => ( <>
{displayForm ? ( ) : null} )}
) } const ContentAdoption = adopt({ mutation: ({ render }) => ( {(createTrainingType, { data, error, loading }) => render({ createTrainingType, data, error, loading })} ), form: ({ mutation: { createTrainingType }, render }) => ( createTrainingType({ variables: values })} > {render} ) }) const ContentForm = props => ( {({ mutation, form }) => (
)}
) export { ContentForm } export default ContentInput