-
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
Fix sign in page/set password page styles, refactoring #1910
Conversation
Thanks @jasperhuangg! While we are here, I think it would be nice if the set password page looked more like the sign in page - same width, same centering, etc: Desktop feels unnecessarily wide too, so perhaps we can fix that up as well? |
Hey @shawnborton! I rewrote the set password page to use an identical layout as the sign in page. I think it might look a bit too close, let me know what you think and if I need to get rid of anything. (see screenshots in the OP) Just a note: if we got rid of the "With Expensify.cash, chat and payments are..." text and the screenshot I can consolidate everything for the SetPassword page into a single component. cc @marcaaron |
Nice, looks good to me design-wise. I like that we're just reusing the login/sign in styles. |
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, but I think we can maybe apply the DRY principle here. If possible, I'd love to see these changes all happening in one file (SetPasswordPage
) without all of these new files.
Hey @marcaaron! I DRYed up the code and I think it should be good for another review. The design didn't change from before (I think my previous commits dismissed Shawn's review), so feel free to merge if you think everything looks good! |
Hey @jasperhuangg there is a HOLD on this PR. If you remove it then it can be merged with an approval. |
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 just have a few more clean up suggestions.
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.
PR looks good, thanks for the changes. I found one inconsistency on iPad that we should maybe address here. Other than that, I'm unsure why there is a HOLD on this PR. It looks ready to merge after the iPad issue is fixed.
src/pages/SetPasswordPage.js
Outdated
source={welcomeScreenshot} | ||
/> | ||
</View> | ||
)} |
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.
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.
Ahhh that is strange and definitely not what I was going for. So the width used for isSmallScreenWidth
also includes iPad widths.
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.
@marcaaron I noticed that this issue appears when you try to run it natively on iOS; I was wondering how you were able to access the set password page on iOS in this branch? Normally for web I access it via the URL.
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.
yes, isSmallScreenWidth
is just based on the screen width on any platform
this issue appears when you try to run it natively on iOS
I'm using deep links to open this screen directly like this
npx uri-scheme open expensify-cash://setpassword/123456 --ios
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.
@marcaaron Hmm tried it on my end with this branch and I wasn't able to reproduce the bug:
Is the main issue you're concerned about the image not showing up for you? Or did you want to change it so that we use the "wide" view for iPad?
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 screenshot you are showing is the web version of the app shown in Safari app. The issue I am describing occurs in the native version of the app. Maybe try merging the main
branch back into this branch and try again.
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.
Ah duh; I uploaded the wrong screenshot (I've got like 50 screenshots on my desktop, my bad!)
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.
So the issue is that we're defaulting to the narrow view on all iOS devices, but this iOS device in particular has a width greater than the cut off for mobile devices.
Since we put everything into a single component, I have to display the welcome screenshot conditionally based on the screen width.
I tried modifying index.native.js
to use the screenWidth conditionally to display the narrow/wide views, but the wide view doesn't display correctly on iOS.
A solution is to refactor everything to use the same pattern as the log in page, or to figure out why the styles aren't showing up correctly for the wide view on iOS (which could potentially be a deep rabbit hole).
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've refactored everything back into multiple components seeing that the sign in page follows this same pattern, and it makes more sense to have two pages that look nearly identical to have the same structure. This is necessary for everything to display properly seeing that we default to the narrow view for ios.
Jumping in late here, but we should be using screen width to determine the layout and not the operating system. Is that what we're doing here? |
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.
Sorry @jasperhuangg I feel like this PR has regressed back to where we started and we're now going in circles. Things were very close, then we took a few steps backwards. Not sure why.
+1 I'm not following why we are always defaulting to a "narrow" view on native platforms, but maybe there is a clear reason for it? To me, the existing design of the We can also create a follow up to address that concern, but let's come to a decision before proceeding further. |
There were too many unrelated changes happening in this PR so @marcaaron and I decided to break this up into a bunch of smaller PRs. I'll update the links individually once each PR is created. For now, this PR won't be merged but will simply be broken up into these PRs:
SigninPageLayout
to be used with single component forms Fix signin page layout #2196 [MERGED]LoginForm
to be a single component Refactor login form into a single component #2363 [MERGED]SetPasswordPage
(will be renamed toSetPasswordForm
) Rename and restyle set password form #2211