Skip to content

Commit a34cdff

Browse files
committed
Cherry pick from develop
1 parent 2055180 commit a34cdff

File tree

8 files changed

+87
-37
lines changed

8 files changed

+87
-37
lines changed

ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PODS:
88
- disklet (0.4.5):
99
- React
1010
- DoubleConversion (1.1.6)
11-
- edge-login-ui-rn (0.6.20):
11+
- edge-login-ui-rn (0.6.21):
1212
- React
1313
- Firebase/Core (5.3.0):
1414
- Firebase/CoreOnly
@@ -295,7 +295,7 @@ SPEC CHECKSUMS:
295295
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
296296
disklet: 4f586f90b70fdb46f06614a5b7342eda5c90f253
297297
DoubleConversion: bb338842f62ab1d708ceb63ec3d999f0f3d98ecd
298-
edge-login-ui-rn: e48e77b4d84e8922ef8624b4736494fb8b0b020a
298+
edge-login-ui-rn: c7397d26a0e62344a17a0506b2485fba288b296d
299299
Firebase: 68afeeb05461db02d7c9e3215cda28068670f4aa
300300
FirebaseAnalytics: b3628aea54c50464c32c393fb2ea032566e7ecc2
301301
FirebaseCore: 62f1b792a49bb9e8b4073f24606d2c93ffc352f0

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"long": "4.0.0",
101101
"process-nextick-args": "2.0.0",
102102
"randombytes": "2.1.0",
103+
"react-native-safe-area-view": "0.14.9",
103104
"readable-stream": "2.3.6",
104105
"regenerator-runtime": "0.13.2",
105106
"ripemd160": "2.0.2",
@@ -131,7 +132,7 @@
131132
"edge-currency-bitcoin": "^4.9.2",
132133
"edge-currency-monero": "^0.2.6",
133134
"edge-exchange-plugins": "^0.11.11",
134-
"edge-login-ui-rn": "^0.6.20",
135+
"edge-login-ui-rn": "^0.6.21",
135136
"lodash": "^4.17.19",
136137
"qrcode-generator": "^1.4.4",
137138
"react": "16.8.3",
@@ -160,7 +161,7 @@
160161
"react-native-randombytes": "^3.5.3",
161162
"react-native-router-flux": "4.0.6",
162163
"react-native-safari-view": "^2.1.0",
163-
"react-native-safe-area-view": "^0.14.4",
164+
"react-native-safe-area-view": "0.14.9",
164165
"react-native-share": "^3.8.3",
165166
"react-native-slider": "^0.11.0",
166167
"react-native-smart-splash-screen": "git://github.com/swansontec/react-native-smart-splash-screen#fix-rn59",
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
diff --git a/node_modules/react-native-safe-area-view/index.d.ts b/node_modules/react-native-safe-area-view/index.d.ts
2+
index 4f689fb..9219d08 100644
3+
--- a/node_modules/react-native-safe-area-view/index.d.ts
4+
+++ b/node_modules/react-native-safe-area-view/index.d.ts
5+
@@ -1,6 +1,7 @@
6+
import { ComponentClass } from 'react';
7+
import { ViewProperties } from 'react-native';
8+
9+
+
10+
export type SafeAreaViewForceInsetValue = 'always' | 'never';
11+
12+
export interface SafeAreaViewProps extends ViewProperties {
13+
@@ -29,4 +30,6 @@ export const withSafeArea: <P extends object>(
14+
Component: React.ComponentType<P>
15+
) => React.ComponentType<P & SafeAreaViewProps>;
16+
17+
+export const isIPhoneX = boolean;
18+
+
19+
export default SafeAreaView;
20+
diff --git a/node_modules/react-native-safe-area-view/index.js b/node_modules/react-native-safe-area-view/index.js
21+
index a21ff41..96f97e9 100644
22+
--- a/node_modules/react-native-safe-area-view/index.js
23+
+++ b/node_modules/react-native-safe-area-view/index.js
24+
@@ -15,6 +15,12 @@ const X_WIDTH = 375;
25+
const X_HEIGHT = 812;
26+
const XSMAX_WIDTH = 414;
27+
const XSMAX_HEIGHT = 896;
28+
+const IPHONE12_WIDTH = 390;
29+
+const IPHONE12_HEIGHT = 844;
30+
+const IPHONE12MAX_WIDTH = 428;
31+
+const IPHONE12MAX_HEIGHT = 926;
32+
+const IPHONE12MINI_WIDTH = 360;
33+
+const IPHONE12MINI_HEIGHT = 780;
34+
const PAD_WIDTH = 768;
35+
const PAD_HEIGHT = 1024;
36+
const IPADPRO11_WIDTH = 834;
37+
@@ -33,7 +39,7 @@ const { height: D_HEIGHT, width: D_WIDTH } = getResolvedDimensions();
38+
const PlatformConstants = Platform.constants || {};
39+
const { minor = 0 } = PlatformConstants.reactNativeVersion || {};
40+
41+
-const isIPhoneX = (() => {
42+
+export const isIPhoneX = (() => {
43+
if (Platform.OS === 'web') return false;
44+
45+
return (
46+
@@ -41,7 +47,13 @@ const isIPhoneX = (() => {
47+
((D_HEIGHT === X_HEIGHT && D_WIDTH === X_WIDTH) ||
48+
(D_HEIGHT === X_WIDTH && D_WIDTH === X_HEIGHT))) ||
49+
((D_HEIGHT === XSMAX_HEIGHT && D_WIDTH === XSMAX_WIDTH) ||
50+
- (D_HEIGHT === XSMAX_WIDTH && D_WIDTH === XSMAX_HEIGHT))
51+
+ (D_HEIGHT === XSMAX_WIDTH && D_WIDTH === XSMAX_HEIGHT)) ||
52+
+ ((D_HEIGHT === IPHONE12_HEIGHT && D_WIDTH === IPHONE12_WIDTH) ||
53+
+ (D_HEIGHT === IPHONE12_WIDTH && D_WIDTH === IPHONE12_HEIGHT)) ||
54+
+ ((D_HEIGHT === IPHONE12MAX_HEIGHT && D_WIDTH === IPHONE12MAX_WIDTH) ||
55+
+ (D_HEIGHT === IPHONE12MAX_WIDTH && D_WIDTH === IPHONE12MAX_HEIGHT)) ||
56+
+ ((D_HEIGHT === IPHONE12MINI_HEIGHT && D_WIDTH === IPHONE12MINI_WIDTH) ||
57+
+ (D_HEIGHT === IPHONE12MINI_WIDTH && D_WIDTH === IPHONE12MINI_HEIGHT))
58+
);
59+
})();
60+
61+
diff --git a/node_modules/react-native-safe-area-view/index.js.flow b/node_modules/react-native-safe-area-view/index.js.flow
62+
index 4c59929..a3274a2 100644
63+
--- a/node_modules/react-native-safe-area-view/index.js.flow
64+
+++ b/node_modules/react-native-safe-area-view/index.js.flow
65+
@@ -27,3 +27,5 @@ declare export function getInset(
66+
value: 'horizontal' | 'right' | 'left' | 'vertical' | 'top' | 'bottom',
67+
isLandscape: boolean
68+
): number
69+
+
70+
+declare export var isIPhoneX: boolean;

src/components/modals/SetCustomNodesModal.ui.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @flow
22
import * as React from 'react'
33
import { Platform, StyleSheet, TextInput, View } from 'react-native'
4+
import { isIPhoneX } from 'react-native-safe-area-view'
45

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

1717
export type SetCustomNodesModalOwnProps = {
@@ -116,11 +116,11 @@ const rawStyles = {
116116
borderWidth: 1,
117117
borderColor: '#CCCCCC',
118118
borderRadius: 3,
119-
height: PLATFORM.deviceHeight * 0.13 - (Platform.OS === 'android' ? 23 : 0) + (isIphoneX ? 60 : 0),
119+
height: PLATFORM.deviceHeight * 0.13 - (Platform.OS === 'android' ? 23 : 0) + (isIPhoneX ? 60 : 0),
120120
padding: 3
121121
},
122122
customNodesInput: {
123-
height: PLATFORM.deviceHeight * 0.13 - (Platform.OS === 'android' ? 23 : 0) + (isIphoneX ? 60 : 0) - 8,
123+
height: PLATFORM.deviceHeight * 0.13 - (Platform.OS === 'android' ? 23 : 0) + (isIPhoneX ? 60 : 0) - 8,
124124
color: THEME.COLORS.GRAY_1,
125125
fontSize: 15,
126126
fontFamily: THEME.FONTS.DEFAULT,

src/components/scenes/EdgeLoginScene.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
import type { EdgeLobby } from 'edge-core-js'
44
import * as React from 'react'
55
import { ActivityIndicator, Image, StyleSheet, Text, View } from 'react-native'
6+
import { isIPhoneX } from 'react-native-safe-area-view'
67
import { sprintf } from 'sprintf-js'
78

89
import s from '../../locales/strings.js'
910
import { PrimaryButton } from '../../modules/UI/components/Buttons/PrimaryButton.ui.js'
1011
import { SecondaryButton } from '../../modules/UI/components/Buttons/SecondaryButton.ui.js'
1112
import { THEME } from '../../theme/variables/airbitz'
12-
import { isIphoneX } from '../../util/isIphoneX.js'
1313
import { SceneWrapper } from '../common/SceneWrapper.js'
1414

1515
type EdgeLoginSceneProps = {
@@ -163,7 +163,7 @@ const rawStyles = {
163163
marginLeft: '5%',
164164
flexDirection: 'row',
165165
alignSelf: 'flex-end',
166-
paddingBottom: isIphoneX ? 30 : 20
166+
paddingBottom: isIPhoneX ? 30 : 20
167167
},
168168
buttonsProcessing: {
169169
flex: 1,

src/theme/variables/platform.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
import { Dimensions, Platform } from 'react-native'
44
import ExtraDimensions from 'react-native-extra-dimensions-android'
5-
6-
import { isIphoneX } from '../../util/isIphoneX.js'
5+
import { isIPhoneX } from 'react-native-safe-area-view'
76

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

1110
export const PLATFORM = {
1211
// device - toolbar - footer
13-
usableHeight: deviceHeight - (Platform.OS === 'ios' ? 44 : 62) - 69 - (isIphoneX ? 57 : 0),
12+
usableHeight: deviceHeight - (Platform.OS === 'ios' ? 44 : 62) - 69 - (isIPhoneX ? 57 : 0),
1413
deviceWidth,
1514
deviceHeight
1615
}

src/util/isIphoneX.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

yarn.lock

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3948,10 +3948,10 @@ edge-exchange-plugins@^0.11.11:
39483948
iso4217 "^0.2.0"
39493949
utf8 "^3.0.0"
39503950

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

9632-
9633-
version "0.11.0"
9634-
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.11.0.tgz#4f3dda43c2bace37965e7c6aef5fc83d4f19d174"
9635-
integrity sha512-N3nElaahu1Me2ltnfc9acpgt1znm6pi8DSadKy79kvdzKwvVIzw0IXueA/Hjr51eCW1BsfNw7D1SgBT9U6qEkA==
9636-
dependencies:
9637-
hoist-non-react-statics "^2.3.1"
9638-
9639-
react-native-safe-area-view@^0.14.4:
9640-
version "0.14.4"
9641-
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.14.4.tgz#1647fa74fd452cb8cee4f47bd08de3829451bf5d"
9642-
integrity sha512-ypDQVoAyNHBhMR1IGfadm8kskNzPg5czrDAzQEu5MXG9Ahoi5f1cL/rT2KO+R9f6xRjf6b1IjY53m0B0xHRd0A==
9643-
dependencies:
9644-
hoist-non-react-statics "^2.3.1"
9645-
9646-
react-native-safe-area-view@^0.14.9:
9632+
[email protected], [email protected], react-native-safe-area-view@^0.14.9:
96479633
version "0.14.9"
96489634
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.14.9.tgz#90ee8383037010d9a5055a97cf97e4c1da1f0c3d"
96499635
integrity sha512-WII/ulhpVyL/qbYb7vydq7dJAfZRBcEhg4/UWt6F6nAKpLa3gAceMOxBxI914ppwSP/TdUsandFy6lkJQE0z4A==

0 commit comments

Comments
 (0)