Skip to content

fix: modal widget width mobile#2799

Open
mmioana wants to merge 4 commits intodevelopfrom
fix/modal-widget-width-mobile
Open

fix: modal widget width mobile#2799
mmioana wants to merge 4 commits intodevelopfrom
fix/modal-widget-width-mobile

Conversation

@mmioana
Copy link
Copy Markdown
Contributor

@mmioana mmioana commented Apr 9, 2026

Which Jira task belongs to this PR?

Closes https://linear.app/lifi-linear/issue/JUM-785/depositwithdraw-squashed-modal-widget-on-mobile

Testing steps

  1. Go to /earn or an /earn/[slug] page
  2. Set the viewport width to mobile
  3. Open the deposit/withdraw widget modal
  4. Enter an amount and proceed
  5. Check the widget width stays the same as on the main screen

Why did I implement it this way?

Checklist before requesting a review

  • I have performed a self-review of my code
  • This pull request is as small as possible and only tackles one problem
  • I have added tests that cover the functionality / test the bug
  • If this changed the API, I have updated the documentation
  • I have provided QA instructions for the feature / fix implemented in this PR (if applicable)
  • I have provided instructions for any environment / deployment changes that this PR needs when merged

Summary by CodeRabbit

  • Style
    • Updated modal container styling in both Deposit and Withdraw modals to adjust responsive behavior. The minimum width constraint now evaluates viewport dimensions with a maximum cap, affecting how the modals display across different screen sizes. This change provides better layout consistency and improved visual presentation on devices with smaller viewports.

@mmioana mmioana self-assigned this Apr 9, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Walkthrough

Both modal components update their container minimum width styling from full available width to a viewport-constrained value capped at 360px, improving responsive layout behavior on smaller screens.

Changes

Cohort / File(s) Summary
Modal Container Styling
src/components/composite/DepositModal/DepositModal.tsx, src/components/composite/WithdrawModal/WithdrawModal.tsx
Updated minWidth constraint from '100%' to 'min(100vw, 360px)' to cap modal width responsively instead of stretching to full available width.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • callMeTheQA
  • Kayanski
  • oktapodia

Poem

🐰 A pair of modals, dressed up neat,
With viewport bounds, now crisp and sweet,
No more stretching edge to edge,
Just 360 pixels—a tidy pledge! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: fixing modal widget width on mobile devices, which directly aligns with the changeset that updates modal styling in both DepositModal and WithdrawModal components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/modal-widget-width-mobile

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
jumper-exchange Error Error May 5, 2026 3:05pm
jumper-exchange-storybook Ready Ready Preview, Comment May 5, 2026 3:05pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

✅ All snapshot tests passed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Playwright test results

failed  1 failed
passed  52 passed
flaky  3 flaky
skipped  1 skipped

Details

stats  57 tests across 11 suites
duration  10 minutes, 55 seconds
commit  65dca8d

Failed tests

chromium › landingPage.spec.ts › Landing page and navigation › Should navigate to the homepage and change tabs (Qase ID: 2)

Flaky tests

chromium › mainMenu.spec.ts › Main Menu flows › Should be able to navigate to LI.FI Scan (Qase ID: 21)
chromium › mainMenu.spec.ts › Main Menu flows › Should be able to navigate to Discord (Qase ID: 17)
chromium › mainMenu.spec.ts › Main Menu flows › Should be able to click on the Support button (Qase ID: 20)

Skipped tests

chromium › themeManipulation.spec.ts › Switch between dark and light theme and check the background color › Partner theme should appear in theme menu and apply background color (Qase ID: 49)

📋 View Detailed Qase Report

@mmioana mmioana requested a review from callMeTheQA April 9, 2026 14:11
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/composite/WithdrawModal/WithdrawModal.tsx (1)

38-49: Consider centralizing the modal container sizing config.

This style block is duplicated with DepositModal; extracting it will reduce future drift when responsive sizing is adjusted again.

Optional refactor sketch
+// shared helper (example): src/components/composite/EarnModal/buildModalContainerTheme.ts
+export const buildEarnModalContainerTheme = (theme: Theme) => ({
+  maxHeight: 'calc(100vh - 6rem)',
+  minWidth: 'min(100vw, 360px)',
+  maxWidth: 400,
+  borderRadius: `${theme.shape.cardBorderRadiusLarge}px`,
+  [theme.breakpoints.up('sm')]: { minWidth: 400 },
+});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/composite/WithdrawModal/WithdrawModal.tsx` around lines 38 -
49, The modal container sizing object inside WithdrawModal's useMemo (the ctx ->
theme -> container with maxHeight, minWidth, maxWidth, borderRadius and the
[theme.breakpoints.up('sm')] override) is duplicated in DepositModal; extract
this object into a single exported constant or helper (e.g., modalContainerStyle
or getModalContainer(theme)) and import it into both WithdrawModal and
DepositModal, replacing the inline container block in the ctx memo so both
components reuse the same responsive sizing config and avoid future drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/composite/WithdrawModal/WithdrawModal.tsx`:
- Around line 38-49: The modal container sizing object inside WithdrawModal's
useMemo (the ctx -> theme -> container with maxHeight, minWidth, maxWidth,
borderRadius and the [theme.breakpoints.up('sm')] override) is duplicated in
DepositModal; extract this object into a single exported constant or helper
(e.g., modalContainerStyle or getModalContainer(theme)) and import it into both
WithdrawModal and DepositModal, replacing the inline container block in the ctx
memo so both components reuse the same responsive sizing config and avoid future
drift.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5bfcc25e-a4b6-452a-8ced-aeabbf2fdaca

📥 Commits

Reviewing files that changed from the base of the PR and between 34ba2a0 and 41d2296.

📒 Files selected for processing (2)
  • src/components/composite/DepositModal/DepositModal.tsx
  • src/components/composite/WithdrawModal/WithdrawModal.tsx

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.

1 participant