|
1 | 1 | import {hasSeenTourSelector} from '@selectors/Onboarding'; |
2 | 2 | import React, {useCallback, useEffect, useRef, useState} from 'react'; |
3 | | -import {View} from 'react-native'; |
4 | | -import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; |
| 3 | +import {StyleSheet, View} from 'react-native'; |
| 4 | +import ActivityIndicator from '@components/ActivityIndicator'; |
5 | 5 | import useOnyx from '@hooks/useOnyx'; |
6 | 6 | import useThemeStyles from '@hooks/useThemeStyles'; |
| 7 | +import CONST from '@src/CONST'; |
7 | 8 | import ONYXKEYS from '@src/ONYXKEYS'; |
8 | 9 | import type {WalletStatementMessage, WalletStatementProps} from './types'; |
9 | 10 | import handleWalletStatementNavigation from './walletNavigationUtils'; |
@@ -37,26 +38,33 @@ function WalletStatementModal({statementPageURL}: WalletStatementProps) { |
37 | 38 | }, [navigate]); |
38 | 39 |
|
39 | 40 | return ( |
40 | | - <> |
41 | | - {isLoading && <FullScreenLoadingIndicator reasonAttributes={{context: 'WalletStatementModal'}} />} |
42 | | - <View style={[styles.flex1]}> |
43 | | - <iframe |
44 | | - src={`${statementPageURL}&authToken=${authToken}`} |
45 | | - title="Statements" |
46 | | - height="100%" |
47 | | - width="100%" |
48 | | - seamless |
49 | | - frameBorder="0" |
50 | | - onLoad={() => { |
51 | | - setIsLoading(false); |
| 41 | + <View style={styles.flex1}> |
| 42 | + {isLoading && ( |
| 43 | + <View style={[StyleSheet.absoluteFill, styles.fullScreenLoading]}> |
| 44 | + <ActivityIndicator |
| 45 | + size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE} |
| 46 | + reasonAttributes={{context: 'WalletStatementModal'}} |
| 47 | + /> |
| 48 | + </View> |
| 49 | + )} |
| 50 | + <iframe |
| 51 | + src={`${statementPageURL}&authToken=${authToken}`} |
| 52 | + title="Statements" |
| 53 | + height="100%" |
| 54 | + width="100%" |
| 55 | + seamless |
| 56 | + // frameBorder is deprecated in HTML5 but needed for consistent cross-browser iframe border removal |
| 57 | + // eslint-disable-next-line @typescript-eslint/no-deprecated |
| 58 | + frameBorder="0" |
| 59 | + onLoad={() => { |
| 60 | + setIsLoading(false); |
52 | 61 |
|
53 | | - // We listen to a message sent from the iframe to the parent component when a link is clicked. |
54 | | - // This lets us handle navigation in the app, outside of the iframe. |
55 | | - window.onmessage = (event: MessageEvent<WalletStatementMessage>) => navigateRef.current?.(event); |
56 | | - }} |
57 | | - /> |
58 | | - </View> |
59 | | - </> |
| 62 | + // We listen to a message sent from the iframe to the parent component when a link is clicked. |
| 63 | + // This lets us handle navigation in the app, outside of the iframe. |
| 64 | + window.onmessage = (event: MessageEvent<WalletStatementMessage>) => navigateRef.current?.(event); |
| 65 | + }} |
| 66 | + /> |
| 67 | + </View> |
60 | 68 | ); |
61 | 69 | } |
62 | 70 |
|
|
0 commit comments