diff --git a/src/components/ReportActionsSkeletonView/SkeletonViewLines.js b/src/components/ReportActionsSkeletonView/SkeletonViewLines.tsx similarity index 75% rename from src/components/ReportActionsSkeletonView/SkeletonViewLines.js rename to src/components/ReportActionsSkeletonView/SkeletonViewLines.tsx index 51ae4c1034a5..5a5d1011db38 100644 --- a/src/components/ReportActionsSkeletonView/SkeletonViewLines.js +++ b/src/components/ReportActionsSkeletonView/SkeletonViewLines.tsx @@ -1,4 +1,3 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {Circle, Rect} from 'react-native-svg'; import SkeletonViewContentLoader from '@components/SkeletonViewContentLoader'; @@ -6,21 +5,17 @@ import styles from '@styles/styles'; import themeColors from '@styles/themes/default'; import CONST from '@src/CONST'; -const propTypes = { +type SkeletonViewLinesProps = { /** Number of rows to show in Skeleton UI block */ - numberOfRows: PropTypes.number.isRequired, - shouldAnimate: PropTypes.bool, + numberOfRows: 1 | 2 | 3; + shouldAnimate?: boolean; }; -const defaultTypes = { - shouldAnimate: true, -}; - -function SkeletonViewLines(props) { +function SkeletonViewLines({numberOfRows, shouldAnimate = true}: SkeletonViewLinesProps) { return ( - {props.numberOfRows > 1 && ( + {numberOfRows > 1 && ( )} - {props.numberOfRows > 2 && ( + {numberOfRows > 2 && ( ; +} + +export default ContentLoader; diff --git a/src/components/SkeletonViewContentLoader/index.tsx b/src/components/SkeletonViewContentLoader/index.tsx new file mode 100644 index 000000000000..105e677ad7c1 --- /dev/null +++ b/src/components/SkeletonViewContentLoader/index.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import SkeletonViewContentLoader from 'react-content-loader'; +import SkeletonViewContentLoaderProps from './types'; + +function ContentLoader(props: SkeletonViewContentLoaderProps) { + // eslint-disable-next-line react/jsx-props-no-spreading + return ; +} + +export default ContentLoader; diff --git a/src/components/SkeletonViewContentLoader/types.ts b/src/components/SkeletonViewContentLoader/types.ts new file mode 100644 index 000000000000..23f0a051e518 --- /dev/null +++ b/src/components/SkeletonViewContentLoader/types.ts @@ -0,0 +1,6 @@ +import {IContentLoaderProps} from 'react-content-loader'; +import {IContentLoaderProps as NativeIContentLoaderProps} from 'react-content-loader/native'; + +type SkeletonViewContentLoaderProps = IContentLoaderProps & NativeIContentLoaderProps; + +export default SkeletonViewContentLoaderProps;