Skip to content

Commit 2195730

Browse files
committed
Fix react-dates#625 - Rename AFTER_POSITION to ICON_AFTER_POSITION to be consistant + Use constant instead of string
1 parent e572cb4 commit 2195730

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
VERTICAL_SCROLLABLE: 'verticalScrollable',
1212

1313
ICON_BEFORE_POSITION: 'before',
14-
AFTER_POSITION: 'after',
14+
ICON_AFTER_POSITION: 'after',
1515

1616
ANCHOR_LEFT: 'left',
1717
ANCHOR_RIGHT: 'right',

src/components/DateRangePickerInput.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import LeftArrow from '../svg/arrow-left.svg';
1414
import CloseButton from '../svg/close.svg';
1515
import CalendarIcon from '../svg/calendar.svg';
1616

17-
import { START_DATE, END_DATE, ICON_BEFORE_POSITION } from '../../constants';
17+
import { START_DATE, END_DATE, ICON_BEFORE_POSITION, ICON_AFTER_POSITION } from '../../constants';
1818

1919
const propTypes = forbidExtraProps({
2020
startDateId: PropTypes.string,
@@ -189,7 +189,7 @@ export default class DateRangePickerInput extends React.Component {
189189
})}
190190
>
191191

192-
{ inputIconPosition === ICON_BEFORE_POSITION && inputIcon }
192+
{inputIconPosition === ICON_BEFORE_POSITION && inputIcon}
193193

194194
<DateInput
195195
id={startDateId}
@@ -257,7 +257,7 @@ export default class DateRangePickerInput extends React.Component {
257257
</button>
258258
)}
259259

260-
{ inputIconPosition === 'after' && inputIcon }
260+
{inputIconPosition === ICON_AFTER_POSITION && inputIcon}
261261

262262
</div>
263263
);

src/components/SingleDatePickerInput.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import IconPositionShape from '../shapes/IconPositionShape';
1212
import CloseButton from '../svg/close.svg';
1313
import CalendarIcon from '../svg/calendar.svg';
1414

15-
import { ICON_BEFORE_POSITION } from '../../constants';
15+
import { ICON_BEFORE_POSITION, ICON_AFTER_POSITION } from '../../constants';
1616

1717
const propTypes = forbidExtraProps({
1818
id: PropTypes.string.isRequired,
@@ -146,7 +146,7 @@ export default class SingleDatePickerInput extends React.Component {
146146
})}
147147
>
148148

149-
{ inputIconPosition === ICON_BEFORE_POSITION && inputIcon }
149+
{inputIconPosition === ICON_BEFORE_POSITION && inputIcon}
150150

151151
<DateInput
152152
id={id}
@@ -185,7 +185,7 @@ export default class SingleDatePickerInput extends React.Component {
185185
</button>
186186
)}
187187

188-
{ inputIconPosition === 'after' && inputIcon }
188+
{inputIconPosition === ICON_AFTER_POSITION && inputIcon}
189189

190190
</div>
191191
);

src/shapes/IconPositionShape.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
22

33
import {
44
ICON_BEFORE_POSITION,
5-
AFTER_POSITION,
5+
ICON_AFTER_POSITION,
66
} from '../../constants';
77

8-
export default PropTypes.oneOf([ICON_BEFORE_POSITION, AFTER_POSITION]);
8+
export default PropTypes.oneOf([ICON_BEFORE_POSITION, ICON_AFTER_POSITION]);

0 commit comments

Comments
 (0)