mirror of
https://github.com/franjsco/tick3t
synced 2025-03-20 13:30:27 +01:00
refactor: SearchForm component
This commit is contained in:
parent
4e146f4dd5
commit
53f7bda915
@ -1,4 +1,4 @@
|
||||
import React, { Component } from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
Row,
|
||||
Col,
|
||||
@ -15,41 +15,33 @@ const style = {
|
||||
backgroundImage: 'linear-gradient(to left, #0eaed3, #8346f6)',
|
||||
}
|
||||
|
||||
class SearchForm extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Form onSubmit={this.props.onSubmit}>
|
||||
<Row form>
|
||||
<Col md={12}>
|
||||
<FormGroup>
|
||||
<InputGroup>
|
||||
<Input
|
||||
type="input"
|
||||
name={this.props.name}
|
||||
id={this.props.id}
|
||||
placeholder={this.props.placeholder}
|
||||
onChange={this.props.onChange}
|
||||
value={this.props.ticketId}
|
||||
/>
|
||||
<InputGroupAddon addonType="append">
|
||||
<Button type="submit" style={style}>
|
||||
{this.props.buttonName}</Button>
|
||||
</InputGroupAddon>
|
||||
</InputGroup>
|
||||
</FormGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const SearchForm = (props) => {
|
||||
return (
|
||||
<div>
|
||||
<Form onSubmit={props.onSubmit}>
|
||||
<Row form>
|
||||
<Col md={12}>
|
||||
<FormGroup>
|
||||
<InputGroup>
|
||||
<Input
|
||||
type="input"
|
||||
name={props.name}
|
||||
id={props.id}
|
||||
placeholder={props.placeholder}
|
||||
onChange={props.onChange}
|
||||
value={props.ticketId}
|
||||
/>
|
||||
<InputGroupAddon addonType="append">
|
||||
<Button type="submit" style={style}>
|
||||
{props.buttonName}</Button>
|
||||
</InputGroupAddon>
|
||||
</InputGroup>
|
||||
</FormGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default SearchForm;
|
Loading…
x
Reference in New Issue
Block a user