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

Create IOU Amount step #1768

Merged
merged 11 commits into from
Mar 18, 2021
Merged

Create IOU Amount step #1768

merged 11 commits into from
Mar 18, 2021

Conversation

tugbadogan
Copy link
Contributor

@trjExpensify @Julesssss

Details

  • Created different amount view for Mobile and Web/Desktop
  • Show title based on hasMultipleParticipants prop ('Split Bill' or 'Request Money')
  • Accept decimal number up to 6 digits and 2 decimal digit

Fixed Issues

Fixes #1691

Tests

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

1Screen.Recording.2021-03-14.at.15.46.33.mov

Mobile Web

Screen.Recording.2021-03-14.at.15.49.22.mov

Desktop

Screenshot 2021-03-14 at 15 55 27 Screenshot 2021-03-14 at 15 56 02

iOS

Android

@tugbadogan tugbadogan requested a review from a team as a code owner March 14, 2021 19:41
@botify botify requested review from flodnv and removed request for a team March 14, 2021 19:41
@flodnv flodnv requested a review from Julesssss March 15, 2021 13:01
Copy link
Contributor

@flodnv flodnv left a comment

Choose a reason for hiding this comment

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

I'm a newbie here so please forgive me if my questions have obvious answers 😊

I'll be leaning on @Julesssss for a thorough review

src/components/BigNumberPad.js Show resolved Hide resolved
src/components/BigNumberPad.js Outdated Show resolved Hide resolved
src/components/BigNumberPad.js Outdated Show resolved Hide resolved
src/components/BigNumberPad.js Outdated Show resolved Hide resolved
Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

Looking really good! Added some comments and questions.

FYI, there's a problem with react-native-navigation where the first back button press isn't recognised, but no need to worry about fixing that on this PR.

Also, would it be possible to make the BNP input focused by default on Web/Desktop?

@shawnborton
Copy link
Contributor

Instead of having a gray "Next" button that turns green when there is an amount entered, I think it might be better to just have a disabled state for our green success buttons. Perhaps it's the same button styles but it's just at 50% opacity or something.

Also - why does the screen show "USD" instead of just a $?

@tugbadogan
Copy link
Contributor Author

Instead of having a gray "Next" button that turns green when there is an amount entered, I think it might be better to just have a disabled state for our green success buttons. Perhaps it's the same button styles but it's just at 50% opacity or something.

I updated Next button view when disabled. I created new style for disabled green success button

Also - why does the screen show "USD" instead of just a $?

In the issue, I was told that it is OK to use currency code for now.

For now, currency will remain hardcoded as 'USD' within the IOUModal state. The currency Text component can also be set to use the currency code, instead of the currency symbol (currency will be added in a separate issue).

@tugbadogan
Copy link
Contributor Author

Also, would it be possible to make the BNP input focused by default on Web/Desktop?

I tried to use autoFocus prop on TextInput, but it doesn't work as expected when chat views are on the background. It works as expected for /iou/request where background is solid grey. Do you know what would be the reason here?

@Julesssss
Copy link
Contributor

I tried to use autoFocus prop on TextInput, but it doesn't work as expected when chat views are on the background. It works as expected for /iou/request where background is solid grey. Do you know what would be the reason here?

Ah, good find. I recall that we built logic for autofocusing on the chat text input, but don't know what exactly we need to change. I have asked internally to see if anyone has an idea.

Also - why does the screen show "USD" instead of just a $?

This is blocked for now, will be completed with a separate follow up issue.

@Julesssss
Copy link
Contributor

Actually @tugbadogan, I have one suggestion for the input issue. Have you tried using TextInputFocusable instead of the TextInput component? The purpose is to keep the chat input always focused, I think this is currently preventing focus and hopefully using it for BNP will allow the same behaviour.

https://github.com/Expensify/Expensify.cash/blob/88c1e72e0a35e642bf4c277abf692ed52156863c/src/components/TextInputFocusable/index.js

@tugbadogan
Copy link
Contributor Author

Actually @tugbadogan, I have one suggestion for the input issue. Have you tried using TextInputFocusable instead of the TextInput component? The purpose is to keep the chat input always focused, I think this is currently preventing focus and hopefully using it for BNP will allow the same behaviour.

https://github.com/Expensify/Expensify.cash/blob/88c1e72e0a35e642bf4c277abf692ed52156863c/src/components/TextInputFocusable/index.js

I tried using TextInputFocusable and it is working if request is navigated within page but it doesn't focus when page is loaded with direct URL. Same problem exists for other focusable text inputs like search.

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

I tried using TextInputFocusable and it is working if request is navigated within page but it doesn't focus when page is loaded with direct URL. Same problem exists for other focusable text inputs like search.

Ah that's fantastic, I'd say that directly loading the URL is an edge case and that can be fixed as a separate bug.

The final changes to make as far as I can see are:

  • Switch to the hidden input trick you mentioned, that will allow us to keep the amount Text horizontally aligned
  • Prevent the mobile keyboard from being displayed (screenshots below)

Screenshot_1615907146

@tugbadogan
Copy link
Contributor Author

I tried using TextInputFocusable and it is working if request is navigated within page but it doesn't focus when page is loaded with direct URL. Same problem exists for other focusable text inputs like search.
👍

Ah that's fantastic, I'd say that directly loading the URL is an edge case and that can be fixed as a separate bug.

The final changes to make as far as I can see are:

  • Switch to the hidden input trick you mentioned, that will allow us to keep the amount Text horizontally aligned

I implemented this feature and will update PR.

  • Prevent the mobile keyboard from being displayed (screenshots below)

I couldn't reproduce this issue as there is no text input.

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

I'm still seeing the Keyboard displayed on a physical device when the IOUAmount page is displayed. It isn't always consistent but occurs most of the time, are you able to reproduce this? I can see it on both Android and iOS physical devices.

iouAmountKeyboard.mp4

@Julesssss
Copy link
Contributor

Hi @tugbadogan, I've just noticed that the same issue occurs prior to your changes, so no need to view the keyboard issue as a blocker, I'll raise a separate issue for that.

Julesssss
Julesssss previously approved these changes Mar 17, 2021
Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

LGTM!

All yours @flodnv

- Create different view for Mobile and Web/Desktop
- Show title based on current route ('Split Bill' or 'Request Money'
- Accept decimal number up to 6 digits and 2 decimal digit
- Create different view for Mobile and Web/Desktop
- Show title based on current route ('Split Bill' or 'Request Money'
- Accept decimal number up to 6 digits and 2 decimal digit
@tugbadogan
Copy link
Contributor Author

@flodnv Fixed merge conflicts and updated the PR.

Copy link
Contributor

@flodnv flodnv left a comment

Choose a reason for hiding this comment

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

@tugbadogan please avoid force pushing in the future as this has the side effect of requiring a full re-review from reviewers. We'll add a guideline to that effect in the repo 🙇

@Julesssss all yours.

@Julesssss Julesssss merged commit fa6185b into Expensify:master Mar 18, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2021
@tugbadogan tugbadogan deleted the tugbadogan-create-IOU-amount branch March 23, 2021 14:12
textAlign="left"
/>
<Text
style={[styles.iouAmountText, styles.invisible, {left: 100000}]}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't use inline styles like {left: 100000} directly in the style tag.
Also, why 100000? It looks maybe like a magic number?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Chat] [IOU] Create IOU Amount step
5 participants