Skip to content

Commit 6976844

Browse files
committed
update navigation libriries
1 parent fc2e229 commit 6976844

File tree

92 files changed

+2024
-1532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2024
-1532
lines changed

.prettierrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ module.exports = {
33
jsxBracketSameLine: true,
44
singleQuote: true,
55
trailingComma: 'all',
6+
arrowParens: 'avoid',
67
};

ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ target 'magento_mobile_app' do
99
use_react_native!(
1010
:path => config[:reactNativePath],
1111
# to enable hermes on iOS, change `false` to `true` and then install pods
12-
:hermes_enabled => false
12+
:hermes_enabled => true
1313
)
1414

1515
# Enables Flipper.

ios/Podfile.lock

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ PODS:
6262
- FlipperKit/Core
6363
- FlipperKit/FlipperKitNetworkPlugin
6464
- glog (0.3.5)
65+
- hermes-engine (0.7.2)
6566
- libevent (2.1.12)
6667
- libwebp (1.2.0):
6768
- libwebp/demux (= 1.2.0)
@@ -82,6 +83,11 @@ PODS:
8283
- boost-for-react-native
8384
- DoubleConversion
8485
- glog
86+
- RCT-Folly/Futures (2020.01.13.00):
87+
- boost-for-react-native
88+
- DoubleConversion
89+
- glog
90+
- libevent
8591
- RCTRequired (0.64.2)
8692
- RCTTypeSafety (0.64.2):
8793
- FBLazyVector (= 0.64.2)
@@ -139,6 +145,16 @@ PODS:
139145
- React-jsinspector (= 0.64.2)
140146
- React-perflogger (= 0.64.2)
141147
- Yoga
148+
- React-Core/Hermes (0.64.2):
149+
- glog
150+
- hermes-engine
151+
- RCT-Folly (= 2020.01.13.00)
152+
- RCT-Folly/Futures
153+
- React-cxxreact (= 0.64.2)
154+
- React-jsi (= 0.64.2)
155+
- React-jsiexecutor (= 0.64.2)
156+
- React-perflogger (= 0.64.2)
157+
- Yoga
142158
- React-Core/RCTActionSheetHeaders (0.64.2):
143159
- glog
144160
- RCT-Folly (= 2020.01.13.00)
@@ -266,6 +282,8 @@ PODS:
266282
- React-jsi (= 0.64.2)
267283
- React-perflogger (= 0.64.2)
268284
- React-jsinspector (0.64.2)
285+
- react-native-safe-area-context (3.2.0):
286+
- React-Core
269287
- react-native-webview (11.0.0):
270288
- React-Core
271289
- React-perflogger (0.64.2)
@@ -383,19 +401,23 @@ DEPENDENCIES:
383401
- FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.75.1)
384402
- FlipperKit/SKIOSNetworkPlugin (~> 0.75.1)
385403
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
404+
- hermes-engine (~> 0.7.2)
405+
- libevent (~> 2.1.12)
386406
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
387407
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
388408
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
389409
- React (from `../node_modules/react-native/`)
390410
- React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
391411
- React-Core (from `../node_modules/react-native/`)
392412
- React-Core/DevSupport (from `../node_modules/react-native/`)
413+
- React-Core/Hermes (from `../node_modules/react-native/`)
393414
- React-Core/RCTWebSocket (from `../node_modules/react-native/`)
394415
- React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
395416
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
396417
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
397418
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
398419
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
420+
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
399421
- react-native-webview (from `../node_modules/react-native-webview`)
400422
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
401423
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
@@ -429,6 +451,7 @@ SPEC REPOS:
429451
- Flipper-PeerTalk
430452
- Flipper-RSocket
431453
- FlipperKit
454+
- hermes-engine
432455
- libevent
433456
- libwebp
434457
- OpenSSL-Universal
@@ -469,6 +492,8 @@ EXTERNAL SOURCES:
469492
:path: "../node_modules/react-native/ReactCommon/jsiexecutor"
470493
React-jsinspector:
471494
:path: "../node_modules/react-native/ReactCommon/jsinspector"
495+
react-native-safe-area-context:
496+
:path: "../node_modules/react-native-safe-area-context"
472497
react-native-webview:
473498
:path: "../node_modules/react-native-webview"
474499
React-perflogger:
@@ -527,6 +552,7 @@ SPEC CHECKSUMS:
527552
Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154
528553
FlipperKit: 8a20b5c5fcf9436cac58551dc049867247f64b00
529554
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
555+
hermes-engine: 7d97ba46a1e29bacf3e3c61ecb2804a5ddd02d4f
530556
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
531557
libwebp: e90b9c01d99205d03b6bb8f2c8c415e5a4ef66f0
532558
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
@@ -541,6 +567,7 @@ SPEC CHECKSUMS:
541567
React-jsi: 67747b9722f6dab2ffe15b011bcf6b3f2c3f1427
542568
React-jsiexecutor: 80c46bd381fd06e418e0d4f53672dc1d1945c4c3
543569
React-jsinspector: cc614ec18a9ca96fd275100c16d74d62ee11f0ae
570+
react-native-safe-area-context: f0906bf8bc9835ac9a9d3f97e8bde2a997d8da79
544571
react-native-webview: 6b7950628616679d81bdd75747e50cf6de9b5a5f
545572
React-perflogger: 25373e382fed75ce768a443822f07098a15ab737
546573
React-RCTActionSheet: af7796ba49ffe4ca92e7277a5d992d37203f7da5
@@ -566,6 +593,6 @@ SPEC CHECKSUMS:
566593
Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac
567594
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
568595

569-
PODFILE CHECKSUM: 165bd189de915a836bc5baffb3a8c76f7ba50da0
596+
PODFILE CHECKSUM: 820ce3ecc087b824d7ebe806ca031faf14bcbdc1
570597

571598
COCOAPODS: 1.10.1

ios/magento_mobile_app.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,12 @@
374374
);
375375
inputPaths = (
376376
"${PODS_ROOT}/Target Support Files/Pods-magento_mobile_app/Pods-magento_mobile_app-frameworks.sh",
377+
"${PODS_ROOT}/hermes-engine/destroot/Library/Frameworks/iphoneos/hermes.framework",
377378
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL",
378379
);
379380
name = "[CP] Embed Pods Frameworks";
380381
outputPaths = (
382+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
381383
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
382384
);
383385
runOnlyForDeploymentPostprocessing = 0;
@@ -484,7 +486,7 @@
484486
COPY_PHASE_STRIP = NO;
485487
ENABLE_BITCODE = YES;
486488
ENABLE_STRICT_OBJC_MSGSEND = YES;
487-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
489+
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386";
488490
GCC_C_LANGUAGE_STANDARD = gnu99;
489491
GCC_DYNAMIC_NO_PIC = NO;
490492
GCC_OPTIMIZATION_LEVEL = 0;
@@ -529,7 +531,7 @@
529531
ENABLE_BITCODE = YES;
530532
ENABLE_NS_ASSERTIONS = NO;
531533
ENABLE_STRICT_OBJC_MSGSEND = YES;
532-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
534+
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386";
533535
GCC_C_LANGUAGE_STANDARD = gnu99;
534536
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
535537
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,17 @@
2727
"react-native-modal-selector": "^2.0.2",
2828
"react-native-reanimated": "^1.7.0",
2929
"react-native-render-html": "^4.2.3",
30+
"react-native-safe-area-context": "^3.2.0",
3031
"react-native-screens": "^2.0.0-alpha.28",
3132
"react-native-simple-radio-button": "^2.7.4",
3233
"react-native-swiper": "^1.6.0-rc.3",
3334
"react-native-vector-icons": "6.6.0",
3435
"react-native-webview": "^11.0.0",
35-
"react-navigation": "^4.0.10",
36-
"react-navigation-drawer": "^2.2.2",
37-
"react-navigation-header-buttons": "^3.0.3",
38-
"react-navigation-stack": "^1.9.4",
39-
"react-navigation-tabs": "^2.5.6",
36+
"react-navigation": "^4.4.4",
37+
"react-navigation-drawer": "^2.7.1",
38+
"react-navigation-header-buttons": "^3.0.5",
39+
"react-navigation-stack": "^2.10.4",
40+
"react-navigation-tabs": "^2.11.1",
4041
"react-redux": "^7.1.1",
4142
"redux": "^4.0.4",
4243
"redux-persist": "^6.0.0",

patches/react-native+0.62.2.patch

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

src/App.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,25 @@ import NavigationService from './navigation/NavigationService';
88
import { onAppStart } from './helper/app';
99

1010
import { Spinner } from './components/common';
11+
import { SafeAreaProvider } from 'react-native-safe-area-context';
12+
import { SafeAreaView } from 'react-navigation';
1113

1214
onAppStart(store);
1315

1416
const App = () => (
1517
<Provider store={store}>
1618
<ThemeProvider theme={theme}>
17-
<PersistGate loading={<Spinner />} persistor={persistor}>
18-
<Navigator
19-
ref={(navigatorRef) => {
20-
NavigationService.setTopLevelNavigator(navigatorRef);
21-
}}
22-
/>
23-
</PersistGate>
19+
<SafeAreaProvider>
20+
<SafeAreaView style={{ flex: 1 }} forceInset={{ bottom: 'never' }}>
21+
<PersistGate loading={<Spinner />} persistor={persistor}>
22+
<Navigator
23+
ref={navigatorRef => {
24+
NavigationService.setTopLevelNavigator(navigatorRef);
25+
}}
26+
/>
27+
</PersistGate>
28+
</SafeAreaView>
29+
</SafeAreaProvider>
2430
</ThemeProvider>
2531
</Provider>
2632
);

src/actions/CartActions.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { magento } from '../magento';
33
import { logError } from '../helper/logger';
44
import { createCustomerCart } from './RestActions';
55

6-
7-
export const addCouponToCart = (couponCode) => async (dispatch, getState) => {
6+
export const addCouponToCart = couponCode => async (dispatch, getState) => {
87
dispatch({ type: types.MAGENTO_COUPON_LOADING, payload: true });
98
try {
109
const cartId = getState().cart?.cartId || getState().cart?.quote?.id;
@@ -44,7 +43,10 @@ export const removeCouponFromCart = () => async (dispatch, getState) => {
4443
};
4544

4645
export const refreshCart = () => async (dispatch, getState) => {
47-
dispatch({ type: types.MAGENTO_UPDATE_REFRESHING_CART_ITEM_PRODUCT, payload: true });
46+
dispatch({
47+
type: types.MAGENTO_UPDATE_REFRESHING_CART_ITEM_PRODUCT,
48+
payload: true,
49+
});
4850

4951
try {
5052
let cart;
@@ -55,10 +57,16 @@ export const refreshCart = () => async (dispatch, getState) => {
5557
cart = await magento.guest.getGuestCart(cartId);
5658
}
5759
dispatch({ type: types.MAGENTO_GET_CART, payload: cart });
58-
dispatch({ type: types.MAGENTO_UPDATE_REFRESHING_CART_ITEM_PRODUCT, payload: false });
60+
dispatch({
61+
type: types.MAGENTO_UPDATE_REFRESHING_CART_ITEM_PRODUCT,
62+
payload: false,
63+
});
5964
} catch (error) {
6065
logError(error);
61-
if (error.message && error.message.includes('No such entity with customerId')) {
66+
if (
67+
error.message &&
68+
error.message.includes('No such entity with customerId')
69+
) {
6270
const { customer } = getState().account;
6371
if (customer && customer.id) {
6472
dispatch(createCustomerCart(customer.id));

src/actions/CustomerAuthActions.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
} from '../navigation/routes';
2323
import { logError } from '../helper/logger';
2424

25-
export const signIn = customer => async (dispatch) => {
25+
export const signIn = customer => async dispatch => {
2626
try {
2727
dispatch({ type: MAGENTO_CREATE_CUSTOMER_LOADING, payload: true });
2828
const response = await magento.guest.createCustomer(customer);
@@ -48,7 +48,7 @@ export const signIn = customer => async (dispatch) => {
4848
}
4949
};
5050

51-
export const auth = (username, password) => async (dispatch) => {
51+
export const auth = (username, password) => async dispatch => {
5252
try {
5353
dispatch({ type: MAGENTO_AUTH_LOADING, payload: true });
5454
const response = await magento.guest.auth(username, password);
@@ -85,9 +85,12 @@ const authFail = (dispatch, message) => {
8585
dispatch({ type: MAGENTO_AUTH_LOADING, payload: false });
8686
};
8787

88-
export const errorMessage = error => ({ type: MAGENTO_AUTH_ERROR, payload: error });
88+
export const errorMessage = error => ({
89+
type: MAGENTO_AUTH_ERROR,
90+
payload: error,
91+
});
8992

90-
export const logout = () => (dispatch) => {
93+
export const logout = () => dispatch => {
9194
dispatch({ type: MAGENTO_AUTH, payload: '' });
9295
dispatch({ type: MAGENTO_LOGOUT });
9396
dispatch(getCart());
@@ -96,7 +99,7 @@ export const logout = () => (dispatch) => {
9699
magento.setCustomerToken(false);
97100
};
98101

99-
export const initiatePasswordReset = email => async (dispatch) => {
102+
export const initiatePasswordReset = email => async dispatch => {
100103
try {
101104
dispatch({ type: MAGENTO_PASSWORD_RESET_LOADING, payload: true });
102105
await magento.guest.initiatePasswordReset(email);
@@ -105,19 +108,22 @@ export const initiatePasswordReset = email => async (dispatch) => {
105108
dispatch({ type: MAGENTO_PASSWORD_RESET_SUCCESS, payload: message });
106109
} catch (e) {
107110
logError(e);
108-
dispatch({ type: MAGENTO_PASSWORD_RESET_ERROR, payload: { errorMessage: e.message } });
111+
dispatch({
112+
type: MAGENTO_PASSWORD_RESET_ERROR,
113+
payload: { errorMessage: e.message },
114+
});
109115
}
110116
};
111117

112118
/**
113119
* This action will reset all the state varaibales related to
114120
* password_reset in the CustomerAuthReducer.
115121
*/
116-
export const updatePasswordResetUI = () => async (dispatch) => {
122+
export const updatePasswordResetUI = () => async dispatch => {
117123
dispatch({ type: MAGENTO_PASSWORD_RESET_LOADING, payload: false });
118124
};
119125

120-
export const currentCustomer = () => async (dispatch) => {
126+
export const currentCustomer = () => async dispatch => {
121127
try {
122128
const customer = await magento.customer.getCurrentCustomer();
123129
dispatch({

src/actions/ProductActions.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
/**
1111
* Get product from a category
1212
*/
13-
export const getRelatedProduct = (categoryIds, sku) => async (dispatch) => {
13+
export const getRelatedProduct = (categoryIds, sku) => async dispatch => {
1414
try {
1515
dispatch({ type: MAGENTO_RELATED_PRODUCTS_LOADING, payload: true });
1616
const result = await magento.admin.getProductsWithAttribute(
@@ -29,9 +29,15 @@ export const getRelatedProduct = (categoryIds, sku) => async (dispatch) => {
2929
MAGENTO_RELATED_PRODUCTS_CONF_PRODUCT,
3030
);
3131
if (result && result.items) {
32-
dispatch({ type: MAGENTO_RELATED_PRODUCTS_SUCCESS, payload: result.items });
32+
dispatch({
33+
type: MAGENTO_RELATED_PRODUCTS_SUCCESS,
34+
payload: result.items,
35+
});
3336
}
3437
} catch (error) {
35-
dispatch({ type: MAGENTO_RELATED_PRODUCTS_ERROR, payload: { errorMessage: error.message } });
38+
dispatch({
39+
type: MAGENTO_RELATED_PRODUCTS_ERROR,
40+
payload: { errorMessage: error.message },
41+
});
3642
}
3743
};

0 commit comments

Comments
 (0)