function Generator({ location }: Props) { return ( <Layout> <Header> <Logo /> </Header> <SideNav /> <Content> <Form location={location} /> <LoadablePreview hideOnMobile /> </Content> <Footer> <Progress /> </Footer> </Layout> ) }
const CreateProduct = () => { return ( <Fragment> <BaseHero /> <Form onSubmit={handleCreateProduct} /> </Fragment> ) }
const PersonForm = (props) => { const { handleSubmit } = props; return (<Form onSubmit={handleSubmit}> <div> <label htmlFor="firstName">First Name</label> <Field name="firstName" component="input" type="text" /> </div> <div> <label htmlFor="lastName">Last Name</label> <Field name="lastName" component="input" type="text" /> </div> <RaisedButton type="submit">Submit</RaisedButton> </Form>); }
render() { const {result} = this.props.netflix return ( <div className="container"> <div className="jumbotron"> <Form onSubmit={this.handleSubmit.bind(this)} /> </div> <div className="row"> {result && <Movie props={result} />} </div> <div className="row"> <h4>Output</h4> {JSON.stringify(result)} </div> </div> ) }
const EditProduct = ({ isFetching, product, match }) => { if (isFetching) { return <Loading /> } const { id } = match.params return ( <Fragment> <BaseHero /> <Form onSubmit={(values, dispatch) => { handleSubmitProduct(id, values, dispatch) }} initialValues={product} coverImage={product.coverImage} /> </Fragment> ) }
// callApi = async () => { // const response = await fetch('/api/ping'); // const body = await response.json(); // if (response.status !== 200) throw Error(body.message); // return body; // }; render() { const { connected, query } = this.props; if (connected) { return ( <div className="App"> <Form /> {query && <Results /> } </div> ); } else if (connected === false) { return <div className="App">Server is unavailable. Please make sure you entered <code>yarn dev</code></div> } else { return <div className="App">Connecting to server...</div> } }
const CreateProduct = () => { return ( <Fragment> <BaseHero /> <Form onSubmit={handleCreateProduct} /> </Fragment> ) }