Skip to content

Commit f658917

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Fix logic around hiding chrome with deeplinks on small screen (#50806)
Summary: Pull Request resolved: #50806 1. `useWindowDimensions` is already returning in DIPs, my math was just wrong before 2. Playground is marking itself as a deeplink when it shouldn't be Changelog: [internal] Reviewed By: cortinico, joevilches Differential Revision: D73221335 fbshipit-source-id: 32dfa9d60609faccef8e264aa46d64b79250b64d
1 parent 5fd5188 commit f658917

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/rn-tester/js/RNTesterAppShared.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ const RNTesterApp = ({
7979
hadDeepLink,
8080
} = state;
8181

82-
const {height, scale} = useWindowDimensions();
83-
const isScreenTiny = height / scale < 400;
82+
const isScreenTiny = useWindowDimensions().height < 600;
8483

8584
const examplesList = React.useMemo(
8685
() => getExamplesListWithRecentlyUsed({recentlyUsed, testList}),

packages/rn-tester/js/utils/RNTesterNavigationReducer.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const RNTesterNavigationReducer = (
8585
activeModuleTitle: title,
8686
activeModuleExampleKey: null,
8787
screen,
88-
hadDeepLink: true,
88+
hadDeepLink: false,
8989
};
9090

9191
case RNTesterNavigationActionsType.MODULE_CARD_PRESS:
@@ -94,6 +94,7 @@ export const RNTesterNavigationReducer = (
9494
activeModuleKey: key,
9595
activeModuleTitle: title,
9696
activeModuleExampleKey: null,
97+
hadDeepLink: false,
9798
// $FlowFixMe[incompatible-return]
9899
recentlyUsed: getUpdatedRecentlyUsed({
99100
exampleType: exampleType,
@@ -105,6 +106,7 @@ export const RNTesterNavigationReducer = (
105106
case RNTesterNavigationActionsType.EXAMPLE_CARD_PRESS:
106107
return {
107108
...state,
109+
hadDeepLink: false,
108110
activeModuleExampleKey: key,
109111
};
110112

0 commit comments

Comments
 (0)