Skip to content

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

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

feat: full size modal #2620

wants to merge 14 commits into from

Conversation

tewarig
Copy link
Contributor

@tewarig tewarig commented Apr 23, 2025

Description

Changes

Additional Information

Component Checklist

  • Update Component Status Page
  • Perform Manual Testing in Other Browsers
  • Add KitchenSink Story
  • Add Interaction Tests (if applicable)
  • Add changeset

Copy link

changeset-bot bot commented Apr 23, 2025

⚠️ No Changeset found

Latest commit: 957b635

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Apr 23, 2025

✅ PR title follows Conventional Commits specification.

Copy link

codesandbox-ci bot commented Apr 23, 2025

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:

Sandbox Source
razorpay/blade: basic Configuration

@rzpcibot
Copy link
Collaborator

rzpcibot commented Apr 23, 2025

Bundle Size Report

Updated Components
Status Component Base Size (kb) Current Size (kb) Diff
Modal 13.267 13.420 +0.153 KB
getTableBodyStyles -0.045 -0.047 -0.002 KB

Generated by 🚫 dangerJS against 957b635

Copy link
Member

Choose a reason for hiding this comment

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

why separate story file?

Copy link
Member

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?

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 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%)';
Copy link
Member

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?

Copy link
Contributor Author

@tewarig tewarig Apr 25, 2025

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

Comment on lines 172 to 174
? `calc(100vw - ${makeSize(modalMargin[size])} - ${makeSize(
modalMargin[size],
)})`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
? `calc(100vw - ${makeSize(modalMargin[size])} - ${makeSize(
modalMargin[size],
)})`
? `calc(100vw - ${makeSize(modalMargin[size] * 2)},
)})`

Same thing?

Comment on lines 181 to 182
top={size === 'full' ? makeSize(modalMargin[size]) : '50%'}
left={size === 'full' ? makeSize(modalMargin[size]) : '50%'}
Copy link
Member

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,
Copy link
Member

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?

Copy link
Contributor Author

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.

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 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

@saurabhdaware
Copy link
Member

image

borderRadius on bottom left is not working 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants