[TS Migration] Migrate withWindowDimensions and Modal directories to TypeScript#30338
Conversation
blazejkustra
left a comment
There was a problem hiding this comment.
One small comment, other than that LGTM!
|
Please also check #30338 (comment) |
|
@situchan prop brought back, bug fixed |
|
@situchan kind bump 😄 |
|
@BartoszGrajdek please pull main. author checklist failing |
|
@situchan I would disregard the checklist for now, there as been recent changes to it |
|
|
||
| function Modal(props) { | ||
| const [previousStatusBarColor, setPreviousStatusBarColor] = useState(); | ||
| function Modal({fullscreen, onModalHide, type, onModalShow, children, ...rest}: BaseModalProps) { |
There was a problem hiding this comment.
Please define default values same as the ones in defaultProps before migration.
i.e. onModalHide() will crash in hideModal function
|
@situchan default props brought back 😄 |
|
@situchan kind bump 😄 |
|
final test today |
|
@situchan let me know in slack when this is ready, thanks! |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
mountiny
left a comment
There was a problem hiding this comment.
One commment for my understanding @JKobrynski
| setStatusBarColor(isFullScreenModal ? themeColors.appBG : StyleUtils.getThemeBackgroundColor(statusBarColor)); | ||
| } | ||
|
|
||
| onModalShow?.(); |
There was a problem hiding this comment.
How does this syntax work for a method? call the method if it is not null?
There was a problem hiding this comment.
Ignores when onModalShow is undefined or null and returns undefined. Otherwise same as onModalShow()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
There was a problem hiding this comment.
Exactly! It's very useful and you can also use it to safely access arrays i.e. lets say you have a variable test and it's type is string[] | null if you use test?.[0] it won't throw an error even if test === null, if you don't use optional chaining however this would throw a TypeError
|
✋ 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 production by https://github.com/mountiny in version: 1.4.0-3 🚀
|


Details
Fixed Issues
$ #25139
PROPOSAL: N/A
Tests
Attachment modal (when you want to send an attachment in a conversation)
Delete comment modal
Verify that no errors appear in the JS console
Offline tests
N/A
QA Steps
Same as Tests section above
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 */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
Android: Native
android.webm
Android: mWeb Chrome
chrome.webm
iOS: Native
ios.mp4
iOS: mWeb Safari
safari.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov