Skip to content

Commit 872efe1

Browse files
committed
Fix linters errors
1 parent 9d4e58d commit 872efe1

File tree

5 files changed

+78
-78
lines changed

5 files changed

+78
-78
lines changed

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/content_body/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-tabs */
12
import React from 'react';
23
import PropTypes from 'prop-types';
34
import styled from 'styled-components';
Lines changed: 73 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-tabs */
12
import React from 'react';
23
import PropTypes from 'prop-types';
34
import styled from 'styled-components';
@@ -29,97 +30,95 @@ const YearComponentItem = styled.div`
2930
`;
3031

3132
const mapMonth = [
32-
'Jan',
33-
'Feb',
34-
'Mar',
35-
'Apr',
36-
'May',
37-
'Jun',
38-
'Jul',
39-
'Aug',
40-
'Sept',
41-
'Oct',
42-
'Nov',
43-
'Dec'
33+
'Jan',
34+
'Feb',
35+
'Mar',
36+
'Apr',
37+
'May',
38+
'Jun',
39+
'Jul',
40+
'Aug',
41+
'Sept',
42+
'Oct',
43+
'Nov',
44+
'Dec',
4445
];
4546

46-
const handleTransformMonth = (m, t) => {
47-
if (t === 'number') {
48-
return m.length === 1 ? `0${m}` : m;
49-
}
50-
if (t === 'text') {
51-
const index = m - 1;
52-
return mapMonth[index];
53-
}
47+
const handleTransformMonth = (month, type) => {
48+
if (type === 'number') {
49+
return month.length === 1 ? `0${month}` : month;
50+
}
51+
const index = month - 1;
52+
return mapMonth[index];
5453
};
5554

56-
const handleGetDate = (m, t, d, y) => {
57-
const _m = handleTransformMonth(m, t);
55+
const handleGetDate = (month, type, day, year) => {
56+
const newMonth = handleTransformMonth(month, type);
5857

59-
if (d !== '' && m !== '') {
60-
if (t === 'text') {
61-
return `${_m} ${d}, ${y}`;
62-
}
63-
return `${_m}-${d}-${y}`;
64-
}
65-
if (m !== '') {
66-
if (t === 'text') {
67-
return `${_m}, ${y}`;
68-
}
69-
return `${_m}-${y}`;
70-
}
71-
if (d === '' && m === '') {
72-
return y;
73-
}
58+
if (day !== '' && month !== '') {
59+
if (type === 'text') {
60+
return `${newMonth} ${day}, ${year}`;
61+
}
62+
return `${newMonth}-${day}-${year}`;
63+
}
64+
if (month !== '') {
65+
if (type === 'text') {
66+
return `${newMonth}, ${year}`;
67+
}
68+
return `${newMonth}-${year}`;
69+
}
70+
return year;
7471
};
7572

76-
const handlePrintDate = (mounth, day, year, month_type, current) => {
77-
const _date = new Date();
78-
const startDate = handleGetDate(mounth, month_type, day, year);
73+
const handlePrintDate = (mounth, day, year, monthType, current) => {
74+
const date = new Date();
75+
const startDate = handleGetDate(mounth, monthType, day, year);
7976

80-
if (current) {
81-
return (
82-
<>
83-
<YearComponentItem className="item-year-component">
84-
{_date.getFullYear()}
85-
</YearComponentItem>
86-
<YearComponentItem className="item-year-component">
87-
{startDate}
88-
</YearComponentItem>
89-
</>
90-
);
91-
}
92-
return (
93-
<YearComponentItem className="item-year-component">
94-
{startDate}
95-
</YearComponentItem>
96-
);
77+
if (current) {
78+
return (
79+
<>
80+
<YearComponentItem className="item-year-component">
81+
{date.getFullYear()}
82+
</YearComponentItem>
83+
<YearComponentItem className="item-year-component">
84+
{startDate}
85+
</YearComponentItem>
86+
</>
87+
);
88+
}
89+
return (
90+
<YearComponentItem className="item-year-component">
91+
{startDate}
92+
</YearComponentItem>
93+
);
9794
};
9895

99-
const ContentYear = props => {
100-
const { startMonth, startDay, startYear, monthType, currentYear } = props;
96+
const ContentYear = (props) => {
97+
const {
98+
startMonth, startDay, startYear, monthType, currentYear,
99+
} = props;
101100

102-
return (
103-
<YearComponent className="year-component">
104-
{handlePrintDate(startMonth, startDay, startYear, monthType, currentYear)}
105-
</YearComponent>
106-
);
101+
return (
102+
<YearComponent className="year-component">
103+
{handlePrintDate(startMonth, startDay, startYear, monthType, currentYear)}
104+
</YearComponent>
105+
);
107106
};
108107

109108
ContentYear.defaultProps = {
110-
startMonth: '',
111-
monthType: 'number',
112-
startDay: '',
113-
currentYear: false
109+
startMonth: '',
110+
monthType: 'number',
111+
startDay: '',
112+
currentYear: false,
114113
};
115114

116115
ContentYear.propTypes = {
117-
startMonth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
118-
monthType: PropTypes.oneOf(['text', 'number']),
119-
startDay: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
120-
startYear: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
121-
.isRequired,
122-
currentYear: PropTypes.bool
116+
startMonth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
117+
monthType: PropTypes.oneOf(['text', 'number']),
118+
startDay: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
119+
startYear: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
120+
.isRequired,
121+
currentYear: PropTypes.bool,
123122
};
124123

125124
export default ContentYear;

src/components/description/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-tabs */
12
import React from 'react';
23
import PropTypes from 'prop-types';
34
import styled from 'styled-components';
@@ -37,9 +38,7 @@ const Description = (props) => {
3738
<DescriptionComponentTextOptional className="optional-description-component">
3839
{optional}
3940
</DescriptionComponentTextOptional>
40-
) : (
41-
''
42-
)}
41+
) : null}
4342
</DescriptionComponent>
4443
);
4544
};

src/components/timeline/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-tabs */
12
import React from 'react';
23
import PropTypes from 'prop-types';
34
import styled from 'styled-components';

0 commit comments

Comments
 (0)