diff --git a/.storybook/preview.js b/.storybook/preview.js index f02e3938d182..65508e6bed71 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -6,7 +6,6 @@ import HTMLEngineProvider from '../src/components/HTMLEngineProvider'; import OnyxProvider from '../src/components/OnyxProvider'; import {LocaleContextProvider} from '../src/components/withLocalize'; import ONYXKEYS from '../src/ONYXKEYS'; -import MockNavigationProvider from '../__mocks__/MockNavigationProvider'; Onyx.init({ keys: ONYXKEYS, @@ -19,7 +18,6 @@ const decorators = [ OnyxProvider, LocaleContextProvider, HTMLEngineProvider, - MockNavigationProvider, ]} > diff --git a/__mocks__/MockNavigationProvider.js b/__mocks__/MockNavigationProvider.js deleted file mode 100644 index 67d4790f6b89..000000000000 --- a/__mocks__/MockNavigationProvider.js +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import {NavigationContext} from '@react-navigation/native'; - -const propTypes = { - /** Rendered child component */ - children: PropTypes.node.isRequired, -}; - -const MockNavigationProvider = props => ( - true, - addListener: () => {}, - removeListener: () => {}, - }} - > - {props.children} - -); - -MockNavigationProvider.propTypes = propTypes; - -export default MockNavigationProvider; diff --git a/src/components/Button.js b/src/components/Button.js index 526ba00cd993..d192c43f7738 100644 --- a/src/components/Button.js +++ b/src/components/Button.js @@ -1,7 +1,6 @@ import React, {Component} from 'react'; import {Pressable, ActivityIndicator, View} from 'react-native'; import PropTypes from 'prop-types'; -import {withNavigationFocus} from '@react-navigation/compat'; import styles from '../styles/styles'; import themeColors from '../styles/themes/default'; import OpacityView from './OpacityView'; @@ -81,9 +80,6 @@ const propTypes = { /** Should enable the haptic feedback? */ shouldEnableHapticFeedback: PropTypes.bool, - - /** Whether Button is on active screen */ - isFocused: PropTypes.bool.isRequired, }; const defaultProps = { @@ -128,7 +124,7 @@ class Button extends Component { // Setup and attach keypress handler for pressing the button with Enter key this.unsubscribe = KeyboardShortcut.subscribe(shortcutConfig.shortcutKey, (e) => { - if (!this.props.isFocused || this.props.isDisabled || this.props.isLoading || (e && e.target.nodeName === 'TEXTAREA')) { + if (this.props.isDisabled || this.props.isLoading || (e && e.target.nodeName === 'TEXTAREA')) { return; } this.props.onPress(); @@ -243,4 +239,4 @@ class Button extends Component { Button.propTypes = propTypes; Button.defaultProps = defaultProps; -export default withNavigationFocus(Button); +export default Button; diff --git a/src/pages/RequestCallPage.js b/src/pages/RequestCallPage.js index 56c93bc42f77..84504769a867 100644 --- a/src/pages/RequestCallPage.js +++ b/src/pages/RequestCallPage.js @@ -311,7 +311,6 @@ class RequestCallPage extends Component { )}