Skip to content

Commit

Permalink
feat(bs5): change no-gutters class to gx-0 in Row (#2119)
Browse files Browse the repository at this point in the history
* feat(bs5): change no-gutters class to gx-0

* chore(Row): Add noGutters deprecation warning

Co-authored-by: Adina Johnson <adina.johnson@appfolio.com>
  • Loading branch information
2 people authored and phwebi committed Oct 27, 2021
1 parent be4df60 commit 85b8933
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Row.js
@@ -1,14 +1,14 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { mapToCssModules, tagPropType } from './utils';
import { mapToCssModules, tagPropType, deprecated } from './utils';

const rowColWidths = ['xs', 'sm', 'md', 'lg', 'xl'];
const rowColsPropType = PropTypes.oneOfType([PropTypes.number, PropTypes.string]);

const propTypes = {
tag: tagPropType,
noGutters: PropTypes.bool,
noGutters: deprecated(PropTypes.bool, "Please use Bootstrap 5 gutter utility classes. https://getbootstrap.com/docs/5.0/layout/gutters/"),
className: PropTypes.string,
cssModule: PropTypes.object,
form: PropTypes.bool,
Expand Down Expand Up @@ -52,7 +52,7 @@ const Row = (props) => {

const classes = mapToCssModules(classNames(
className,
noGutters ? 'no-gutters' : null,
noGutters ? 'gx-0' : null,
form ? 'form-row' : 'row',
colClasses
), cssModule);
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/Row.spec.js
Expand Up @@ -22,10 +22,10 @@ describe('Row', () => {
expect(wrapper.hasClass('row')).toBe(true);
});

it('show render noGutters classes', () => {
it('show render noGutters class as gx-0', () => {
const wrapper = shallow(<Row noGutters />);

expect(wrapper.hasClass('no-gutters')).toBe(true);
expect(wrapper.hasClass('gx-0')).toBe(true);
expect(wrapper.hasClass('row')).toBe(true);
});

Expand Down

0 comments on commit 85b8933

Please sign in to comment.