[TS migration] Migrate 'DistanceMapView' component to TypeScript#33553
Conversation
|
@cubuspl42 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] |
|
@cubuspl42 I was unable to add testing video for ios mWeb because for some reason the web is not loading locally on the simulator... Could you please help me to test that? |
| import {StyleProp, ViewStyle} from 'react-native'; | ||
| import {ComponentProps} from '@components/MapView/types'; | ||
|
|
||
| type DistanceMapViewProps = ComponentProps & { | ||
| overlayStyle: StyleProp<ViewStyle>; | ||
| }; | ||
|
|
||
| export default DistanceMapViewProps; |
There was a problem hiding this comment.
Since ComponentProps consists of MapViewProps & MapViewOnyxProps, and we don't pass MapViewOnyxProps userLocation to the component (you can test usage of DistanceMapView component, with current implementation it will give TS error requiring userLocation param), I think we should use MapViewProps only.
| import {StyleProp, ViewStyle} from 'react-native'; | |
| import {ComponentProps} from '@components/MapView/types'; | |
| type DistanceMapViewProps = ComponentProps & { | |
| overlayStyle: StyleProp<ViewStyle>; | |
| }; | |
| export default DistanceMapViewProps; | |
| import {StyleProp, ViewStyle} from 'react-native'; | |
| import type {MapViewProps} from '@components/MapView/MapViewTypes'; | |
| type DistanceMapViewProps = MapViewProps & { | |
| overlayStyle: StyleProp<ViewStyle>; | |
| }; | |
| export default DistanceMapViewProps; |
Besides that we need to update MapView index.tsx to use MapViewProps only as well.
This way the combination of MapViewProps & MapViewOnyxProps will be used only in MapView component files (1,2) which wrapped into withOnyx HOC and have the Onyx values.
There was a problem hiding this comment.
@VickyStash Made the requested change here: 975ebad
Please resolve the conversation if it is as expected 😇
VickyStash
left a comment
There was a problem hiding this comment.
LGTM, just minor comment
Co-authored-by: VickyStash <vikstash@gmail.com>
|
Also please update PR name to follow the issue name, so |
|
Done! |
Reviewer Checklist
Screenshots/VideosAndroid: Nativets-distance-map-view-android-compressed.mp4Android: mWeb Chromets-distance-map-view-android-web-compressed.mp4iOS: NativeiOS: mWeb Safarits-distance-map-view-ios-web.mp4MacOS: Chrome / Safarits-distance-map-view-web.mp4MacOS: Desktop |
jakub-trzebiatowski
left a comment
There was a problem hiding this comment.
@esh-g Please merge main
|
@cubuspl42 Merged! |
|
✋ 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/cristipaval in version: 1.4.21-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.21-4 🚀
|
1 similar comment
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.21-4 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.21-4 🚀
|
Details
Fixed Issues
$ #31958
PROPOSAL: #31958 (comment)
Tests
Offline tests
QA Steps
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(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.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
c67a5708-fb46-4ea7-afe8-549aad567566.mp4
Android: mWeb Chrome
2c641428-e7dd-4a6f-9e95-ecae4d2d1d4e.mp4
iOS: Native
80b92d97-6bcf-4bbd-8fb7-ffcd8a0ef60a.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2023-12-23.at.11.47.23.PM-1.mov
MacOS: Desktop
bebd4eb0-842a-43c7-9f38-58fb77bec7b4.mp4