Skip to content
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

Fix the modal dismiss behavior #2296

Merged
merged 4 commits into from
Apr 13, 2021
Merged

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented Apr 8, 2021

Details

Adds the ability to dismiss modals back to either the LHN or the last screen they were triggered from (so just the Report screen at the moment).

Fixed Issues

Fixes https://github.com/Expensify/Expensify/issues/157574

Tests

QA Steps

  1. Pull up a chat with one user and click on the avatar to open "Details"
  2. Tap the x in the top right corner to dismiss the modal
  3. Verify you are brought back to the chat and not the LHN
  4. Tap to launch the "Settings" screen
  5. Tap the x in the top right corner to dismiss the modal
  6. Verify you are brought back to the LHN
  7. Tap to launch the "Settings" screen
  8. Tap to launch "Profile"
  9. Tap the x in the top right corner to dismiss the modal
  10. Verify you are brought back to the LHN
  11. Repeat for all sub screens: Profile, Preferences, Change Password, Payments etc.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

2021-04-07_17-22-14 (1)

Mobile Web

2021-04-07_17-24-41 (1)

Desktop

2021-04-07_17-28-31 (1)

iOS

2021-04-07_17-33-39 (1)

Android

2021-04-07_17-38-37 (1)

@marcaaron marcaaron requested a review from a team as a code owner April 8, 2021 02:54
@marcaaron marcaaron self-assigned this Apr 8, 2021
@MelvinBot MelvinBot requested review from pecanoro and removed request for a team April 8, 2021 02:54
*/
function dismissModal() {
function dismissModal(shouldOpenDrawer = false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

NAB, just learning, what is the drawer?

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 main app (anything not a modal) is split into two panels in a DrawerNavigator. The left part of the drawer is the "drawer content" and set to the LHN/Sidebar and the right side is the report/chat screen. On larger screens, the drawer is permanently expanded, but on smaller screens / mobile it can be toggled back and forth programmatically or by swiping.

https://github.com/Expensify/Expensify.cash/blob/3dfea0090410aed64199f2e37680429f2682ee0a/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js#L21-L46

@pecanoro
Copy link
Contributor

pecanoro commented Apr 9, 2021

Travis failed!

@marcaaron
Copy link
Contributor Author

Merging master now to see if it fixes.

@marcaaron marcaaron merged commit b5e635c into master Apr 13, 2021
@marcaaron marcaaron deleted the marcaaron-fixModalDismissBehavior branch April 13, 2021 15:32
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.

2 participants