-
Notifications
You must be signed in to change notification settings - Fork 14
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
refactor: migrate Modal to TailwindCSS #3800
base: master
Are you sure you want to change the base?
Conversation
|
@@ -63,6 +63,7 @@ | |||
"@changesets/get-github-info": "^0.5.1", | |||
"@cypress/skip-test": "^2.6.1", | |||
"@storybook/addon-a11y": "^6.5.15", | |||
"@storybook/addon-styling": "0.3", |
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.
we need to stick to the 0.x
version till we update to storybook 7
packages/picasso/src/Modal/Modal.tsx
Outdated
@@ -216,43 +210,50 @@ export const Modal = forwardRef<HTMLElement, Props>(function Modal(props, ref) { | |||
[disableBackdropClick, onBackdropClick, onClose] | |||
) | |||
|
|||
useBodyScrollLock(open) |
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.
even though Modal
from mui is supporting body lock by default, it does not work when we change the container from the body to the Picasso root. It appears to be working even if we change it back to body, but I didn't want to break anything unexpectedly, so keeping the same behavior as on master
@@ -216,43 +210,50 @@ export const Modal = forwardRef<HTMLElement, Props>(function Modal(props, ref) { | |||
[disableBackdropClick, onBackdropClick, onClose] | |||
) | |||
|
|||
useBodyScrollLock(open) | |||
|
|||
const duration = transitionProps?.timeout || transitionDuration |
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 double checked in MUI implementation that transitionProps
are overriding transitionDuration
/> | ||
<div | ||
data-test="sentinelStart" | ||
data-testid="sentinelStart" | ||
tabindex="0" | ||
/> | ||
<div |
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 decided to remove MuiDialog-container
as it is not necessary and default closeOnBackdropClick
works. If in the adopting phase, we realize that users are relying on the DOM structure, we can easily return the div back, but we will have to introduce a logic, that will close the modal if we click on this container, but not on the paper component
} catch (err) { | ||
setError(true) | ||
setLoading(false) | ||
export const PromptModal = forwardRef<HTMLDivElement, Props>( |
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.
The only change is
- HTMLElement
+ HTMLDivElement
And the removal of the styles, as they were empty anyway
@toptal-bot run package:alpha-release |
Your alpha package is ready 🎉 |
@toptal-bot run package:alpha-release |
Your alpha package is ready 🎉 |
FX-4034
Description
This PR is the POC of migrating a complex component from MUI4 to TailwindCSS. We chose Modal.
This PR involves:
How to test
Screenshots
Development checks
props
in component with documentationexamples
for componentBreaking change
PR commands
List of available commands:
@toptal-bot run package:alpha-release
- Release alpha version@toptal-anvil ping reviewers
- Ping FX team for reviewPR Review Guidelines
When to approve? ✅
You are OK with merging this PR and
nit:
to your comment. (ex.nit: I'd rename this variable from makeCircle to getCircle
)When to request changes? ❌
You are not OK with merging this PR because
When to comment (neither ✅ nor ❌)
You want your comments to be addressed before merging this PR in cases like:
How to handle the comments?