diff --git a/packages/rn-tester/js/RNTesterAppShared.js b/packages/rn-tester/js/RNTesterAppShared.js index e053d3ce75d..7b8c74caa07 100644 --- a/packages/rn-tester/js/RNTesterAppShared.js +++ b/packages/rn-tester/js/RNTesterAppShared.js @@ -36,6 +36,7 @@ import { StyleSheet, View, useColorScheme, + useWindowDimensions, } from 'react-native'; import * as NativeComponentRegistry from 'react-native/Libraries/NativeComponent/NativeComponentRegistry'; @@ -75,8 +76,12 @@ const RNTesterApp = ({ activeModuleExampleKey, screen, recentlyUsed, + hadDeepLink, } = state; + const {height, scale} = useWindowDimensions(); + const isScreenTiny = height / scale < 400; + const examplesList = React.useMemo( () => getExamplesListWithRecentlyUsed({recentlyUsed, testList}), [recentlyUsed, testList], @@ -265,16 +270,21 @@ const RNTesterApp = ({ const activeExampleList = screen === Screens.COMPONENTS ? examplesList.components : examplesList.apis; + // Hide chrome if we don't have much screen space and are showing UI for tests + const shouldHideChrome = isScreenTiny && hadDeepLink; + return ( - - {activeModule && BackButtonComponent ? ( - - ) : undefined} - + {!shouldHideChrome && ( + + {activeModule && BackButtonComponent ? ( + + ) : undefined} + + )} )} - - - + {!shouldHideChrome && ( + + + + )} );