BenMusch/nu-tab

View on GitHub
client/app/components/schools/CreateSchool.js

Summary

Maintainability
A
1 hr
Test Coverage
import React from 'react'
import {FormControl, ControlLabel, FormGroup, Button} from 'react-bootstrap'
 
export const CreateSchool = (props) => {
return (
<form onSubmit={props.handleSubmit} id="create_school">
<FormGroup controlId="name">
<ControlLabel>New School</ControlLabel>
<FormControl
type="text"
value={props.schoolName}
onChange={props.handleInputChange}
placeholder="School name"
name="name"
/>
</FormGroup>
<Button type="submit">Submit</Button>
</form>
)
}
 
Similar blocks of code found in 2 locations. Consider refactoring.
CreateSchool.propTypes = {
handleSubmit: React.PropTypes.func.isRequired,
handleInputChange: React.PropTypes.func.isRequired,
schoolName: React.PropTypes.string.isRequired
}