Skip to content

Commit

Permalink
Cherry pick from develop
Browse files Browse the repository at this point in the history
  • Loading branch information
peachbits committed Nov 5, 2020
1 parent 2055180 commit a34cdff
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 37 deletions.
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PODS:
- disklet (0.4.5):
- React
- DoubleConversion (1.1.6)
- edge-login-ui-rn (0.6.20):
- edge-login-ui-rn (0.6.21):
- React
- Firebase/Core (5.3.0):
- Firebase/CoreOnly
Expand Down Expand Up @@ -295,7 +295,7 @@ SPEC CHECKSUMS:
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
disklet: 4f586f90b70fdb46f06614a5b7342eda5c90f253
DoubleConversion: bb338842f62ab1d708ceb63ec3d999f0f3d98ecd
edge-login-ui-rn: e48e77b4d84e8922ef8624b4736494fb8b0b020a
edge-login-ui-rn: c7397d26a0e62344a17a0506b2485fba288b296d
Firebase: 68afeeb05461db02d7c9e3215cda28068670f4aa
FirebaseAnalytics: b3628aea54c50464c32c393fb2ea032566e7ecc2
FirebaseCore: 62f1b792a49bb9e8b4073f24606d2c93ffc352f0
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"long": "4.0.0",
"process-nextick-args": "2.0.0",
"randombytes": "2.1.0",
"react-native-safe-area-view": "0.14.9",
"readable-stream": "2.3.6",
"regenerator-runtime": "0.13.2",
"ripemd160": "2.0.2",
Expand Down Expand Up @@ -131,7 +132,7 @@
"edge-currency-bitcoin": "^4.9.2",
"edge-currency-monero": "^0.2.6",
"edge-exchange-plugins": "^0.11.11",
"edge-login-ui-rn": "^0.6.20",
"edge-login-ui-rn": "^0.6.21",
"lodash": "^4.17.19",
"qrcode-generator": "^1.4.4",
"react": "16.8.3",
Expand Down Expand Up @@ -160,7 +161,7 @@
"react-native-randombytes": "^3.5.3",
"react-native-router-flux": "4.0.6",
"react-native-safari-view": "^2.1.0",
"react-native-safe-area-view": "^0.14.4",
"react-native-safe-area-view": "0.14.9",
"react-native-share": "^3.8.3",
"react-native-slider": "^0.11.0",
"react-native-smart-splash-screen": "git://github.com/swansontec/react-native-smart-splash-screen#fix-rn59",
Expand Down
70 changes: 70 additions & 0 deletions patches/react-native-safe-area-view+0.14.9.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
diff --git a/node_modules/react-native-safe-area-view/index.d.ts b/node_modules/react-native-safe-area-view/index.d.ts
index 4f689fb..9219d08 100644
--- a/node_modules/react-native-safe-area-view/index.d.ts
+++ b/node_modules/react-native-safe-area-view/index.d.ts
@@ -1,6 +1,7 @@
import { ComponentClass } from 'react';
import { ViewProperties } from 'react-native';

+
export type SafeAreaViewForceInsetValue = 'always' | 'never';

export interface SafeAreaViewProps extends ViewProperties {
@@ -29,4 +30,6 @@ export const withSafeArea: <P extends object>(
Component: React.ComponentType<P>
) => React.ComponentType<P & SafeAreaViewProps>;

+export const isIPhoneX = boolean;
+
export default SafeAreaView;
diff --git a/node_modules/react-native-safe-area-view/index.js b/node_modules/react-native-safe-area-view/index.js
index a21ff41..96f97e9 100644
--- a/node_modules/react-native-safe-area-view/index.js
+++ b/node_modules/react-native-safe-area-view/index.js
@@ -15,6 +15,12 @@ const X_WIDTH = 375;
const X_HEIGHT = 812;
const XSMAX_WIDTH = 414;
const XSMAX_HEIGHT = 896;
+const IPHONE12_WIDTH = 390;
+const IPHONE12_HEIGHT = 844;
+const IPHONE12MAX_WIDTH = 428;
+const IPHONE12MAX_HEIGHT = 926;
+const IPHONE12MINI_WIDTH = 360;
+const IPHONE12MINI_HEIGHT = 780;
const PAD_WIDTH = 768;
const PAD_HEIGHT = 1024;
const IPADPRO11_WIDTH = 834;
@@ -33,7 +39,7 @@ const { height: D_HEIGHT, width: D_WIDTH } = getResolvedDimensions();
const PlatformConstants = Platform.constants || {};
const { minor = 0 } = PlatformConstants.reactNativeVersion || {};

-const isIPhoneX = (() => {
+export const isIPhoneX = (() => {
if (Platform.OS === 'web') return false;

return (
@@ -41,7 +47,13 @@ const isIPhoneX = (() => {
((D_HEIGHT === X_HEIGHT && D_WIDTH === X_WIDTH) ||
(D_HEIGHT === X_WIDTH && D_WIDTH === X_HEIGHT))) ||
((D_HEIGHT === XSMAX_HEIGHT && D_WIDTH === XSMAX_WIDTH) ||
- (D_HEIGHT === XSMAX_WIDTH && D_WIDTH === XSMAX_HEIGHT))
+ (D_HEIGHT === XSMAX_WIDTH && D_WIDTH === XSMAX_HEIGHT)) ||
+ ((D_HEIGHT === IPHONE12_HEIGHT && D_WIDTH === IPHONE12_WIDTH) ||
+ (D_HEIGHT === IPHONE12_WIDTH && D_WIDTH === IPHONE12_HEIGHT)) ||
+ ((D_HEIGHT === IPHONE12MAX_HEIGHT && D_WIDTH === IPHONE12MAX_WIDTH) ||
+ (D_HEIGHT === IPHONE12MAX_WIDTH && D_WIDTH === IPHONE12MAX_HEIGHT)) ||
+ ((D_HEIGHT === IPHONE12MINI_HEIGHT && D_WIDTH === IPHONE12MINI_WIDTH) ||
+ (D_HEIGHT === IPHONE12MINI_WIDTH && D_WIDTH === IPHONE12MINI_HEIGHT))
);
})();

diff --git a/node_modules/react-native-safe-area-view/index.js.flow b/node_modules/react-native-safe-area-view/index.js.flow
index 4c59929..a3274a2 100644
--- a/node_modules/react-native-safe-area-view/index.js.flow
+++ b/node_modules/react-native-safe-area-view/index.js.flow
@@ -27,3 +27,5 @@ declare export function getInset(
value: 'horizontal' | 'right' | 'left' | 'vertical' | 'top' | 'bottom',
isLandscape: boolean
): number
+
+declare export var isIPhoneX: boolean;
6 changes: 3 additions & 3 deletions src/components/modals/SetCustomNodesModal.ui.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @flow
import * as React from 'react'
import { Platform, StyleSheet, TextInput, View } from 'react-native'
import { isIPhoneX } from 'react-native-safe-area-view'

import { MATERIAL_COMMUNITY, SERVER } from '../../constants/indexConstants.js'
import s from '../../locales/strings.js'
Expand All @@ -11,7 +12,6 @@ import { Icon } from '../../modules/UI/components/Icon/Icon.ui.js'
import { InteractiveModal } from '../../modules/UI/components/Modals/InteractiveModal/InteractiveModal.ui.js'
import { THEME } from '../../theme/variables/airbitz.js'
import { PLATFORM } from '../../theme/variables/platform.js'
import { isIphoneX } from '../../util/isIphoneX.js'
import { noOp } from '../../util/utils.js'

export type SetCustomNodesModalOwnProps = {
Expand Down Expand Up @@ -116,11 +116,11 @@ const rawStyles = {
borderWidth: 1,
borderColor: '#CCCCCC',
borderRadius: 3,
height: PLATFORM.deviceHeight * 0.13 - (Platform.OS === 'android' ? 23 : 0) + (isIphoneX ? 60 : 0),
height: PLATFORM.deviceHeight * 0.13 - (Platform.OS === 'android' ? 23 : 0) + (isIPhoneX ? 60 : 0),
padding: 3
},
customNodesInput: {
height: PLATFORM.deviceHeight * 0.13 - (Platform.OS === 'android' ? 23 : 0) + (isIphoneX ? 60 : 0) - 8,
height: PLATFORM.deviceHeight * 0.13 - (Platform.OS === 'android' ? 23 : 0) + (isIPhoneX ? 60 : 0) - 8,
color: THEME.COLORS.GRAY_1,
fontSize: 15,
fontFamily: THEME.FONTS.DEFAULT,
Expand Down
4 changes: 2 additions & 2 deletions src/components/scenes/EdgeLoginScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import type { EdgeLobby } from 'edge-core-js'
import * as React from 'react'
import { ActivityIndicator, Image, StyleSheet, Text, View } from 'react-native'
import { isIPhoneX } from 'react-native-safe-area-view'
import { sprintf } from 'sprintf-js'

import s from '../../locales/strings.js'
import { PrimaryButton } from '../../modules/UI/components/Buttons/PrimaryButton.ui.js'
import { SecondaryButton } from '../../modules/UI/components/Buttons/SecondaryButton.ui.js'
import { THEME } from '../../theme/variables/airbitz'
import { isIphoneX } from '../../util/isIphoneX.js'
import { SceneWrapper } from '../common/SceneWrapper.js'

type EdgeLoginSceneProps = {
Expand Down Expand Up @@ -163,7 +163,7 @@ const rawStyles = {
marginLeft: '5%',
flexDirection: 'row',
alignSelf: 'flex-end',
paddingBottom: isIphoneX ? 30 : 20
paddingBottom: isIPhoneX ? 30 : 20
},
buttonsProcessing: {
flex: 1,
Expand Down
5 changes: 2 additions & 3 deletions src/theme/variables/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

import { Dimensions, Platform } from 'react-native'
import ExtraDimensions from 'react-native-extra-dimensions-android'

import { isIphoneX } from '../../util/isIphoneX.js'
import { isIPhoneX } from 'react-native-safe-area-view'

const deviceWidth = Dimensions.get('window').width
const deviceHeight = Platform.OS === 'ios' ? Dimensions.get('window').height : ExtraDimensions.get('REAL_WINDOW_HEIGHT')

export const PLATFORM = {
// device - toolbar - footer
usableHeight: deviceHeight - (Platform.OS === 'ios' ? 44 : 62) - 69 - (isIphoneX ? 57 : 0),
usableHeight: deviceHeight - (Platform.OS === 'ios' ? 44 : 62) - 69 - (isIPhoneX ? 57 : 0),
deviceWidth,
deviceHeight
}
6 changes: 0 additions & 6 deletions src/util/isIphoneX.js

This file was deleted.

24 changes: 5 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3948,10 +3948,10 @@ edge-exchange-plugins@^0.11.11:
iso4217 "^0.2.0"
utf8 "^3.0.0"

edge-login-ui-rn@^0.6.20:
version "0.6.20"
resolved "https://registry.yarnpkg.com/edge-login-ui-rn/-/edge-login-ui-rn-0.6.20.tgz#44809c77e20745840cdee0859994974e8dff87da"
integrity sha512-4Dk50nSiErPeUse0KYVnAhICTnk2BAvOhm38V0f2xloB2UqdW5xjJNVbVBzzeDgBWEyV3uBn5AtDGtv4M9OTxQ==
edge-login-ui-rn@^0.6.21:
version "0.6.21"
resolved "https://registry.yarnpkg.com/edge-login-ui-rn/-/edge-login-ui-rn-0.6.21.tgz#4a4bab5e6fe25d49aafe7b1a9209a9311b12cda9"
integrity sha512-mi3I49pG+ThTmFH76d6TRzKVWbKb6DJlhbj7BtWjk+SPxYVPvD6zwlzQPk+bWdLmutlcdNVgFueo5cM5oN4VQQ==
dependencies:
cleaners "^0.3.1"
material-ui "^0.20.0"
Expand Down Expand Up @@ -9629,21 +9629,7 @@ react-native-safari-view@^2.1.0:
resolved "https://registry.yarnpkg.com/react-native-safari-view/-/react-native-safari-view-2.1.0.tgz#1e0cd12c62bce79bc1759c7e281646b08b61c959"
integrity sha1-HgzRLGK855vBdZx+KBZGsIthyVk=

[email protected]:
version "0.11.0"
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.11.0.tgz#4f3dda43c2bace37965e7c6aef5fc83d4f19d174"
integrity sha512-N3nElaahu1Me2ltnfc9acpgt1znm6pi8DSadKy79kvdzKwvVIzw0IXueA/Hjr51eCW1BsfNw7D1SgBT9U6qEkA==
dependencies:
hoist-non-react-statics "^2.3.1"

react-native-safe-area-view@^0.14.4:
version "0.14.4"
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.14.4.tgz#1647fa74fd452cb8cee4f47bd08de3829451bf5d"
integrity sha512-ypDQVoAyNHBhMR1IGfadm8kskNzPg5czrDAzQEu5MXG9Ahoi5f1cL/rT2KO+R9f6xRjf6b1IjY53m0B0xHRd0A==
dependencies:
hoist-non-react-statics "^2.3.1"

react-native-safe-area-view@^0.14.9:
[email protected], [email protected], react-native-safe-area-view@^0.14.9:
version "0.14.9"
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.14.9.tgz#90ee8383037010d9a5055a97cf97e4c1da1f0c3d"
integrity sha512-WII/ulhpVyL/qbYb7vydq7dJAfZRBcEhg4/UWt6F6nAKpLa3gAceMOxBxI914ppwSP/TdUsandFy6lkJQE0z4A==
Expand Down

0 comments on commit a34cdff

Please sign in to comment.