diff --git a/src/components/ReportHeaderSkeletonView.js b/src/components/ReportHeaderSkeletonView.tsx similarity index 68% rename from src/components/ReportHeaderSkeletonView.js rename to src/components/ReportHeaderSkeletonView.tsx index e0ef3f4257e3..acc9261889bc 100644 --- a/src/components/ReportHeaderSkeletonView.js +++ b/src/components/ReportHeaderSkeletonView.tsx @@ -1,8 +1,8 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {View} from 'react-native'; import {Circle, Rect} from 'react-native-svg'; -import compose from '@libs/compose'; +import useLocalize from '@hooks/useLocalize'; +import useWindowDimensions from '@hooks/useWindowDimensions'; import useTheme from '@styles/themes/useTheme'; import useThemeStyles from '@styles/useThemeStyles'; import variables from '@styles/variables'; @@ -11,37 +11,32 @@ import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; import PressableWithFeedback from './Pressable/PressableWithFeedback'; import SkeletonViewContentLoader from './SkeletonViewContentLoader'; -import withLocalize, {withLocalizePropTypes} from './withLocalize'; -import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions'; -const propTypes = { - ...windowDimensionsPropTypes, - ...withLocalizePropTypes, - shouldAnimate: PropTypes.bool, +type ReportHeaderSkeletonViewProps = { + shouldAnimate?: boolean; }; -const defaultProps = { - shouldAnimate: true, -}; - -function ReportHeaderSkeletonView(props) { +function ReportHeaderSkeletonView({shouldAnimate = true}: ReportHeaderSkeletonViewProps) { const theme = useTheme(); const styles = useThemeStyles(); + const {translate} = useLocalize(); + const {isSmallScreenWidth} = useWindowDimensions(); + return ( - - {props.isSmallScreenWidth && ( + + {isSmallScreenWidth && ( {}} style={[styles.LHNToggle]} role={CONST.ACCESSIBILITY_ROLE.BUTTON} - accessibilityLabel={props.translate('common.back')} + accessibilityLabel={translate('common.back')} > )}