mirror of
https://github.com/status-im/react-navigation-stack.git
synced 2025-02-27 13:40:28 +00:00
Fix lint errors
This commit is contained in:
parent
6b3c2edf58
commit
5f157cbc16
@ -12,12 +12,12 @@ import ModalStack from './src/ModalStack';
|
||||
import LifecycleInteraction from './src/LifecycleInteraction';
|
||||
import GestureInteraction from './src/GestureInteraction';
|
||||
|
||||
// Uncomment the following line to force RTL. Requires closing and re-opening
|
||||
// your app after you first load it with this option enabled.
|
||||
// I18nManager.forceRTL(true);
|
||||
|
||||
// Comment the following two lines to stop using react-native-screens
|
||||
import { useScreens } from 'react-native-screens';
|
||||
|
||||
// Uncomment the following line to force RTL. Requires closing and re-opening
|
||||
// your app after you first load it with this option enabled.
|
||||
I18nManager.forceRTL(false);
|
||||
useScreens();
|
||||
|
||||
const data = [
|
||||
|
@ -5,18 +5,13 @@ import {
|
||||
InteractionManager,
|
||||
WebView,
|
||||
View,
|
||||
StyleSheet,
|
||||
} from 'react-native';
|
||||
import { MapView } from 'expo';
|
||||
import { withNavigationFocus } from 'react-navigation';
|
||||
import {
|
||||
createStackNavigator,
|
||||
StackGestureContext,
|
||||
} from 'react-navigation-stack';
|
||||
import {
|
||||
PanGestureHandler,
|
||||
NativeViewGestureHandler,
|
||||
} from 'react-native-gesture-handler';
|
||||
import { NativeViewGestureHandler } from 'react-native-gesture-handler';
|
||||
|
||||
const IndexScreen = ({ navigation }) => (
|
||||
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Dimensions, Button, Image, View, Text } from 'react-native';
|
||||
import { Dimensions, Button, Image, View } from 'react-native';
|
||||
import { createStackNavigator } from 'react-navigation-stack';
|
||||
import { FlatList, BorderlessButton } from 'react-native-gesture-handler';
|
||||
|
||||
|
@ -1,11 +1,5 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
Button,
|
||||
Text,
|
||||
View,
|
||||
StyleSheet,
|
||||
} from 'react-native';
|
||||
import { Button, Text, View, StyleSheet } from 'react-native';
|
||||
import { BarCodeScanner } from 'expo';
|
||||
import { withNavigationFocus } from 'react-navigation';
|
||||
import { createStackNavigator } from 'react-navigation-stack';
|
||||
|
@ -79,13 +79,7 @@ class HeaderBackButton extends React.PureComponent {
|
||||
};
|
||||
|
||||
_maybeRenderTitle() {
|
||||
const {
|
||||
backTitleVisible,
|
||||
titleStyle,
|
||||
tintColor,
|
||||
truncatedTitle,
|
||||
} = this.props;
|
||||
|
||||
const { backTitleVisible, titleStyle, tintColor } = this.props;
|
||||
let backTitleText = this._getTitleText();
|
||||
|
||||
if (!backTitleVisible || backTitleText === null) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Platform, NativeModules } from 'react-native';
|
||||
import { NativeModules } from 'react-native';
|
||||
|
||||
import { StackActions } from '@react-navigation/core';
|
||||
import StackViewLayout from './StackViewLayout';
|
||||
|
@ -1,9 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
Animated,
|
||||
StyleSheet,
|
||||
PanResponder,
|
||||
Platform,
|
||||
View,
|
||||
I18nManager,
|
||||
@ -27,8 +25,6 @@ import StackGestureContext from '../../utils/StackGestureContext';
|
||||
import clamp from '../../utils/clamp';
|
||||
import { supportsImprovedSpringAnimation } from '../../utils/ReactNativeFeatures';
|
||||
|
||||
const emptyFunction = () => {};
|
||||
|
||||
const IPHONE_XS_HEIGHT = 812; // iPhone X and XS
|
||||
const IPHONE_XR_HEIGHT = 896; // iPhone XR and XS Max
|
||||
const { width: WINDOW_WIDTH, height: WINDOW_HEIGHT } = Dimensions.get('window');
|
||||
@ -63,11 +59,6 @@ const ANIMATION_DURATION = 500;
|
||||
*/
|
||||
const POSITION_THRESHOLD = 1 / 2;
|
||||
|
||||
/**
|
||||
* The threshold (in pixels) to start the gesture action.
|
||||
*/
|
||||
const RESPOND_THRESHOLD = 20;
|
||||
|
||||
/**
|
||||
* The distance of touch start from the edge of the screen where the gesture will be recognized
|
||||
*/
|
||||
@ -390,8 +381,6 @@ class StackViewLayout extends React.Component {
|
||||
|
||||
// TODO: remove this __getValue!
|
||||
let distance = layout.height.__getValue();
|
||||
|
||||
let translationY = nativeEvent.translationY;
|
||||
let value = index - nativeEvent.translationY / distance;
|
||||
return clamp(index - 1, value, index);
|
||||
};
|
||||
@ -412,7 +401,7 @@ class StackViewLayout extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
_handleActivateGestureHorizontal = nativeEvent => {
|
||||
_handleActivateGestureHorizontal = () => {
|
||||
let { index } = this.props.transitionProps.navigation.state;
|
||||
|
||||
if (this._isMotionInverted()) {
|
||||
@ -449,7 +438,7 @@ class StackViewLayout extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
_handleActivateGestureVertical = nativeEvent => {
|
||||
_handleActivateGestureVertical = () => {
|
||||
let { index } = this.props.transitionProps.navigation.state;
|
||||
|
||||
this.setState({
|
||||
@ -472,8 +461,7 @@ class StackViewLayout extends React.Component {
|
||||
|
||||
_handleReleaseHorizontal = nativeEvent => {
|
||||
const {
|
||||
transitionProps: { navigation, position, layout, scene },
|
||||
mode,
|
||||
transitionProps: { navigation, position, layout },
|
||||
} = this.props;
|
||||
const { index } = navigation.state;
|
||||
const immediateIndex =
|
||||
@ -525,8 +513,7 @@ class StackViewLayout extends React.Component {
|
||||
|
||||
_handleReleaseVertical = nativeEvent => {
|
||||
const {
|
||||
transitionProps: { navigation, position, layout, scene },
|
||||
mode,
|
||||
transitionProps: { navigation, position, layout },
|
||||
} = this.props;
|
||||
const { index } = navigation.state;
|
||||
const immediateIndex =
|
||||
|
@ -23,8 +23,6 @@ export default function createPointerEventsContainer(Component) {
|
||||
this._bindPosition();
|
||||
this._pointerEvents = this._computePointerEvents();
|
||||
|
||||
const { navigation, scene } = this.props;
|
||||
|
||||
return (
|
||||
<Component
|
||||
{...this.props}
|
||||
@ -52,7 +50,7 @@ export default function createPointerEventsContainer(Component) {
|
||||
);
|
||||
}
|
||||
|
||||
_onPositionChange = ({ value }) => {
|
||||
_onPositionChange = (/* { value } */) => {
|
||||
// This should log each frame when releasing the gesture or when pressing
|
||||
// the back button! If not, something has gone wrong with the animated
|
||||
// value subscription
|
||||
|
@ -26,7 +26,7 @@ class Transitioner extends React.Component {
|
||||
};
|
||||
|
||||
const position = new Animated.Value(this.props.navigation.state.index);
|
||||
this._positionListener = position.addListener(({ value }) => {
|
||||
this._positionListener = position.addListener((/* { value } */) => {
|
||||
// This should work until we detach position from a view! so we have to be
|
||||
// careful to not ever detach it, thus the gymnastics in _getPosition in
|
||||
// StackViewLayout
|
||||
@ -60,7 +60,8 @@ class Transitioner extends React.Component {
|
||||
|
||||
componentWillUnmount() {
|
||||
this._isMounted = false;
|
||||
this._positionListener && this.state.position.removeListener(this._positionListener);
|
||||
this._positionListener &&
|
||||
this.state.position.removeListener(this._positionListener);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react/no-deprecated
|
||||
|
Loading…
x
Reference in New Issue
Block a user