diff --git a/ios/GitPoint/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/GitPoint/Images.xcassets/AppIcon.appiconset/Contents.json index fd6012a4b..7dbe1f67b 100644 --- a/ios/GitPoint/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/GitPoint/Images.xcassets/AppIcon.appiconset/Contents.json @@ -143,10 +143,15 @@ "idiom" : "ipad", "filename" : "icon-83.5@2x.png", "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } -} +} \ No newline at end of file diff --git a/ios/GitPoint/Images.xcassets/Contents.json b/ios/GitPoint/Images.xcassets/Contents.json index 2d92bd53f..da4a164c9 100644 --- a/ios/GitPoint/Images.xcassets/Contents.json +++ b/ios/GitPoint/Images.xcassets/Contents.json @@ -3,4 +3,4 @@ "version" : 1, "author" : "xcode" } -} +} \ No newline at end of file diff --git a/ios/GitPoint/Images.xcassets/LaunchImage-2.launchimage/Contents.json b/ios/GitPoint/Images.xcassets/LaunchImage-2.launchimage/Contents.json deleted file mode 100644 index e37b64949..000000000 --- a/ios/GitPoint/Images.xcassets/LaunchImage-2.launchimage/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "subtype" : "retina4", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ios/GitPoint/Images.xcassets/LaunchImage-3.launchimage/Contents.json b/ios/GitPoint/Images.xcassets/LaunchImage-3.launchimage/Contents.json deleted file mode 100644 index e37b64949..000000000 --- a/ios/GitPoint/Images.xcassets/LaunchImage-3.launchimage/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "subtype" : "retina4", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ios/GitPoint/Images.xcassets/LaunchImage-4.launchimage/Contents.json b/ios/GitPoint/Images.xcassets/LaunchImage-4.launchimage/Contents.json deleted file mode 100644 index e37b64949..000000000 --- a/ios/GitPoint/Images.xcassets/LaunchImage-4.launchimage/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "subtype" : "retina4", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ios/GitPoint/Images.xcassets/LaunchImage.launchimage/Contents.json b/ios/GitPoint/Images.xcassets/LaunchImage.launchimage/Contents.json index a2cd30f8e..c8e91e684 100644 --- a/ios/GitPoint/Images.xcassets/LaunchImage.launchimage/Contents.json +++ b/ios/GitPoint/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -36,6 +36,15 @@ "scale": "3x", "subtype": "736h" }, + { + "extent": "full-screen", + "idiom": "iphone", + "filename": "Default-Portrait-2436h@3x.png", + "minimum-system-version": "11.0", + "orientation": "portrait", + "scale": "3x", + "subtype": "2436h" + }, { "extent": "full-screen", "idiom": "iphone", diff --git a/ios/GitPoint/Images.xcassets/LaunchImage.launchimage/Default-Portrait-2436h@3x.png b/ios/GitPoint/Images.xcassets/LaunchImage.launchimage/Default-Portrait-2436h@3x.png new file mode 100644 index 000000000..e4d76f15c Binary files /dev/null and b/ios/GitPoint/Images.xcassets/LaunchImage.launchimage/Default-Portrait-2436h@3x.png differ diff --git a/package.json b/package.json index fba261d8d..d59c2df73 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "react-native-communications": "^2.2.1", "react-native-config": "^0.6.0", "react-native-cookies": "^3.2.0", - "react-native-device-info": "^0.11.0", + "react-native-device-info": "^0.15.1", "react-native-elements": "^0.18.2", "react-native-htmlview": "^0.12.0", "react-native-i18n": "^2.0.4", @@ -87,7 +87,7 @@ "react-native-syntax-highlighter": "^1.2.1", "react-native-table-component": "^1.1.0", "react-native-vector-icons": "^4.4.0", - "react-navigation": "^1.0.0-beta.11", + "react-navigation": "^1.0.0-beta.27", "react-redux": "^5.0.2", "react-syntax-highlighter": "^5.6.2", "redux": "^3.6.0", diff --git a/src/components/parallax-scroll.component.js b/src/components/parallax-scroll.component.js index 1243ccf50..3d15c67f9 100644 --- a/src/components/parallax-scroll.component.js +++ b/src/components/parallax-scroll.component.js @@ -5,8 +5,9 @@ import { Icon } from 'react-native-elements'; import styled from 'styled-components/native'; import { colors, normalize, fonts } from 'config'; +import { isIphoneX } from 'utils'; -const STICKY_HEADER_HEIGHT = 62; +const STICKY_HEADER_HEIGHT = isIphoneX() ? 76 : 62; type Props = { renderContent: any, diff --git a/src/notifications/screens/notifications.screen.js b/src/notifications/screens/notifications.screen.js index 3507af51a..a6b0a15f5 100644 --- a/src/notifications/screens/notifications.screen.js +++ b/src/notifications/screens/notifications.screen.js @@ -15,7 +15,7 @@ import { NotificationListItem, } from 'components'; import { colors, fonts, normalize } from 'config'; -import { translate } from 'utils'; +import { isIphoneX, translate } from 'utils'; import { getUnreadNotifications, getParticipatingNotifications, @@ -55,7 +55,7 @@ const mapDispatchToProps = dispatch => const ButtonGroupWrapper = styled.View` background-color: ${colors.greyLight}; - padding-top: ${Platform.OS === 'ios' ? 30 : 10}; + padding-top: ${Platform.OS === 'ios' ? (isIphoneX() ? 40 : 30) : 10}; padding-bottom: 10; margin-bottom: 15; `; diff --git a/src/search/screens/search.screen.js b/src/search/screens/search.screen.js index a3d7ce57c..f138bc115 100644 --- a/src/search/screens/search.screen.js +++ b/src/search/screens/search.screen.js @@ -20,7 +20,7 @@ import { SearchBar, } from 'components'; import { colors, fonts, normalize } from 'config'; -import { translate } from 'utils'; +import { isIphoneX, translate } from 'utils'; import { searchRepos, searchUsers } from '../index'; const mapStateToProps = state => ({ @@ -43,7 +43,14 @@ const mapDispatchToProps = dispatch => const styles = StyleSheet.create({ searchBarWrapper: { flexDirection: 'row', - marginTop: Platform.OS === 'ios' ? 20 : 5, + ...Platform.select({ + ios: { + marginTop: isIphoneX() ? 30 : 20, + }, + android: { + marginTop: 5, + }, + }), }, searchContainer: { width: Dimensions.get('window').width, @@ -217,7 +224,8 @@ class Search extends Component { showsCancelButton={this.state.searchFocus} onFocus={() => this.setState({ searchFocus: true })} onCancelButtonPress={() => - this.setState({ searchStart: false, query: '' })} + this.setState({ searchStart: false, query: '' }) + } onSearchButtonPress={text => { this.search(text); }} diff --git a/src/utils/device-helpers.js b/src/utils/device-helpers.js new file mode 100644 index 000000000..a8a11e23d --- /dev/null +++ b/src/utils/device-helpers.js @@ -0,0 +1,3 @@ +import DeviceInfo from 'react-native-device-info'; + +export const isIphoneX = () => DeviceInfo.getModel() === 'iPhone X'; diff --git a/src/utils/index.js b/src/utils/index.js index 365b3f91c..504526f53 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -3,5 +3,6 @@ export * from './loading-animation'; export * from './text-helper'; export * from './method-helpers'; export * from './color-helpers'; +export * from './device-helpers'; export * from './event-helpers'; export * from './localization-helper'; diff --git a/testenv.js b/testenv.js index c1b87007a..de4e7820b 100644 --- a/testenv.js +++ b/testenv.js @@ -38,3 +38,9 @@ jest.mock('react-native-code-push', () => ({})); jest.mock('react-native-safari-view', () => ({})); jest.mock('react-native-linear-gradient', () => ({})); + +jest.mock('react-native-device-info', () => { + return { + getModel: jest.fn(), + }; +}); diff --git a/yarn.lock b/yarn.lock index 44cf4f841..985a6787b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6113,9 +6113,9 @@ react-native-cookies@^3.2.0: dependencies: invariant "^2.1.0" -react-native-device-info@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/react-native-device-info/-/react-native-device-info-0.11.0.tgz#e96dd0e3f8a7d7e3022c1f441f51fa912fdc7444" +react-native-device-info@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/react-native-device-info/-/react-native-device-info-0.15.1.tgz#abe2e4c005816dbf8e77445389a96e5e37ed34c6" react-native-dismiss-keyboard@1.0.0: version "1.0.0" @@ -6297,7 +6297,7 @@ react-native@0.52.0: xmldoc "^0.4.0" yargs "^9.0.0" -react-navigation@^1.0.0-beta.11: +react-navigation@^1.0.0-beta.27: version "1.0.0-beta.27" resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-1.0.0-beta.27.tgz#e6263b01975cd790e32b3711c2eb6cead96c102c" dependencies: