Skip to content

Commit

Permalink
Revert changes related to Expensify#7623
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Mar 31, 2022
1 parent 9b825b4 commit 8ead0c4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 33 deletions.
2 changes: 0 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -19,7 +18,6 @@ const decorators = [
OnyxProvider,
LocaleContextProvider,
HTMLEngineProvider,
MockNavigationProvider,
]}
>
<Story />
Expand Down
24 changes: 0 additions & 24 deletions __mocks__/MockNavigationProvider.js

This file was deleted.

8 changes: 2 additions & 6 deletions src/components/Button.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -243,4 +239,4 @@ class Button extends Component {
Button.propTypes = propTypes;
Button.defaultProps = defaultProps;

export default withNavigationFocus(Button);
export default Button;
1 change: 0 additions & 1 deletion src/pages/RequestCallPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ class RequestCallPage extends Component {
)}
<Button
success
pressOnEnter
onPress={this.onSubmit}
style={[styles.w100]}
text={this.props.translate('requestCallPage.callMe')}
Expand Down

0 comments on commit 8ead0c4

Please sign in to comment.