-
Notifications
You must be signed in to change notification settings - Fork 152
feat: full size modal #2620
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
base: master
Are you sure you want to change the base?
feat: full size modal #2620
Conversation
|
✅ PR title follows Conventional Commits specification. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 957b635:
|
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.
why separate story file?
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 think here you can just do
const FullScreenModal = ModalTemplate.bind({})
FullScreenModal.args = {
size: 'full'
}
This should do the job right?
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 can have example with StepGroup in our CreationView documentation I think. Otherwise at multiple places we're end up keeping very similar examples and larger examples in stories can make the "show code" section a bit confusing
`; | ||
const ModalContent = styled(BaseBox)<{ isVisible: boolean; size: NonNullable<ModalProps['size']> }>( | ||
({ isVisible, theme, size }) => { | ||
const centerTransform = size === 'full' ? 'none' : 'translate(-50%, -50%)'; |
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.
Is this animation defined from design?
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.
nope. i have kept is same for normal and full size modal.
Screen.Recording.2025-04-25.at.12.45.15.PM.mov
but we don't need translate(-50%, -50%) .. in case of full page modal. since it will already at center.
also had a discussion with RK. will change it to just fadein and fadeout
? `calc(100vw - ${makeSize(modalMargin[size])} - ${makeSize( | ||
modalMargin[size], | ||
)})` |
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.
? `calc(100vw - ${makeSize(modalMargin[size])} - ${makeSize( | |
modalMargin[size], | |
)})` | |
? `calc(100vw - ${makeSize(modalMargin[size] * 2)}, | |
)})` |
Same thing?
top={size === 'full' ? makeSize(modalMargin[size]) : '50%'} | ||
left={size === 'full' ? makeSize(modalMargin[size]) : '50%'} |
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.
Why do we have to define different value for full? wouldn't it still be center aligned just full width?
} & DataAnalyticsAttribute; | ||
|
||
const _ModalBody = ({ | ||
children, | ||
padding = 'spacing.6', | ||
height, |
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.
should ModalBody have height prop or should Modal component have height prop?
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 Modal body should have a height prop, as in the case of a full Modal, we need the Modal body to take up 100% of the available height inside the Modal.
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 can have example with StepGroup in our CreationView documentation I think. Otherwise at multiple places we're end up keeping very similar examples and larger examples in stories can make the "show code" section a bit confusing
Description
Changes
Additional Information
Component Checklist