-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
chore(js-ts) migrate AccountOverview.js #11189
Changes from 2 commits
7dc8e39
b697b0d
e64f3d8
b9e302d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove unused file |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,11 +3,11 @@ import { render } from '@testing-library/react-native'; | |||||
import withMetricsAwareness from './withMetricsAwareness'; | ||||||
import useMetrics from './useMetrics'; | ||||||
import { View } from 'react-native'; | ||||||
import { IWithMetricsAwarenessProps } from './withMetricsAwareness.types'; | ||||||
import { IUseMetricsHook } from './useMetrics.types'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
jest.mock('./useMetrics'); | ||||||
|
||||||
class MockComponent extends Component<IWithMetricsAwarenessProps> { | ||||||
class MockComponent extends Component<{ metrics: IUseMetricsHook }> { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
render() { | ||||||
return <View />; | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,11 +1,10 @@ | ||||||
import React, { ComponentType } from 'react'; | ||||||
import useMetrics from './useMetrics'; | ||||||
import { IWithMetricsAwarenessProps } from './withMetricsAwareness.types'; | ||||||
import { IUseMetricsHook } from './useMetrics.types'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
const withMetricsAwareness = | ||||||
// TODO: Replace "any" with type | ||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||||||
(Children: ComponentType<IWithMetricsAwarenessProps>) => (props: any) => | ||||||
<Children {...props} metrics={useMetrics()} />; | ||||||
<P extends { metrics: IUseMetricsHook }>(Children: ComponentType<P>) => | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
(props: Omit<P, 'metrics'>) => | ||||||
<Children {...(props as P)} metrics={useMetrics()} />; | ||||||
|
||||||
export default withMetricsAwareness; |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless there was a reason to remove this, let's keep it? |
This file was deleted.
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.
Remove unused file