Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(components/Dialog): spread props [BR] #1159

Merged
merged 11 commits into from
Mar 19, 2018

Conversation

jmfrancois
Copy link
Collaborator

@jmfrancois jmfrancois commented Mar 9, 2018

What is the problem this PR is trying to solve?

You can't add id, className, and other props to the modal you have to use bsDialogProps.

What is the chosen solution to this problem?

Spread all props to the Modal component
And remove bsDialogProps (BREAKING CHANGE)

Please check if the PR fulfills these requirements

  • The PR commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Related design / discussions / pages (not in jira), if any, are all linked or available in the PR
  • This PR introduces a breaking change

Before

	const bsDialogProps = {
		dialogClassName: 'tmc-conductor-dialog',
		keyboard: true,
		onHide: dispatchProps.cancelItemsRemove,
	};
        return <Dialog bsDialogProps={bsDialogProps}/>

after

	const bsDialogProps = {
		dialogClassName: 'tmc-conductor-dialog',
		keyboard: true,
		onHide: dispatchProps.cancelItemsRemove,
	};
        return <Dialog {...bsDialogProps} />

tips: if you use the connected version you can do onHideDispatch

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@jmfrancois jmfrancois changed the title fix(components/modal): spread props fix(components/Dialog): spread props Mar 9, 2018
@jmfrancois jmfrancois changed the title fix(components/Dialog): spread props fix(components/Dialog): spread props [BR] Mar 9, 2018
@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@@ -50,16 +71,16 @@ Dialog.defaultProps = {

Dialog.propTypes = {
header: PropTypes.string,
size: PropTypes.oneOf(['small', 'large']),
size: PropTypes.oneOf(['sm', 'small', 'lg', 'large']),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have 'sm' and 'small' (same for 'lg' and 'large') ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one alone is not enough?

Copy link
Collaborator Author

@jmfrancois jmfrancois Mar 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes they are the same and both exists in bootstrap

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@jmfrancois jmfrancois merged commit 1963548 into master Mar 19, 2018
@jmfrancois jmfrancois deleted the jmfrancois/fix/modal-spread-props branch March 19, 2018 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants