From 7242efde0ae56545fedc29630fa70158128dca7d Mon Sep 17 00:00:00 2001 From: Huang Yu Date: Mon, 30 Nov 2015 19:30:17 -0800 Subject: [PATCH] fix navigator lint warnings Summary: fix some lint warnings under `Libraries/CustomComponents/Navigator/` directory Closes https://github.com/facebook/react-native/pull/4447 Reviewed By: svcscm Differential Revision: D2706390 Pulled By: ericvicenti fb-gh-sync-id: 5bfed687265e07a162ffc528a41fa5b0d384f635 --- Libraries/CustomComponents/Navigator/Navigator.js | 4 ++-- .../Navigator/NavigatorBreadcrumbNavigationBar.js | 10 +++++----- .../NavigatorBreadcrumbNavigationBarStyles.ios.js | 2 +- .../Navigator/NavigatorNavigationBar.js | 1 - .../Navigator/NavigatorNavigationBarStylesIOS.js | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index e11ee2505..22bb84365 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -675,7 +675,7 @@ var Navigator = React.createClass({ this.state.presentedIndex = destIndex; this._transitionTo( transitionBackToPresentedIndex, - - transitionVelocity, + -transitionVelocity, 1 - this.spring.getCurrentValue() ); } @@ -750,7 +750,7 @@ var Navigator = React.createClass({ var isTravelVertical = gesture.direction === 'top-to-bottom' || gesture.direction === 'bottom-to-top'; var isTravelInverted = gesture.direction === 'right-to-left' || gesture.direction === 'bottom-to-top'; var distance = isTravelVertical ? gestureState.dy : gestureState.dx; - distance = isTravelInverted ? - distance : distance; + distance = isTravelInverted ? -distance : distance; var gestureDetectMovement = gesture.gestureDetectMovement; var nextProgress = (distance - gestureDetectMovement) / (gesture.fullDistance - gestureDetectMovement); diff --git a/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBar.js b/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBar.js index b205327af..ccf28f1f9 100644 --- a/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBar.js +++ b/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBar.js @@ -46,11 +46,11 @@ var PropTypes = React.PropTypes; /** * Reusable props objects. */ -var CRUMB_PROPS = Interpolators.map(() => {return {style: {}};}); -var ICON_PROPS = Interpolators.map(() => {return {style: {}};}); -var SEPARATOR_PROPS = Interpolators.map(() => {return {style: {}};}); -var TITLE_PROPS = Interpolators.map(() => {return {style: {}};}); -var RIGHT_BUTTON_PROPS = Interpolators.map(() => {return {style: {}};}); +var CRUMB_PROPS = Interpolators.map(() => ({style: {}})); +var ICON_PROPS = Interpolators.map(() => ({style: {}})); +var SEPARATOR_PROPS = Interpolators.map(() => ({style: {}})); +var TITLE_PROPS = Interpolators.map(() => ({style: {}})); +var RIGHT_BUTTON_PROPS = Interpolators.map(() => ({style: {}})); var navStatePresentedIndex = function(navState) { diff --git a/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBarStyles.ios.js b/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBarStyles.ios.js index d73cb5661..eea15eee9 100644 --- a/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBarStyles.ios.js +++ b/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBarStyles.ios.js @@ -136,7 +136,7 @@ CENTER[0] = { Title: merge(FIRST_TITLE_BASE, {opacity: 1}), RightItem: CENTER[0].RightItem, }; -LEFT[0].Title = merge(FIRST_TITLE_BASE, {left: - SCREEN_WIDTH / 4, opacity: 0}); +LEFT[0].Title = merge(FIRST_TITLE_BASE, {left: -SCREEN_WIDTH / 4, opacity: 0}); RIGHT[0].Title = merge(FIRST_TITLE_BASE, {opacity: 0}); diff --git a/Libraries/CustomComponents/Navigator/NavigatorNavigationBar.js b/Libraries/CustomComponents/Navigator/NavigatorNavigationBar.js index 2b6c79def..b6fbcdc37 100644 --- a/Libraries/CustomComponents/Navigator/NavigatorNavigationBar.js +++ b/Libraries/CustomComponents/Navigator/NavigatorNavigationBar.js @@ -30,7 +30,6 @@ var React = require('React'); var NavigatorNavigationBarStylesAndroid = require('NavigatorNavigationBarStylesAndroid'); var NavigatorNavigationBarStylesIOS = require('NavigatorNavigationBarStylesIOS'); var Platform = require('Platform'); -var StaticContainer = require('StaticContainer.react'); var StyleSheet = require('StyleSheet'); var View = require('View'); diff --git a/Libraries/CustomComponents/Navigator/NavigatorNavigationBarStylesIOS.js b/Libraries/CustomComponents/Navigator/NavigatorNavigationBarStylesIOS.js index fdad315ad..9e1467751 100644 --- a/Libraries/CustomComponents/Navigator/NavigatorNavigationBarStylesIOS.js +++ b/Libraries/CustomComponents/Navigator/NavigatorNavigationBarStylesIOS.js @@ -76,8 +76,8 @@ var BASE_STYLES = { // center-to-left transition on the current navigation item. var Stages = { Left: { - Title: merge(BASE_STYLES.Title, { left: - SCREEN_WIDTH / 2, opacity: 0 }), - LeftButton: merge(BASE_STYLES.LeftButton, { left: - SCREEN_WIDTH / 3, opacity: 0 }), + Title: merge(BASE_STYLES.Title, { left: -SCREEN_WIDTH / 2, opacity: 0 }), + LeftButton: merge(BASE_STYLES.LeftButton, { left: -SCREEN_WIDTH / 3, opacity: 0 }), RightButton: merge(BASE_STYLES.RightButton, { left: SCREEN_WIDTH / 3, opacity: 0 }), }, Center: {