Fix linting and typo

This commit is contained in:
Brent Vatne 2018-10-31 19:23:44 -07:00
parent 86450c09ce
commit 3b1458c1cf
5 changed files with 12 additions and 18 deletions

View File

@ -1,4 +1,4 @@
import React, { Component } from 'react'; import React } from 'react';
import { StyleSheet, View, Text } from 'react-native'; import { StyleSheet, View, Text } from 'react-native';
import { createStackNavigator } from 'react-navigation-stack'; import { createStackNavigator } from 'react-navigation-stack';
@ -71,7 +71,7 @@ function createHeaderBackgroundExample(options = {}) {
}, },
}, },
News: { News: {
screen: ({ navigation }) => ( screen: () => (
<View style={styles.container}> <View style={styles.container}>
<Text style={styles.tips} onPress={() => {}}> <Text style={styles.tips} onPress={() => {}}>
News Screen News Screen

View File

@ -1,5 +1,5 @@
import * as React from 'react'; import * as React from 'react';
import { Button, ScrollView, StatusBar } from 'react-native'; import { Button, StatusBar } from 'react-native';
import { SafeAreaView } from '@react-navigation/native'; import { SafeAreaView } from '@react-navigation/native';
import { createStackNavigator } from 'react-navigation-stack'; import { createStackNavigator } from 'react-navigation-stack';

View File

@ -41,7 +41,7 @@ const Drawer = createDrawerNavigator(
}, },
{ {
contentComponent: props => <Menu {...props} />, contentComponent: props => <Menu {...props} />,
navigationOptions: { title: 'Example' } navigationOptions: { title: 'Example' },
} }
); );

View File

@ -1,8 +1,6 @@
import { Dimensions, I18nManager } from 'react-native'; import { Dimensions, I18nManager } from 'react-native';
import getSceneIndicesForInterpolationInputRange from '../../utils/getSceneIndicesForInterpolationInputRange'; import getSceneIndicesForInterpolationInputRange from '../../utils/getSceneIndicesForInterpolationInputRange';
const EPS = 1e-5;
function hasHeader(scene) { function hasHeader(scene) {
if (!scene) { if (!scene) {
return true; return true;

View File

@ -43,13 +43,9 @@ const EaseInOut = Easing.inOut(Easing.ease);
/** /**
* Enumerate possible values for validation * Enumerate possible values for validation
*/ */
const HEADER_LAYOUT_PRESET_VALUES = ['center', 'left']; const HEADER_LAYOUT_PRESET = ['center', 'left'];
const HEADER_TRANSITION_PRESET_VALUES = ['fade-in-place', 'uikit']; const HEADER_TRANSITION_PRESET = ['fade-in-place', 'uikit'];
const HEADER_BACKGROUND_TRANSITION_PRESET_VALUES = [ const HEADER_BACKGROUND_TRANSITION_PRESET = ['toggle', 'fade', 'translate'];
'toggle',
'fade',
'translate',
];
/** /**
* The max duration of the card animation in milliseconds after released gesture. * The max duration of the card animation in milliseconds after released gesture.
@ -655,7 +651,7 @@ class StackViewLayout extends React.Component {
const { headerBackgroundTransitionPreset } = this.props; const { headerBackgroundTransitionPreset } = this.props;
if (headerBackgroundTransitionPreset) { if (headerBackgroundTransitionPreset) {
if ( if (
HEADER_BACKGROUND_TRANSITION_PRESET_VALUES.includes( HEADER_BACKGROUND_TRANSITION_PRESET.includes(
headerBackgroundTransitionPreset headerBackgroundTransitionPreset
) )
) { ) {
@ -694,13 +690,13 @@ class StackViewLayout extends React.Component {
); );
} }
} }
if (HEADER_LAYOUT_PRESET_VALUES.includes(headerLayoutPreset)) { if (HEADER_LAYOUT_PRESET.includes(headerLayoutPreset)) {
return headerLayoutPreset; return headerLayoutPreset;
} }
if (__DEV__) { if (__DEV__) {
console.error( console.error(
`Invalid configuration applied for headerLayoutPreset - expected one of ${HEADER_LAYOUT_PRESET_VALUES.join( `Invalid configuration applied for headerLayoutPreset - expected one of ${HEADER_LAYOUT_PRESET.join(
', ' ', '
)} but received ${JSON.stringify(headerLayoutPreset)}` )} but received ${JSON.stringify(headerLayoutPreset)}`
); );
@ -723,13 +719,13 @@ class StackViewLayout extends React.Component {
const { headerTransitionPreset } = this.props; const { headerTransitionPreset } = this.props;
if (headerTransitionPreset) { if (headerTransitionPreset) {
if (HEADER_TRANSITION_PRESET_VALUES.includes(headerTransitionPreset)) { if (HEADER_TRANSITION_PRESET.includes(headerTransitionPreset)) {
return headerTransitionPreset; return headerTransitionPreset;
} }
if (__DEV__) { if (__DEV__) {
console.error( console.error(
`Invalid configuration applied for headerTransitionPreset - expected one of ${HEADER_TRANSITION_PRESET_VALUES.join( `Invalid configuration applied for headerTransitionPreset - expected one of ${HEADER_TRANSITION_PRESET.join(
', ' ', '
)} but received ${JSON.stringify(headerTransitionPreset)}` )} but received ${JSON.stringify(headerTransitionPreset)}`
); );