-
Notifications
You must be signed in to change notification settings - Fork 6
fix(useDialogContainer): defaultContainerProps #691
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
Conversation
🦋 Changeset detectedLatest commit: 496a7d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
❌ Deploy Preview for cube-uikit-docs failed.
|
📦 NPM canary releaseDeployed canary version 0.0.0-canary-52b5bf6. |
🏗 Docs are successfully deployed!👀 Preview: https://68418c24677316d9e5f8ed2e--cube-uikit-docs.netlify.app |
🧪 Storybook is successfully deployed!
|
🏋️ Size limit report
Click here if you want to find out what is changed in this build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for specifying default props on the DialogContainer in the useDialogContainer hook and ensures they’re merged correctly.
- Introduce and document the
defaultContainerPropsparameter in the hook signature. - Change the spread of container props to
mergeProps(defaultContainerProps, containerProps)on theDialogContainer. - Remove inappropriate merging of
defaultContainerPropsinto the dialog content component and update effect dependencies to includedefaultContainerProps.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/components/overlays/Dialog/dialog-container.tsx | Add defaultContainerProps JSDoc, update merge logic for container props, adjust component props spread, and update hook dependencies |
| .changeset/afraid-mugs-sneeze.md | Add patch changeset entry describing the fix to defaultContainerProps handling |
Comments suppressed due to low confidence (3)
src/components/overlays/Dialog/dialog-container.tsx:18
- Specify in the JSDoc that
defaultContainerPropsis optional and, if possible, reference its generic type (e.g.,CP) to make the signature clearer for consumers.
* @param defaultContainerProps - Default props to pass to the DialogContainer.
src/components/overlays/Dialog/dialog-container.tsx:69
- Introduce unit tests covering scenarios where
defaultContainerPropsis provided alone, overridden bycontainerProps, and both combined, to ensure the merged output behaves as intended.
{...mergeProps(defaultContainerProps, containerProps || undefined)}
src/components/overlays/Dialog/dialog-container.tsx:69
- [nitpick] Since
mergePropsalready handlesundefined, you can simplify this call tomergeProps(defaultContainerProps, containerProps)and drop the|| undefinedfallback.
{...mergeProps(defaultContainerProps, containerProps || undefined)}
No description provided.