-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56926 from callstack-internal/feat/add-troublesho…
…ot-menu-to-publicscreens Add Troubleshoot menu to PublicScreens
- Loading branch information
Showing
17 changed files
with
306 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {useEffect} from 'react'; | ||
import KeyboardShortcut from '@libs/KeyboardShortcut'; | ||
import toggleTestToolsModal from '@userActions/TestTool'; | ||
import CONST from '@src/CONST'; | ||
|
||
function useDebugShortcut() { | ||
useEffect(() => { | ||
const debugShortcutConfig = CONST.KEYBOARD_SHORTCUTS.DEBUG; | ||
const unsubscribeDebugShortcut = KeyboardShortcut.subscribe( | ||
debugShortcutConfig.shortcutKey, | ||
() => toggleTestToolsModal(), | ||
debugShortcutConfig.descriptionKey, | ||
debugShortcutConfig.modifiers, | ||
true, | ||
); | ||
|
||
return () => { | ||
unsubscribeDebugShortcut(); | ||
}; | ||
|
||
// Rule disabled because this effect is only for component did mount & will component unmount lifecycle event | ||
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps | ||
}, []); | ||
} | ||
|
||
export default useDebugShortcut; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {useMemo} from 'react'; | ||
import {useOnyx} from 'react-native-onyx'; | ||
import ONYXKEYS from '@src/ONYXKEYS'; | ||
|
||
function useIsAuthenticated() { | ||
const [session] = useOnyx(ONYXKEYS.SESSION); | ||
const isAuthenticated = useMemo(() => !!(session?.authToken ?? null), [session]); | ||
return isAuthenticated; | ||
} | ||
|
||
export default useIsAuthenticated; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.