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 sign in page/set password page styles, refactoring #1910

Closed
wants to merge 36 commits into from

Conversation

jasperhuangg
Copy link
Contributor

@jasperhuangg jasperhuangg commented Mar 19, 2021

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:

  1. PR for the flex styles Fix sign in page styles #2192 [MERGED]
  2. PR for refactoring the welcome text into its own component Add WelcomeText component #2190 [MERGED]
  3. PR for fixing link fonts Add font: fontFamily.GTA to link styles #2237 [MERGED]
  4. PR for refactoring SigninPageLayout to be used with single component forms Fix signin page layout #2196 [MERGED]
  5. PR for refactoring LoginForm to be a single component Refactor login form into a single component #2363 [MERGED]
  6. PR for fixing styles for the SetPasswordPage (will be renamed to SetPasswordForm) Rename and restyle set password form #2211
  7. PR for fixing CSS styles to allow native views to rely on width (as opposed to always defaulting to narrow).

@jasperhuangg jasperhuangg requested a review from a team as a code owner March 19, 2021 04:26
@jasperhuangg jasperhuangg self-assigned this Mar 19, 2021
@botify botify requested review from marcaaron and removed request for a team March 19, 2021 04:26
@shawnborton
Copy link
Contributor

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

Desktop feels unnecessarily wide too, so perhaps we can fix that up as well?

@jasperhuangg jasperhuangg changed the title Added flex: 1 to sign in page styles Make set password page styles like sign in page Mar 22, 2021
@jasperhuangg
Copy link
Contributor Author

jasperhuangg commented Mar 22, 2021

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

@jasperhuangg jasperhuangg changed the title Make set password page styles like sign in page [HOLD Expensify.cash 1857] Make set password page styles like sign in page Mar 22, 2021
@shawnborton
Copy link
Contributor

Nice, looks good to me design-wise. I like that we're just reusing the login/sign in styles.

shawnborton
shawnborton previously approved these changes Mar 22, 2021
Copy link
Contributor

@marcaaron marcaaron left a 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.

@jasperhuangg jasperhuangg requested a review from marcaaron March 23, 2021 12:01
@jasperhuangg
Copy link
Contributor Author

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!

src/pages/setpassword/SetPasswordPageProps.js Outdated Show resolved Hide resolved
src/pages/setpassword/SetPasswordPage.js Outdated Show resolved Hide resolved
src/pages/setpassword/SetPasswordPage.js Outdated Show resolved Hide resolved
src/pages/SetPasswordPage.js Outdated Show resolved Hide resolved
@marcaaron
Copy link
Contributor

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.

src/pages/setpassword/SetPasswordPage.js Outdated Show resolved Hide resolved
src/pages/setpassword/SetPasswordPage.js Outdated Show resolved Hide resolved
src/pages/setpassword/SetPasswordPage.js Outdated Show resolved Hide resolved
src/pages/setpassword/SetPasswordPageProps.js Outdated Show resolved Hide resolved
src/pages/setpassword/SetPasswordPageProps.js Outdated Show resolved Hide resolved
@jasperhuangg jasperhuangg requested a review from marcaaron March 24, 2021 12:29
Copy link
Contributor

@marcaaron marcaaron left a 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.

src/pages/SetPasswordPage.js Outdated Show resolved Hide resolved
src/components/WelcomeText.js Show resolved Hide resolved
src/components/WelcomeText.js Outdated Show resolved Hide resolved
src/pages/SetPasswordPage.js Outdated Show resolved Hide resolved
src/pages/SetPasswordPage.js Outdated Show resolved Hide resolved
src/pages/SetPasswordPage.js Outdated Show resolved Hide resolved
src/pages/SetPasswordPage.js Outdated Show resolved Hide resolved
src/pages/SetPasswordPage.js Outdated Show resolved Hide resolved
@jasperhuangg jasperhuangg requested a review from marcaaron March 26, 2021 06:08
Copy link
Contributor

@marcaaron marcaaron left a 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.

source={welcomeScreenshot}
/>
</View>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is the effect you are going for, but I noticed that if we are viewing this on an iPad this "welcome screenshot" is no longer present.

We are using the "narrow" view on all iOS devices so this ends up looking like this...

iPad
Screen Shot 2021-03-26 at 8 36 24 AM

iPhone
Screen Shot 2021-03-26 at 8 38 38 AM

Copy link
Contributor Author

@jasperhuangg jasperhuangg Mar 29, 2021

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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:

Simulator Screen Shot - iPad Pro (9 7-inch) - 2021-03-29 at 10 28 07

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?

Copy link
Contributor

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.

Copy link
Contributor Author

@jasperhuangg jasperhuangg Mar 31, 2021

Choose a reason for hiding this comment

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

@marcaaron

Ah duh; I uploaded the wrong screenshot (I've got like 50 screenshots on my desktop, my bad!)

Screen Shot 2021-03-30 at 1 30 27 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marcaaron

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.

Screen Shot 2021-03-31 at 12 22 11 PM

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

Copy link
Contributor Author

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.

Screen Shot 2021-03-31 at 1 11 01 PM

@jasperhuangg jasperhuangg changed the title [HOLD Expensify.cash 1857] Make set password page styles like sign in page Make set password page styles like sign in page Mar 29, 2021
@jasperhuangg jasperhuangg requested a review from marcaaron March 31, 2021 05:22
@shawnborton
Copy link
Contributor

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?

Copy link
Contributor

@marcaaron marcaaron left a 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.

src/libs/Navigation/AppNavigator/PublicScreens.js Outdated Show resolved Hide resolved
src/pages/SetPasswordPage.js Show resolved Hide resolved
src/pages/setpassword/SetPasswordForm.js Outdated Show resolved Hide resolved
src/pages/setpassword/SetPasswordPageNarrow.js Outdated Show resolved Hide resolved
@marcaaron
Copy link
Contributor

marcaaron commented Mar 31, 2021

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?

+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 LoginForm makes things complicated since we are presenting only the "narrow" view on native platforms which forces us to decentralize various things. If everyone agrees, I think we should ditch this pattern and not continue to follow it for the next screen in the sequence (set password).

We can also create a follow up to address that concern, but let's come to a decision before proceeding further.

@jasperhuangg jasperhuangg changed the title Make set password page styles like sign in page Fix sign in page/set password page styles, refactoring Apr 1, 2021
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