From e09b7429e7d504367f1bdd329ecdf2b202dc42ca Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Tue, 5 Jun 2018 14:22:32 +0200 Subject: [PATCH] fix: properly center icons in bottom navigation --- src/components/BottomNavigation.js | 4 +-- .../BottomNavigation.test.js.snap | 32 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/BottomNavigation.js b/src/components/BottomNavigation.js index ebb7e98..e914a14 100644 --- a/src/components/BottomNavigation.js +++ b/src/components/BottomNavigation.js @@ -623,10 +623,10 @@ class BottomNavigation extends React.Component, State> { ? shifting ? active.interpolate({ inputRange: [0, 1], - outputRange: [10, 0], + outputRange: [7, 0], }) : 0 - : 10; + : 7; // We render the active icon and label on top of inactive ones and cross-fade them on change. // This trick gives the illusion that we are animating between active and inactive colors. diff --git a/src/components/__tests__/__snapshots__/BottomNavigation.test.js.snap b/src/components/__tests__/__snapshots__/BottomNavigation.test.js.snap index c54afd5..64b3cff 100644 --- a/src/components/__tests__/__snapshots__/BottomNavigation.test.js.snap +++ b/src/components/__tests__/__snapshots__/BottomNavigation.test.js.snap @@ -127,7 +127,7 @@ exports[`hides labels in non-shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -254,7 +254,7 @@ exports[`hides labels in non-shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -381,7 +381,7 @@ exports[`hides labels in non-shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -631,7 +631,7 @@ exports[`hides labels in shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -758,7 +758,7 @@ exports[`hides labels in shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -885,7 +885,7 @@ exports[`hides labels in shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -1714,7 +1714,7 @@ exports[`renders custom icon and label in shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -1821,7 +1821,7 @@ exports[`renders custom icon and label in shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -1928,7 +1928,7 @@ exports[`renders custom icon and label in shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -2035,7 +2035,7 @@ exports[`renders custom icon and label in shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -3292,7 +3292,7 @@ exports[`renders custom icon and label with custom colors in shifting bottom nav "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -3481,7 +3481,7 @@ exports[`renders custom icon and label with custom colors in shifting bottom nav "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -4820,7 +4820,7 @@ exports[`renders shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -5009,7 +5009,7 @@ exports[`renders shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -5198,7 +5198,7 @@ exports[`renders shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24, @@ -5387,7 +5387,7 @@ exports[`renders shifting bottom navigation 1`] = ` "marginTop": 2, "transform": Array [ Object { - "translateY": 10, + "translateY": 7, }, ], "width": 24,