Migrate Avatar.js to use functional component#17217
Conversation
| this.setState({imageError: false}); | ||
| } | ||
| setImageError(false); | ||
| }, [props.network.isOffline]); |
There was a problem hiding this comment.
Started a conversation around whether or not imageError should be included in the dep array in the open-source channel here: https://expensify.slack.com/archives/C01GTK53T8Q/p1681117333835879
There was a problem hiding this comment.
Added a comment to explain why imageError shouldn't be a dependency in running side effects.
81db650 to
420c6c2
Compare
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-04-12.at.4.08.04.PM.movAndroid |
|
My android emulator doesn't want to work anymore 😭 @marcaaron Could you test on Android? I've tested all other platforms. |
|
Taking a look now! I am having some Android issues too today so we'll see how it goes 🙃 😫 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/marcaaron in version: 1.3.0-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.0-2 🚀
|





Details
Migrated the Avatar component from class based to function based.
Fixed Issues
$ GH_LINK
PROPOSAL: N/A
Tests
Offline tests
Same as above
QA Steps
Same as tests step.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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
Screen.Recording.2023-04-11.at.7.13.14.PM.mov
Mobile Web - Chrome
Screen.Recording.2023-04-11.at.6.52.29.PM.mov
Mobile Web - Safari
Screen.Recording.2023-04-11.at.7.04.28.PM.mov
Desktop
Screen.Recording.2023-04-11.at.6.48.17.PM.mov
iOS
Screen.Recording.2023-04-11.at.7.01.35.PM.mov
Android
Screen.Recording.2023-04-11.at.6.50.30.PM.mov