Skip to content

Commit 491d276

Browse files
kgregorysilvenon
authored andcommitted
Eliminate Col's reverse property (#98)
- Col's reverse property was a boolean that would apply the 'reverse' class if true. However, there is no support for reverse for columns in flexboxgrid. There is a .col.reverse class defined, but it sets the flex-direction to column-reverse, which has no effect on an element that is not displayed as flex. Also, columns are not given the .col class in the way that rows are given the .row class, so the designation of .reverse on a Col would not even cause these rules to be applied. The .col.reverse class appears to be lint, left over from an abandoned attempt to support columnar flexboxes in the flexboxgrid package. See: kristoferjoseph/flexboxgrid#173
1 parent 0b6a0ee commit 491d276

File tree

3 files changed

+0
-11
lines changed

3 files changed

+0
-11
lines changed

react-flexbox-grid.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ declare namespace __ReactFlexboxGrid {
4040
readonly lgOffset?: number,
4141
readonly first?: ViewportSizeType,
4242
readonly last?: ViewportSizeType,
43-
readonly reverse?: boolean,
4443
readonly className?: string,
4544
readonly tagName?: string,
4645
}

src/components/Col.js

-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const propTypes = {
1414
lgOffset: PropTypes.number,
1515
first: ViewportSizeType,
1616
last: ViewportSizeType,
17-
reverse: PropTypes.bool,
1817
className: PropTypes.string,
1918
tagName: PropTypes.string,
2019
children: PropTypes.node
@@ -50,10 +49,6 @@ function getColClassNames(props) {
5049
extraClasses.push(getClass('last-' + props.last));
5150
}
5251

53-
if (props.reverse) {
54-
extraClasses.push(getClass('reverse'));
55-
}
56-
5752
return Object.keys(props)
5853
.filter(key => classMap[key])
5954
.map(key => getClass(isInteger(props[key]) ? (classMap[key] + '-' + props[key]) : classMap[key]))

test/components/Col.spec.js

-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ describe('Col', () => {
2828
expect(renderer.getRenderOutput().props.className).toContain(style['first-md']);
2929
});
3030

31-
it('Should add "reverse" class if "reverse" property is true', () => {
32-
renderer.render(<Col reverse/>);
33-
expect(renderer.getRenderOutput().props.className).toContain(style.reverse);
34-
});
35-
3631
it('Should not replace class', () => {
3732
renderer.render(<Col className="foo" md={3} />);
3833

0 commit comments

Comments
 (0)