1
0
mirror of https://github.com/franjsco/tick3t synced 2025-03-19 13:00:06 +01:00

refactor: SearchForm component

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

View File

@ -1,4 +1,4 @@
import React, { Component } from 'react'; import React from 'react';
import { import {
Row, Row,
Col, Col,
@ -15,32 +15,25 @@ 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) {
super(props);
this.state = {};
}
render() {
return ( return (
<div> <div>
<Form onSubmit={this.props.onSubmit}> <Form onSubmit={props.onSubmit}>
<Row form> <Row form>
<Col md={12}> <Col md={12}>
<FormGroup> <FormGroup>
<InputGroup> <InputGroup>
<Input <Input
type="input" type="input"
name={this.props.name} name={props.name}
id={this.props.id} id={props.id}
placeholder={this.props.placeholder} placeholder={props.placeholder}
onChange={this.props.onChange} onChange={props.onChange}
value={this.props.ticketId} value={props.ticketId}
/> />
<InputGroupAddon addonType="append"> <InputGroupAddon addonType="append">
<Button type="submit" style={style}> <Button type="submit" style={style}>
{this.props.buttonName}</Button> {props.buttonName}</Button>
</InputGroupAddon> </InputGroupAddon>
</InputGroup> </InputGroup>
</FormGroup> </FormGroup>
@ -50,6 +43,5 @@ class SearchForm extends Component {
</div> </div>
); );
} }
}
export default SearchForm; export default SearchForm;