-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[No QA] Replace usages of useWindowDimensions with useResponsiveLayout #46788
[No QA] Replace usages of useWindowDimensions with useResponsiveLayout #46788
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: Nativescreen-recording-2024-09-04-at-24350-in-the-afternoon_INxmBmz8.mp4Android: mWeb ChromeScreen.Recording.2024-09-04.at.1.14.45.in.the.afternoon.moviOS: NativeScreen.Recording.2024-09-04.at.2.53.26.in.the.afternoon.moviOS: mWeb Safariscreen-recording-2024-09-04-at-10645-in-the-afternoon_8XSWa622.mp4iPad: Safariscreen-recording-2024-09-04-at-10125-in-the-afternoon_QAGp7PMa.mp4MacOS: Chrome / Safariscreen-recording-2024-09-04-at-122800-in-the-afternoon_I2NBH2kn.mp4MacOS: Desktopscreen-recording-2024-09-04-at-13429-in-the-afternoon_uKqjnzYK.mp4 |
@getusha - Could you please test this on iPad also? Thanks! |
Recording to show that the app still works properly on iPadSimulator.Screen.Recording.-.iPad.Pro.12.9-inch.6th.generation.-.2024-08-06.at.19.44.06.mp4 |
Sorry for the delay! I was focused on high-priority issues, but I will review this PR this week to get it across the finish line. |
Updated |
@getusha - PR ready for review |
Screen.Recording.2024-08-25.at.10.29.58.at.night.mov |
…seResponsiveLayout
…ons-with-useResponsiveLayout
Updated |
…seResponsiveLayout
…spaceExpensifyCardDetailsPage
…seResponsiveLayout
…ons-with-useResponsiveLayout
@roryabraham all yours |
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.
looks good, let's resolve conflicts then shipit
…seResponsiveLayout
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.0.30-0 🚀
|
cc @getusha @roryabraham
Details
We're replacing the usages of
useWindowDimensions
, which was previously used to determine the layout, with theuseResponsiveLayout
hook. Now,useWindowDimensions
should only be used when it's necessary to obtain the window dimentions for components such aswindowWidth
andwindowHeight
.For
useResponsiveLayout
, we useshouldUseNarrowLayout
for scenarios on mobile or in RHP/LHP,isSmallScreenWidth
specifically for mobile, andisInNarrowPaneModal
for use in RHP/LHP.isSmallScreenWidth, isExtraSmallScreenHeight, isExtraSmallScreenWidth, isMediumScreenWidth, isMediumOrLargerScreenWidth, isLargeScreenWidth, isSmallScreen
that are needed to determine the correct layout are now exported for use fromuseResponsiveLayout
instead ofuseWindowDimensions
useWindowDimensions
is now exportingwindowWidth
andwindowHeight
only.useResponsiveLayout
should be responsible for any logic that determine the correct layout.Fixed Issues
$ #30528
Tests
Do general regression tests and focus on layouts; test all the app's most important features and verify there are no layout breaks.
Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-08-04.at.9.13.16.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-08-04.at.9.03.49.PM.mov
iOS: Native
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-08-04.at.20.49.57.mp4
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-08-04.at.21.02.21.mp4
MacOS: Chrome / Safari
Screen.Recording.2024-08-04.at.8.59.07.PM.mov
MacOS: Desktop
Screen.Recording.2024-08-04.at.9.11.17.PM.mov