[TS migration] Migrate TabSelector components to typescript#33084
Conversation
| }; | ||
|
|
||
| const getIconAndTitle = (route, translate) => { | ||
| function getIconAndTitle(route: string, translate: LocaleContextProps['translate']): {icon: FunctionComponent<SvgProps>; title: string} { |
There was a problem hiding this comment.
Let's create a separate type for return type {icon: FunctionComponent<SvgProps>; title: string}
| navigation.navigate({name: route.name, merge: true}); | ||
| navigation.navigate({key: route.key, merge: true}); |
There was a problem hiding this comment.
Could you clarify why this was changed?
There was a problem hiding this comment.
The previous usage wasn't interpreted by typescript properly, I would have to use
navigation.navigate({name: route.name, merge: true, params: {}); because params is not optional in navigate function arguments. Thats why I switched to navigation.navigate({key: route.key, merge: true}); usage, because it does the same thing, but has optional params argument.
|
@alitoshmatov Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Hi @alitoshmatov, could you please review this PR? 😁 |
|
Working on it |
Reviewer Checklist
Screenshots/VideosAndroid: Nativetabs-android.movAndroid: mWeb Chrometabs-mweb.moviOS: NativeiOS: mWeb Safaritabs-safari.mp4MacOS: Chrome / Safaritabs-web.movMacOS: Desktoptabs-desktop.mov |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25089 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
I got assigned the issue so I can review this |
| title: PropTypes.string, | ||
| title?: string; | ||
|
|
||
| /** Animated opacity value while the label is inactive state */ |
There was a problem hiding this comment.
| /** Animated opacity value while the label is inactive state */ | |
| /** Animated opacity value while the label is in inactive state */ |
| /** Icon to display on tab */ | ||
| icon?: (props: SrcProps) => React.ReactNode; | ||
|
|
||
| /** Animated opacity value while the label is inactive state */ |
There was a problem hiding this comment.
| /** Animated opacity value while the label is inactive state */ | |
| /** Animated opacity value while the icon is in inactive state */ |
| /** Animated opacity value while the label is inactive state */ | ||
| inactiveOpacity?: number | Animated.AnimatedInterpolation<number>; | ||
|
|
||
| /** Animated opacity value while the label is in active state */ |
There was a problem hiding this comment.
| /** Animated opacity value while the label is in active state */ | |
| /** Animated opacity value while the icon is in active state */ |
| backgroundColor: PropTypes.any, | ||
| backgroundColor?: string | Animated.AnimatedInterpolation<string>; | ||
|
|
||
| /** Animated opacity value while the label is inactive state */ |
There was a problem hiding this comment.
| /** Animated opacity value while the label is inactive state */ | |
| /** Animated opacity value while the tab is in inactive state */ |
| inactiveOpacity: PropTypes.any, | ||
| inactiveOpacity?: number | Animated.AnimatedInterpolation<number>; | ||
|
|
||
| /** Animated opacity value while the label is in active state */ |
There was a problem hiding this comment.
| /** Animated opacity value while the label is in active state */ | |
| /** Animated opacity value while the tab is in active state */ |
|
|
||
| /** Whether this tab is active */ | ||
| isFocused: PropTypes.bool, | ||
| isFocused?: boolean; |
There was a problem hiding this comment.
Should we call this isActive instead, since the comment says "Whether this tab is active", and the comments I'm suggesting changes on also use "active" and not "focused"?
| isFocused?: boolean; | |
| isActive?: boolean; |
|
@cead22 fixed the comments the way you requested 😃 |
|
@VickyStash @blazejkustra @alitoshmatov can one of you give this another look just in case I missed something. Thanks! |
|
Anyone? |
|
Working on it |
|
Everything looks good and working well Screen.Recording.2023-12-21.at.21.37.53.movSimulator.Screen.Recording.-.iPhone.15.Plus.-.2023-12-21.at.21.38.46.mp4 |
|
Thank you! |
|
✋ 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/cead22 in version: 1.4.17-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.17-8 🚀
|
Sorry, I was OOO. Thanks for quick merge! |
Details
Migration of 'TabSelector' to Typescript.
Fixed Issues
$ #25089
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Verify that TabSelector component works properly in testing requesting money flow(changing request money options from distance request to manual request etc.). Also test main flows of the app(sending messages, logging, requesting money).
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)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
Android: Native
android.mov
Android: mWeb Chrome
https://github.com/Expensify/App/assets/88395093/dbb680e5-320d-436f-818a-73d94e37f5e5iOS: Native
ios.mov
iOS: mWeb Safari
iosweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov