-
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 RadioButton to Typescript #31050
[TS migration] Migrate RadioButton to Typescript #31050
Conversation
src/components/RadioButton.tsx
Outdated
}; | ||
|
||
function RadioButton(props) { | ||
function RadioButton({isChecked, onPress = () => undefined, accessibilityLabel, disabled = false, hasError = false}: RadioButtonProps) { |
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.
function RadioButton({isChecked, onPress = () => undefined, accessibilityLabel, disabled = false, hasError = false}: RadioButtonProps) { | |
function RadioButton({isChecked, onPress, accessibilityLabel, disabled = false, hasError = false}: RadioButtonProps) { |
I think we don't need to assign a default value to onPress
@@ -54,8 +48,4 @@ function RadioButton(props) { | |||
); | |||
} | |||
|
|||
RadioButton.propTypes = propTypes; | |||
RadioButton.defaultProps = defaultProps; | |||
RadioButton.displayName = 'RadioButton'; |
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.
Please keep the displayName
.
RadioButton.displayName = 'RadioButton';
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.
Please resolve conflicts and @fabioh8010 commnets
@kubabutkiewicz everything resolved now |
@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] |
src/components/RadioButton.tsx
Outdated
}; | ||
|
||
function RadioButton(props) { | ||
function RadioButton({isChecked, onPress, accessibilityLabel, disabled = false, hasError = false}: RadioButtonProps) { |
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.
Nit: Unnecessary reordering of properties compared to the type declaration (hasError
could be before disabled
).
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.
Makes sense!
I left one comment, a nit-pick; otherwise, things look great (it's a short file). I'll fill the checklist when I can, which might be tomorrow (I'm in limited capacity mode this week, sorry!). |
Thx @cubuspl42. Props reordered. Ready when you are. |
"Reassure Performance Tests" check is failing. Would you check if merging I'm filling the "PR Reviewer Checklist" right now. Sorry for the delay. |
Hm, we're not far behind |
Reviewer Checklist
Screenshots/VideosWebts-migration-RadioButton-web.mp4Mobile Web - Chromets-migration-RadioButton-android-web-compressed.mp4Mobile Web - Safarits-migration-RadioButton-ios-web.mp4DesktopiOSts-migration-RadioButton-ios.mp4Androidts-migration-RadioButton-android-compressed.mp4 |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25025 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
Looking at the code, this is a proper TypeScript migration with minimal chances of introducing a regression. I followed the suggested test steps, and the component works fine. I also don't know the "genuine" way to reach this component. |
Fresh merge fixed that failing perf test @cubuspl42 |
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
Updated QA steps. Applause should be able to get to that page with sandbox credentials |
✋ 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/stitesExpensify in version: 1.4.4-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.4-3 🚀
|
Details
RadioButton component is marked on the screenshot below. It's those colourful radio buttons that can be toggled on and off.
Fixed Issues
$ #25025
PROPOSAL:
Tests
walletAdditionalDetails.questions
inAdditionalDetailsStep.js
:menuItems
inFloatingActionButtonAndPopover.js
with the following:New Chat
->Send enable payments
and you will reach the screen presented in the screenshot above.Offline tests
Tests
QA Steps
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)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Screen.Recording.2023-11-08.at.14.40.00.mov
Android: mWeb Chrome
Screen.Recording.2023-11-08.at.13.04.28.mov
iOS: Native
Screen.Recording.2023-11-08.at.13.16.43.mov
iOS: mWeb Safari
Screen.Recording.2023-11-08.at.13.04.28.mov
MacOS: Chrome / Safari
Screen.Recording.2023-11-08.at.12.44.32.mov
MacOS: Desktop
Screen.Recording.2023-11-08.at.12.57.31.mov