-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TS migration] Migrate 'Section.js' component to TypeScript #33645
Conversation
src/components/MenuItemList.tsx
Outdated
{...menuItemProps} | ||
disabled={menuItemProps.disabled ?? isExecuting} | ||
onPress={shouldUseSingleExecution ? singleExecution(onPress) : onPress} | ||
interactive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blazejkustra Please see this discussion we had internally regarding interactive
, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, changed the implementation in this PR.
src/components/MenuItemList.tsx
Outdated
return ( | ||
<> | ||
{menuItems.map((menuItemProps) => { | ||
const onPress = menuItemProps.onPress ?? (() => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it makes sense to update MenuItem typing instead of adding default onPress value, but I'm not sure about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it because singleExecution wasn't erroring that way, now it should be fine!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@aimane-chnaif 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] |
@aimane-chnaif Done 👌 |
reviewing |
type ResponsiveProps = { | ||
/** Function to fire when component is pressed */ | ||
onPress: (event: GestureResponderEvent | KeyboardEvent) => void; | ||
|
||
interactive?: true; | ||
}; | ||
|
||
type UnresponsiveProps = { | ||
onPress?: undefined; | ||
|
||
/** Whether the menu item should be interactive at all */ | ||
interactive: false; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for this removal? This automatically enabled interactive when onPress is defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please have a look at this discussion
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
@aimane-chnaif Kind bump, this is blocking several other TS issues. I would appreciate a reviewer checklist on this one, thank you 😄 |
will complete review today |
@aimane-chnaif Merged the newest main for you 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple NABs! Thank you for completing this
{!!icon && ( | ||
<Icon | ||
src={icon} | ||
height={68} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any style consts for this?
import type IconAsset from '@src/types/utils/IconAsset'; | ||
import IconSection from './IconSection'; | ||
|
||
const CARD_LAYOUT = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should rename this to SECTION_CARD_LAYOUT to make it clearer when imported
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
The |
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.23-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.4.23-4 🚀
|
Details
Migration of
Section
to Typescript + Fixes this console warning.Fixed Issues
$ #25024
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
android-web.webm
iOS: Native
ios.mp4
iOS: mWeb Safari
ios-web.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov