1
0
mirror of https://github.com/franjsco/tick3t synced 2025-03-23 15:00:10 +01:00

refactor: SearchForm component

This commit is contained in:
Francesco Esposito 2019-07-31 15:55:36 +02:00
parent 4e146f4dd5
commit 53f7bda915

@ -1,4 +1,4 @@
import React, { Component } from 'react'; import React from 'react';
import { import {
Row, Row,
Col, Col,
@ -15,41 +15,33 @@ const style = {
backgroundImage: 'linear-gradient(to left, #0eaed3, #8346f6)', backgroundImage: 'linear-gradient(to left, #0eaed3, #8346f6)',
} }
class SearchForm extends Component { const SearchForm = (props) => {
constructor(props) { return (
super(props); <div>
<Form onSubmit={props.onSubmit}>
this.state = {}; <Row form>
} <Col md={12}>
<FormGroup>
render() { <InputGroup>
return ( <Input
<div> type="input"
<Form onSubmit={this.props.onSubmit}> name={props.name}
<Row form> id={props.id}
<Col md={12}> placeholder={props.placeholder}
<FormGroup> onChange={props.onChange}
<InputGroup> value={props.ticketId}
<Input />
type="input" <InputGroupAddon addonType="append">
name={this.props.name} <Button type="submit" style={style}>
id={this.props.id} {props.buttonName}</Button>
placeholder={this.props.placeholder} </InputGroupAddon>
onChange={this.props.onChange} </InputGroup>
value={this.props.ticketId} </FormGroup>
/> </Col>
<InputGroupAddon addonType="append"> </Row>
<Button type="submit" style={style}> </Form>
{this.props.buttonName}</Button> </div>
</InputGroupAddon> );
</InputGroup>
</FormGroup>
</Col>
</Row>
</Form>
</div>
);
}
} }
export default SearchForm; export default SearchForm;