Skip to content
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

Migrate pages group 1 #36681

Merged
merged 13 commits into from Feb 29, 2024
19 changes: 7 additions & 12 deletions src/pages/LoadingPage.js → src/pages/LoadingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
import PropTypes from 'prop-types';
import React from 'react';
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ScreenWrapper from '@components/ScreenWrapper';
import useThemeStyles from '@hooks/useThemeStyles';

const propTypes = {
type LoadingPageProps = {
/** Method to trigger when pressing back button of the header */
onBackButtonPress: PropTypes.func,
title: PropTypes.string.isRequired,
};
onBackButtonPress?: () => void;

const defaultProps = {
onBackButtonPress: undefined,
/** Title of the Loading page */
title: string;
This conversation was marked as resolved.
Show resolved Hide resolved
};

function LoadingPage(props) {
function LoadingPage({onBackButtonPress, title}: LoadingPageProps) {
const styles = useThemeStyles();
return (
<ScreenWrapper testID={LoadingPage.displayName}>
<HeaderWithBackButton
onBackButtonPress={props.onBackButtonPress}
onBackButtonPress={onBackButtonPress}
shouldShowBackButton
title={props.title}
title={title}
/>
<FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
</ScreenWrapper>
);
}

LoadingPage.displayName = 'LoadingPage';
LoadingPage.propTypes = propTypes;
LoadingPage.defaultProps = defaultProps;

export default LoadingPage;
Loading