-
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 G14 stories from storybook to Typescript #38056
Conversation
…opdownMenu stories to typescript
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@@ -455,3 +455,4 @@ function AddressSearch( | |||
AddressSearch.displayName = 'AddressSearchWithRef'; | |||
|
|||
export default forwardRef(AddressSearch); | |||
export type {AddressSearchProps}; |
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.
export type {AddressSearchProps}; | |
export type {AddressSearchProps}; |
src/components/Banner.tsx
Outdated
@@ -109,3 +109,4 @@ function Banner({text, onClose, onPress, containerStyles, textStyles, shouldRend | |||
Banner.displayName = 'Banner'; | |||
|
|||
export default memo(Banner); | |||
export type {BannerProps} |
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.
export type {BannerProps} | |
export type {BannerProps} |
@@ -348,3 +348,4 @@ function Button( | |||
Button.displayName = 'Button'; | |||
|
|||
export default withNavigationFallback(React.forwardRef(Button)); | |||
export type {ButtonProps}; |
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.
export type {ButtonProps}; | |
export type {ButtonProps}; |
return ( | ||
<AddressSearch | ||
value={value} | ||
onInputChange={({street}) => setValue(street)} | ||
value={value as string} |
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.
why do we need this assertion here ?
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.
This is needed because value can only be string but InputChange has multiple types that can be used.
}, | ||
pressOnEnter: true, | ||
options: [ | ||
{value: 'One', text: 'One'}, | ||
{value: 'Two', text: 'Two'}, | ||
{value: 'One', text: 'One', icon: Expensicons.Wallet}, |
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.
why it is added here ?
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.
Options has the mandatory icon param.
@@ -15,12 +20,12 @@ export default { | |||
}, | |||
}; | |||
|
|||
function Template(args) { | |||
const [value, setValue] = useState(''); | |||
function Template(args: AddressSearchProps) { |
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 Template(args: AddressSearchProps) { | |
function Template(props: AddressSearchProps) { |
src/stories/Banner.stories.tsx
Outdated
@@ -11,25 +15,25 @@ const story = { | |||
component: Banner, | |||
}; | |||
|
|||
function Template(args) { | |||
function Template(args: BannerProps) { |
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 Template(args: BannerProps) { | |
function Template(props: BannerProps) { |
src/stories/Button.stories.tsx
Outdated
title: 'Components/Button', | ||
component: Button, | ||
}; | ||
|
||
function Template(args) { | ||
function Template(args: ButtonProps) { |
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 Template(args: ButtonProps) { | |
function Template(props: ButtonProps) { |
@@ -11,23 +15,23 @@ const story = { | |||
component: ButtonWithDropdownMenu, | |||
}; | |||
|
|||
function Template(args) { | |||
function Template(args: ButtonWithDropdownMenuProps<unknown>) { |
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 Template(args: ButtonWithDropdownMenuProps<unknown>) { | |
function Template(props: ButtonWithDropdownMenuProps<unknown>) { |
@DylanDylann 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] |
@ruben-rebelo Could you help to merge the latest main? |
Default.args = { | ||
buttonText: 'Pay using Expensify', | ||
customText: 'Pay using Expensify', |
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.
@ruben-rebelo Why do you change here?
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.
@DylanDylann This was changed because the actual prop which sets the text of the button is now customText instead of buttonText.
Reviewer Checklist
Only post video on web Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2024-03-22.at.17.36.54.movMacOS: Desktop |
@ruben-rebelo Bump on this one |
@ruben-rebelo let's merge with |
@DylanDylann I've merged main and answered the comment above |
@ruben-rebelo While testing, I see that ButtonWithDropdownMenu is lost in storybook after applying your change Latest main: After applying your change |
@DylanDylann You are correct, I've fixed the issue and updated the PR. |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25345 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
@francoisl Please also help to assign me to corresponding issues |
@francoisl looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Tests were passing 😕 |
Details
[TS migration] Migrate AddressSearch, Banner, Button and ButtonWithDropdownMenu stories to typescript
Fixed Issues
$ #25345
$ #25346
$ #25347
$ #25348
PROPOSAL: N/A
Tests
Verify that no errors appear in the JS console
Run storybook
The above mention stories are working as previously
Offline tests
N/A
QA Steps
N/A
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
N/a
Android: mWeb Chrome
N/a
iOS: Native
N/a
iOS: mWeb Safari
N/a
MacOS: Chrome / Safari
N/a
MacOS: Desktop
N/a