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 in usePickersLayout and useXXXPicker #14994

Merged
merged 11 commits into from
Oct 29, 2024

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Oct 16, 2024

Part of #14475

@flaviendelangle flaviendelangle marked this pull request as draft October 16, 2024 08:31
@mui-bot
Copy link

mui-bot commented Oct 16, 2024

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

Generated by 🚫 dangerJS against d60ccfb

@flaviendelangle flaviendelangle force-pushed the ownerState-layout-field branch from 68cfb79 to 17806c3 Compare October 16, 2024 08:36
wrapperVariant: WrapperVariant;
isLandscape: boolean;
Copy link
Member Author

Choose a reason for hiding this comment

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

We could move those two variables to PickerOwnerState (they are available at the usePicker level).

But not sure how much isLandscape makes sense to be accessible everywhere.

Copy link
Member

Choose a reason for hiding this comment

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

We can always do that if we see a need, but IMHO, it would be nice to avoid optional parameters, which might never be defined if someone is not using a Static Picker. 🤷 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

which might never be defined if someone is not using a Static Picker.

We could just set it to "desktop" on the destkop picker and "mobile" on the mobile picker.
But I agree, let's wait for an actual need 👍

@flaviendelangle flaviendelangle self-assigned this Oct 16, 2024
@flaviendelangle flaviendelangle added breaking change component: pickers This is the name of the generic UI component, not the React module! labels Oct 16, 2024
@flaviendelangle flaviendelangle force-pushed the ownerState-layout-field branch from 17806c3 to 625d829 Compare October 16, 2024 08:52
@flaviendelangle flaviendelangle force-pushed the ownerState-layout-field branch from 625d829 to e37a166 Compare October 16, 2024 09:10
@flaviendelangle flaviendelangle changed the title [pickers] Use new ownerState for the field, actionBar, shortcuts and toolbar slots [pickers] Use the new ownerState for the field, actionBar, shortcuts and toolbar slots Oct 16, 2024
@flaviendelangle flaviendelangle marked this pull request as ready for review October 22, 2024 07:34
@flaviendelangle flaviendelangle changed the title [pickers] Use the new ownerState for the field, actionBar, shortcuts and toolbar slots [pickers] Use the new ownerState for the field, inputAdornment, openPickerButton, actionBar, shortcuts and toolbar slots Oct 22, 2024
@flaviendelangle flaviendelangle changed the title [pickers] Use the new ownerState for the field, inputAdornment, openPickerButton, actionBar, shortcuts and toolbar slots [pickers] Use the new ownerState for the slots handled by usePickersLayout and useXXXPicker Oct 22, 2024
@flaviendelangle flaviendelangle changed the title [pickers] Use the new ownerState for the slots handled by usePickersLayout and useXXXPicker [pickers] Use the new ownerState in usePickersLayout and useXXXPicker Oct 22, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 28, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 28, 2024
Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

Very nice typing and usage improvement! 💙 💯 👏

wrapperVariant: WrapperVariant;
isLandscape: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

We can always do that if we see a need, but IMHO, it would be nice to avoid optional parameters, which might never be defined if someone is not using a Static Picker. 🤷 🤔

…ontext.ts

Co-authored-by: Lukas Tyla <[email protected]>
Signed-off-by: Flavien DELANGLE <[email protected]>
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.

3 participants