Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert changes related to #7623 #8412

Merged
merged 1 commit into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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