Migrate BaseKeyboardSpacer.js to fc component#22886
Migrate BaseKeyboardSpacer.js to fc component#22886cristipaval merged 6 commits intoExpensify:mainfrom vadymbokatov:fix/migrating-BaseKeyboardSpacer-fc-components
Conversation
|
@mollfpr I have created pr again. Please review and give me feedback. |
|
@vadymbokatov Thanks! As I said before you don't need to do this #22886 (comment) 😅 Also, you need to complete all the platform recordings. |
|
Although this is just a refactor, you must add a test step. You can see the example #20186 |
|
Gotcha. This is my first commit. I will update as soon as possible. |
|
And I have a question. BaseKeyboardSpacer component is only used for Android. Should I check it on all other devices? |
|
Good question! We can skip the Web, mWeb, and Desktop because it's returning |
|
@mollfpr I have completed. Please review my PR and give me feedback. Thank you. |
mollfpr
left a comment
There was a problem hiding this comment.
For the test step, we need to guide the QA. The KeyboardSpacer is use for the PasswordPopover. To observe that component, we need to use account that has permission expensifyWallet and doesn't have permission passwordless. Also, the account need an bank account or paypal account to be able to show option make default payment method option.
| return () => { | ||
| keyboardListeners.forEach((listener) => listener.remove()); | ||
| } | ||
| }, [props.keyboardShowMethod, props.keyboardHideMethod, updateKeyboardSpace, resetKeyboardSpace]); |
There was a problem hiding this comment.
We only want to have this side effect on the mount. With passing the dependency, we will have several times call this.
| }, [props.keyboardShowMethod, props.keyboardHideMethod, updateKeyboardSpace, resetKeyboardSpace]); | |
| // eslint-disable-next-line react-hooks/exhaustive-deps | |
| }, []); |
|
Gotcha. Can I update it on Monday? |
|
@vadymbokatov Sure! |
|
@mollfpr I have a question. How to create expensify wallet on my account? |
|
You can ask the internal team to invite your account, but for dev purposes, you can update the permission in Permissions.js. |
|
@mollfpr Please review again. Thank you. |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOS22886.iOS.mp4Android22886.Android.webm |
mollfpr
left a comment
There was a problem hiding this comment.
It almost looks good, just couple of NAB and a minor state on callback.
| } | ||
| const space = screenHeight - event.endCoordinates.screenY + props.topSpacing; | ||
| setKeyboardSpace(space); | ||
| props.onToggle(true, keyboardSpace); |
| return () => { | ||
| keyboardListeners.forEach((listener) => listener.remove()); | ||
| } | ||
| }, []); |
There was a problem hiding this comment.
NAB: lint error
| }, []); | |
| // eslint-disable-next-line react-hooks/exhaustive-deps | |
| }, []); |
| BaseKeyboardSpacer.propTypes = propTypes; | ||
|
|
||
| export default BaseKeyboardSpacer; | ||
| export default BaseKeyboardSpacer; No newline at end of file |
There was a problem hiding this comment.
NAB
| export default BaseKeyboardSpacer; | |
| export default BaseKeyboardSpacer; | |
|
@mollfpr Resolved eslint errors and other NAB. Thank you |
mollfpr
left a comment
There was a problem hiding this comment.
LGTM and tests well 👍
Just single NAB and we are ready to go.
| const space = screenHeight - event.endCoordinates.screenY + props.topSpacing; | ||
| setKeyboardSpace(space); | ||
| props.onToggle(true, space); | ||
| }, [keyboardSpace, props]); |
There was a problem hiding this comment.
NAB: lint error on unnecessary dependency.
|
@cristipaval Could you review this PR? |
Sorry @vadymbokatov , I was out of office. |
|
Could you please solve the lint errors? |
|
@cristipaval I will update asap. |
|
@cristipaval looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
All the checks passed, Melv. |
|
🚀 Deployed to staging by https://github.com/cristipaval in version: 1.3.45-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.45-7 🚀
|

Details
Migrated baseKeyboardSpace.js to fc component
Fixed Issues
$ #16173
PROPOSAL:
Tests
- Open the app authenticated.
- Go to the Settings and click payments.
- If you didn't add your payment method, add paypal as payment method.
- Click the paypal in the payments methods.
- Click the "Make default payment method" button.
- Input text and observe that the keyboard is aligned correctly.
Offline tests
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Screen.Recording.2023-07-17.at.22.24.37.mov
Android
Screen.Recording.2023-07-17.at.22.25.39.mov