Skip to content

Commit bc35771

Browse files
committed
make addnewbanner a functional component, relates #154
1 parent 68f74d5 commit bc35771

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/components/Cases/Title.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import PropTypes from "prop-types";
55

66
const CasesPageTitle = props => <h1 id="title">{props.stationName}</h1>;
77

8-
export default CasesPageTitle;
9-
108
CasesPageTitle.propTypes = {
119
stationName: PropTypes.string
1210
};
11+
12+
export default CasesPageTitle;

src/components/Pages/AddNew/AddNewBanner.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,16 @@ const StyledCase = styled.div`
1717
border: none;
1818
`;
1919

20-
export default class AddNewBanner extends React.Component {
21-
render() {
22-
return (
23-
<Link to={`/${this.props.exam}/${this.props.station}/add-case`}>
24-
<StyledCase onClick={this.props.submitStation}> Add New</StyledCase>
25-
</Link>
26-
);
27-
}
28-
}
20+
const AddNewBanner = props => (
21+
<Link to={`/${props.exam}/${props.station}/add-case`}>
22+
<StyledCase onClick={props.submitStation}> Add New</StyledCase>
23+
</Link>
24+
);
2925

3026
AddNewBanner.propTypes = {
3127
exam: PropTypes.string,
3228
station: PropTypes.string,
3329
submitStation: PropTypes.func
3430
};
31+
32+
export default AddNewBanner;

0 commit comments

Comments
 (0)