-
Notifications
You must be signed in to change notification settings - Fork 622
chore: Refactor components to use BoxWithFallback instead of custom Box if statements and remove defaultSxProp references #6278
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
…eferences - Updated CircleBadge snapshots to reflect class name changes. - Refactored CounterLabel to use BoxWithFallback and removed defaultSxProp. - Modified DataTable's TableContainer to utilize BoxWithFallback. - Changed Details component to use BoxWithFallback instead of Box. - Updated FormControl to replace Box with BoxWithFallback. - Refactored Header, InlineMessage, Pagehead, Radio, SegmentedControl, and SubNav components to use BoxWithFallback. - Simplified Spinner component by using BoxWithFallback. - Updated Timeline components to utilize BoxWithFallback for consistency. - Removed defaultSxProp references across various components for cleaner code.
🦋 Changeset detectedLatest commit: 5d2d0db 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 |
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/389116 |
@@ -25,7 +24,7 @@ export type ActionListDescriptionProps = { | |||
|
|||
export const Description: React.FC<React.PropsWithChildren<ActionListDescriptionProps>> = ({ | |||
variant = 'inline', | |||
sx = defaultSxProp, | |||
sx, |
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.
I removed the default assignment here because the BoxWithFallback component also will set sx = defaultSxProp
@@ -22,13 +21,12 @@ const Heading: React.FC<HeadingProps & React.HTMLAttributes<HTMLHeadingElement>> | |||
as: Component = 'h3', | |||
className, | |||
children, | |||
sx = defaultSxProp, |
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.
Anywhere where the props were spreading anyways like this {...rest}
I removed the argument. I felt this was cleaner and will help us later when we drop the sx support (only needing to remove the SxProp type)
🟢 golden-jobs completed with status |
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.
Phew, what a refactor 💯 Just left a couple style comments but honestly not too important. Thanks for doing this!
Co-authored-by: Josh Black <[email protected]>
👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks! |
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.
✨
I wanted to go through all the components using
defaultSxProp
and see if we can refactor them to useBoxWithFallback
which is essentially doing the same checksxProp != defaultSxProp
.Benefits
Box
componentAI summary of changes
Changelog
New
Changed
Removed
Rollout strategy
Testing & Reviewing
Merge checklist