Skip to content

Commit

Permalink
[home] Update react-navigation to fix iPhone XR and iPhone XS Max sup…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
brentvatne committed Oct 9, 2018
1 parent 5913221 commit 03220c8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/native-component-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"react-native-paper": "^2.0.0-alpha.4",
"react-native-platform-touchable": "^1.1.1",
"react-native-svg": "6.2.2",
"react-navigation": "^2.17.0",
"react-navigation": "3.0.0-alpha.4",
"react-navigation-header-buttons": "^1.2.1",
"react-navigation-material-bottom-tabs": "^0.3.0",
"regl": "^1.3.0",
Expand Down
1 change: 0 additions & 1 deletion home/navigation/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import ProjectsForUserScreen from '../screens/ProjectsForUserScreen';
import SnacksForUserScreen from '../screens/SnacksForUserScreen';

import Colors from '../constants/Colors';
import SearchBar from '../components/SearchBar';
import defaultNavigationOptions from './defaultNavigationOptions';

const ProjectsStack = createStackNavigator(
Expand Down
2 changes: 1 addition & 1 deletion home/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"react-native": "^0.57.1",
"react-native-deprecated-custom-components": "^0.1.0",
"react-native-infinite-scroll-view": "^0.4.5",
"react-navigation": "^2.17.0",
"react-navigation": "3.0.0-alpha.4",
"react-navigation-material-bottom-tabs": "^0.3.0",
"react-redux": "^5.0.1",
"react-timer-mixin": "^0.13.3",
Expand Down
15 changes: 12 additions & 3 deletions home/utils/isIPhoneX.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { Platform, Dimensions } from 'react-native';
const { width, height } = Dimensions.get('window');
const isIPhoneX = Platform.OS === 'ios' && width === 375 && height === 812;
export default isIPhoneX;
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');
const IS_IPHONE_X =
Platform.OS === 'ios' &&
!Platform.isPad &&
!Platform.isTVOS &&
(WINDOW_HEIGHT === IPHONE_XS_HEIGHT ||
WINDOW_WIDTH === IPHONE_XS_HEIGHT ||
WINDOW_HEIGHT === IPHONE_XR_HEIGHT ||
WINDOW_WIDTH === IPHONE_XR_HEIGHT);
export default IS_IPHONE_X;
2 changes: 1 addition & 1 deletion modules/NCL/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"react": "16.5.0",
"react-native": "^0.57.1",
"react-native-platform-touchable": "^1.1.1",
"react-navigation": "^2.0.1",
"react-navigation": "3.0.0-alpha.4",
"url": "^0.11.0"
},
"devDependencies": {
Expand Down

0 comments on commit 03220c8

Please sign in to comment.