forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#33261 from Expensify/revert-32731-ts/Use…
…rDetailsTooltip Revert "[TS migration] Migrate 'UserDetailsTooltip' component to TypeScript"
- Loading branch information
Showing
14 changed files
with
145 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/components/UserDetailsTooltip/BaseUserDetailsTooltip.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
const propTypes = { | ||
/** Children to wrap with Tooltip. */ | ||
children: PropTypes.node.isRequired, | ||
}; | ||
|
||
/** | ||
* @param {propTypes} props | ||
* @returns {ReactNodeLike} | ||
*/ | ||
function BaseUserDetailsTooltip(props) { | ||
return props.children; | ||
} | ||
|
||
BaseUserDetailsTooltip.propTypes = propTypes; | ||
BaseUserDetailsTooltip.displayName = 'BaseUserDetailsTooltip'; | ||
|
||
export default BaseUserDetailsTooltip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.native.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import BaseUserDetailsTooltip from './BaseUserDetailsTooltip'; | ||
import {defaultProps as userDetailsTooltipDefaultProps, propTypes as userDetailsTooltipPropTypes} from './userDetailsTooltipPropTypes'; | ||
|
||
const propTypes = { | ||
...userDetailsTooltipPropTypes, | ||
|
||
/** Whether the actual UserDetailsTooltip should be rendered. If false, it's just going to return the children */ | ||
shouldRender: PropTypes.bool, | ||
}; | ||
|
||
const defaultProps = { | ||
...userDetailsTooltipDefaultProps, | ||
shouldRender: true, | ||
}; | ||
|
||
function UserDetailsTooltip({shouldRender = true, children, ...props}) { | ||
if (!shouldRender) { | ||
return children; | ||
} | ||
|
||
return ( | ||
<BaseUserDetailsTooltip | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
> | ||
{children} | ||
</BaseUserDetailsTooltip> | ||
); | ||
} | ||
|
||
UserDetailsTooltip.displayName = 'UserDetailsTooltip'; | ||
UserDetailsTooltip.propTypes = propTypes; | ||
UserDetailsTooltip.defaultProps = defaultProps; | ||
|
||
export default UserDetailsTooltip; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.