@@ -3,6 +3,7 @@ import { useRouter } from 'next/router';
33import PropTypes from 'prop-types' ;
44import { memo , useState } from 'react' ;
55
6+ import { FeatureFlags , useFeatureFlag } from '@/hooks/useFeatureFlag' ;
67import {
78 useHandleWindowMessage ,
89 WindowMessageTypes ,
@@ -16,26 +17,31 @@ import { getApplicationServerSideProps } from '@/utils/getApplicationServerSideP
1617const prefixWhenNotEmpty = ( value , prefix ) =>
1718 value ? `${ prefix } ${ value } ` : value ;
1819
19- const IFrame = memo ( ( { url } ) => (
20+ const IFrame = memo ( ( { url, showBorder } ) => (
2021 < Box
2122 id = "fallback_frame"
2223 as = "iframe"
2324 src = { url }
2425 width = "100%"
25- height = "100vh"
2626 flex = { 1 }
27+ css = { `
28+ ${ showBorder ? 'border: 2px solid red;' : '' }
29+ height: 100vh;
30+ ` }
2731 />
2832) ) ;
2933
3034IFrame . displayName = 'IFrame' ;
3135
3236IFrame . propTypes = {
3337 url : PropTypes . string ,
38+ showBorder : PropTypes . bool ,
3439} ;
3540
3641const Fallback = ( ) => {
3742 const router = useRouter ( ) ;
3843 const { publicRuntimeConfig } = getConfig ( ) ;
44+ const [ showBorder ] = useFeatureFlag ( FeatureFlags . SHOW_IFRAME_BORDER ) ;
3945
4046 // Keep track of which paths were not found. Do not store as a single boolean
4147 // for the current path, because it's possible to navigate from a 404 path to
@@ -61,7 +67,7 @@ const Fallback = () => {
6167 // and then the 404 logic does not get triggered because the listener is too
6268 // late to get the message from the AngularJS app.
6369 if ( isClientSide ) {
64- return < IFrame url = { legacyPath } /> ;
70+ return < IFrame url = { legacyPath } showBorder = { showBorder } /> ;
6571 }
6672
6773 return null ;
0 commit comments