-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: no more using reactstrap defaultProps
Seems like we were using implementation details of reactstrap that we probably should not have needed.
- Loading branch information
1 parent
cdf77ab
commit d3c538e
Showing
9 changed files
with
26 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
import React from 'react'; | ||
import { Modal } from 'reactstrap'; | ||
|
||
Modal.defaultProps = { | ||
...Modal.defaultProps, | ||
backdrop: false, | ||
fade: false, | ||
zIndex: 10050, | ||
}; | ||
|
||
export default Modal; | ||
export default ({ backdrop = false, fade = false, zIndex = 10050, ...props }) => ( | ||
<Modal {...props} backdrop={backdrop} fade={fade} zIndex={zIndex} /> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
import React from 'react'; | ||
import { Progress } from 'reactstrap'; | ||
|
||
Progress.defaultProps = { | ||
...Progress.defaultProps, | ||
animated: true, | ||
}; | ||
|
||
export default Progress; | ||
export default ({ animated = true, ...props }) => <Progress {...props} animated={animated} />; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import assert from 'assert'; | ||
import { mount } from 'enzyme'; | ||
import { render, screen } from '@testing-library/react'; | ||
import React from 'react'; | ||
import Progress from './Progress'; | ||
|
||
describe('<Progress />', () => { | ||
it('should render correctly', () => { | ||
const component = mount(<Progress />); | ||
assert(component); | ||
it('should render with the correct default props', () => { | ||
render(<Progress />); | ||
const progressBar = screen.getByRole('progressbar'); | ||
expect(progressBar).toHaveClass('progress-bar-animated'); | ||
}); | ||
|
||
it('should render with the correct default props', () => { | ||
const component = mount(<Progress />); | ||
const props = component.props(); | ||
assert.equal(props.animated, true); | ||
render(<Progress animated={false} />); | ||
const progressBar = screen.getByRole('progressbar'); | ||
expect(progressBar).not.toHaveClass('progress-bar-animated'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
import { UncontrolledTooltip } from 'reactstrap'; | ||
|
||
UncontrolledTooltip.defaultProps = { | ||
...UncontrolledTooltip.defaultProps, | ||
}; | ||
|
||
export default UncontrolledTooltip; |