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

[pickers] Use the new ownerState object for the clock components and the desktop / mobile wrappers #15669

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

flaviendelangle
Copy link
Member

Part of #14475

@mui-bot
Copy link

mui-bot commented Nov 29, 2024

Deploy preview: https://deploy-preview-15669--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 4b1a5d1

@flaviendelangle flaviendelangle marked this pull request as ready for review November 29, 2024 08:23
@flaviendelangle flaviendelangle changed the title [pickers] Use the new ownerState object for the clock components and the desktop / mobile wrappers [pickers] Use the new ownerState object for the clock components and the desktop / mobile wrappers Nov 29, 2024
const { ownerState: pickerOwnerState } = usePickerPrivateContext();
const ownerState: DigitalClockOwnerState = {
...pickerOwnerState,
hasDigitalClockAlreadyBeenRendered: !!containerRef.current,
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm cleaning the name of this property to keep everything clearly scoped (like isPickerDisabled vs disabled).

/**
* The current meridiem mode of the clock.
*/
clockMeridiemMode: Meridiem | null;
Copy link
Member Author

Choose a reason for hiding this comment

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

Same, I'm correctly scoping isClockDisabled to the clock to distinguish it from isPickerDisabled

@@ -370,7 +379,7 @@ export function Clock(inProps: ClockProps) {
type={type}
viewValue={viewValue}
isInner={isPointerInner}
hasSelected={hasSelected}
isBetweenTwoClockValues={isPointerBetweenTwoClockValues}
Copy link
Member Author

Choose a reason for hiding this comment

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

The hasSelected prop name was very unclear to be.
Since it's used in the ownerState of ClockPointer, I added a better name to it.

@@ -63,7 +89,7 @@ const ClockNumberRoot = styled('span', {
},
variants: [
{
props: { inner: true },
props: { isClockNumberInInnerRing: true },
Copy link
Member Author

Choose a reason for hiding this comment

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

Same, inner was very unclear, I made the name more explicit.

@@ -340,10 +342,11 @@ export function PickersPopper(inProps: PickerPopperProps) {
onDismiss,
open,
role,
placement,
placement = 'bottom',
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm applying the default value here to make sure all the slots inside this file get a popperPlacement property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants