Skip to content

Commit 1251ab9

Browse files
committed
Lint fixes
1 parent 085586e commit 1251ab9

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

client/src/components/Posts/PostForm.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { Button, Form, FormFeedback, Col, Row } from 'reactstrap';
66

77
import { InputField, TextArea, SelectField, required } from '../../forms';
88

9-
export const PostFormPart = ({values, part}) => {
10-
switch(values.type) {
9+
export const PostFormPart = ({ values, part }) => {
10+
switch (values.type) {
1111
case 'image':
1212
return (
1313
<div>
@@ -17,11 +17,12 @@ export const PostFormPart = ({values, part}) => {
1717
name={`${part}.imageUrl`}
1818
placeholder={'Image url...'}
1919
component={InputField}
20-
/> <Field
21-
name={`${part}.description`}
22-
placeholder={'Image description...'}
23-
component={InputField}
24-
/>
20+
/>
21+
<Field
22+
name={`${part}.description`}
23+
placeholder={'Image description...'}
24+
component={InputField}
25+
/>
2526
</div>
2627
);
2728
case 'text':
@@ -33,23 +34,25 @@ export const PostFormPart = ({values, part}) => {
3334
component={TextArea}
3435
/>
3536
);
36-
};
37+
default:
38+
return null;
39+
}
3740
};
3841

3942
export const PostFormParts = ({ parts, fields, meta: { error } }) => (
4043
<div className="my-3">
4144
{fields.map((part, index) =>
42-
<div>
45+
<div key={index}>
4346
<hr />
44-
<Row key={index}>
47+
<Row>
4548
<Col xs="10">
4649
<PostFormPart values={parts[index]} part={part} />
4750
</Col>
4851
<Col xs="2">
4952
<Button color="danger" onClick={() => fields.remove(index)}>X</Button>
5053
</Col>
5154
</Row>
52-
</div>
55+
</div>,
5356
)}
5457
{error && <FormFeedback>{error}</FormFeedback>}
5558
<Button onClick={() => fields.push({ type: 'text' })} className="mr-2">Add Text</Button>
@@ -104,7 +107,7 @@ const validate = (values) => {
104107

105108
const selector = formValueSelector('post');
106109

107-
export const mapStateToProps = (state) => ({
110+
export const mapStateToProps = state => ({
108111
parts: selector(state, 'parts'),
109112
});
110113

@@ -113,5 +116,5 @@ export default reduxForm({
113116
form: 'post',
114117
validate,
115118
})(
116-
connect(mapStateToProps)(PostForm)
119+
connect(mapStateToProps)(PostForm),
117120
);

client/src/hocs/withResourceList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
getList,
1414
} from '../store/api';
1515

16-
const withResourceList = (resourceKey) => (WrappedComponent) => {
16+
const withResourceList = resourceKey => (WrappedComponent) => {
1717
const enhance = compose(
1818
withHandlers({
1919
onFilter: props => (filter) => {

0 commit comments

Comments
 (0)