Skip to content

Commit

Permalink
Merge branch 'version_3.3.17' into AUT-19663-services-text-long
Browse files Browse the repository at this point in the history
  • Loading branch information
ariel-weiss authored Apr 15, 2024
2 parents 4b96cd5 + e8cdb9f commit b2d4963
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 81 deletions.
16 changes: 14 additions & 2 deletions examples/client/Locomotion/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
PODS:
- AppsFlyerFramework (6.13.1):
- AppsFlyerFramework/Main (= 6.13.1)
- AppsFlyerFramework/Main (6.13.1)
- boost (1.76.0)
- BVLinearGradient (2.6.2):
- React-Core
Expand Down Expand Up @@ -318,6 +321,9 @@ PODS:
- React-jsinspector (0.68.5)
- React-logger (0.68.5):
- glog
- react-native-appsflyer (6.13.1):
- AppsFlyerFramework (= 6.13.1)
- React
- react-native-background-timer (2.4.1):
- React-Core
- react-native-carrier-info (1.1.2):
Expand Down Expand Up @@ -537,6 +543,7 @@ DEPENDENCIES:
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-appsflyer (from `../node_modules/react-native-appsflyer`)
- react-native-background-timer (from `../node_modules/react-native-background-timer`)
- react-native-carrier-info (from `../node_modules/react-native-carrier-info`)
- react-native-config (from `../node_modules/react-native-config`)
Expand Down Expand Up @@ -584,6 +591,7 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- AppsFlyerFramework
- Firebase
- FirebaseCore
- FirebaseCoreDiagnostics
Expand Down Expand Up @@ -652,6 +660,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-appsflyer:
:path: "../node_modules/react-native-appsflyer"
react-native-background-timer:
:path: "../node_modules/react-native-background-timer"
react-native-carrier-info:
Expand Down Expand Up @@ -742,6 +752,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
AppsFlyerFramework: 971521cf5b890c2afeab2f2c91734547b8b169ca
boost: a7c83b31436843459a1961bfd74b96033dc77234
BVLinearGradient: 34a999fda29036898a09c6a6b728b0b4189e1a44
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
Expand Down Expand Up @@ -779,6 +790,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: 45c0496ca8cef6b02d9fa0274c25cf458fe91a56
React-jsinspector: eb202e43b3879aba9a14f3f65788aec85d4e1ea9
React-logger: 98f663b292a60967ebbc6d803ae96c1381183b6d
react-native-appsflyer: 7cf84f144123de4dd2c772d0be8e16ea6a66f681
react-native-background-timer: 117fffdc9b0d6f144444bb49029f94275a45fdb5
react-native-carrier-info: 1e6299256bd7ceaa36f851b30e071b2b4fc406ad
react-native-config: bcafda5b4c51491ee1b0e1d0c4e3905bc7b56c1b
Expand Down Expand Up @@ -831,6 +843,6 @@ SPEC CHECKSUMS:
StripeUICore: 08c1efbd7e3c54ee7fa74334a37a1d4c08ba944d
Yoga: c4d61225a466f250c35c1ee78d2d0b3d41fe661c

PODFILE CHECKSUM: 42909390370d7a65830c84fab99e66e070f1b4f9
PODFILE CHECKSUM: 3d1a03e0b2517741427327a9545b9919923582eb

COCOAPODS: 1.12.1
COCOAPODS: 1.12.0
17 changes: 11 additions & 6 deletions examples/client/Locomotion/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/client/Locomotion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"react": "17.0.2",
"react-i18next": "^11.7.2",
"react-native": "^0.68.5",
"react-native-appsflyer": "^6.13.1",
"react-native-background-timer": "^2.4.1",
"react-native-carrier-info": "^1.1.2",
"react-native-config": "^1.4.5",
Expand Down

This file was deleted.

This file was deleted.

19 changes: 5 additions & 14 deletions examples/client/Locomotion/src/Components/CardRow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { View, Text } from 'react-native';
import moment from 'moment';
import styled, { ThemeContext } from 'styled-components';
import { PaymentIcon } from 'react-native-payment-icons';
import BusinessAccountText from '../BusinessAccountText';
import { RideInterface, RidePageContext } from '../../context/newRideContext';
import { PAYMENT_METHODS, paymentMethodToIconMap } from '../../pages/Payments/consts';
import Button from '../Button';
Expand Down Expand Up @@ -204,19 +203,11 @@ const CardRow = (paymentMethod: any) => {
)
: (
<>
{
(businessAccountId && offlinePaymentText)
? (
<BusinessAccountText
title={getPaymentMethodTitle()}
subTitle={offlinePaymentText}
/>
)
: (
<Type>
{getPaymentMethodTitle()}
</Type>
)}

<Type>
{getPaymentMethodTitle()}
</Type>

{paymentMethod.lastFour
? <Description>{getLastFourForamttedShort(paymentMethod.lastFour)}</Description>
: null}
Expand Down
6 changes: 3 additions & 3 deletions examples/client/Locomotion/src/Components/RideCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const RideCard = ({
const {
getRidePriceCalculation,
} = useContext(RidePageContext);
const { businessAccountId } = useContext(RidePageContext);

const { getBusinessAccountById } = PaymentContext.useContainer();
const { showPrice, loadShowPrice } = SettingContext.useContainer();

Expand All @@ -109,8 +109,8 @@ const RideCard = ({
}, [ride]);

useEffect(() => {
showPriceBasedOnAccount(loadShowPrice, getBusinessAccountById, businessAccountId);
}, [businessAccountId]);
showPriceBasedOnAccount(loadShowPrice, getBusinessAccountById, ride.businessAccountId);
}, [ride.businessAccountId]);

const formatScheludedTo = async (time: any) => {
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useContext } from 'react';
import { Text, View } from 'react-native';
import styled, { ThemeContext } from 'styled-components';
import BusinessAccountText from '../BusinessAccountText';
import { FONT_SIZES } from '../../context/theme';
import SvgIcon from '../SvgIcon';

Expand Down Expand Up @@ -57,13 +56,7 @@ const TextRowWithIcon = ({
...((Image || icon) && { marginLeft: 10 }),
}}
>
{subTitle ? (
<BusinessAccountText
title={text}
subTitle={subTitle}
/>
)
: text}
{text}
</BasicText>
</Container>
);
Expand Down
2 changes: 2 additions & 0 deletions examples/client/Locomotion/src/LocomotionRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import MessagesProvider from './context/messages';
import CancellationReasonsProvider from './context/cancellation-reasons';
import VirtualStationsProvider from './context/virtualStationsContext';
import Mixpanel from './services/Mixpanel';
import initAppsFlyer from './services/appsflyer';

LogBox.ignoreAllLogs();

Expand Down Expand Up @@ -49,6 +50,7 @@ export default (props) => {
useEffect(() => {
sendAppLaunchEvent();
crashlytics().log('App mounted.');
initAppsFlyer();
enableScreens(false);
const listener = registerAppStateListener();
return () => {
Expand Down
4 changes: 3 additions & 1 deletion examples/client/Locomotion/src/context/payments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ const usePayments = () => {
if (relevantBusinessAccount) {
return relevantBusinessAccount;
}
return null;
// this means the client no longer have access to the business account, or BA was deleted
// requires a fallback object to avoid breaking the app
return {};
};

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { PaymentIcon } from 'react-native-payment-icons';
import styled, { ThemeContext } from 'styled-components';
import { useFocusEffect } from '@react-navigation/native';
import SkeletonContent from 'react-native-skeleton-content-nonexpo';
import BusinessAccountText from '../../../../../../Components/BusinessAccountText';
import { isCardPaymentMethod, isCashPaymentMethod, isOfflinePaymentMethod } from '../../../../../../lib/ride/utils';
import { getCouponText } from '../../../../../../context/newRideContext/utils';
import { MAIN_ROUTES } from '../../../../../routes';
Expand Down Expand Up @@ -77,7 +76,6 @@ interface PaymentButtonProps {
brand?: Brand;
id?: string;
invalid?: boolean;
subTitle?: string;
}


Expand All @@ -87,7 +85,6 @@ const PaymentButton = ({
brand,
id,
invalid,
subTitle,
}: PaymentButtonProps) => {
const { primaryColor } = useContext(ThemeContext);
const { getCoupon, coupon, setCoupon } = useContext(UserContext);
Expand Down Expand Up @@ -168,9 +165,7 @@ const PaymentButton = ({
width={40}
/>
)}
{ subTitle
? <BusinessAccountText title={title} subTitle={subTitle} />
: <TimeText numberOfLines={1}>{title}</TimeText> }
<TimeText numberOfLines={1}>{title}</TimeText>
</CardNameContainer>
<PromoButtonContainer>
{loadPromoButton()}
Expand All @@ -185,5 +180,4 @@ PaymentButton.defaultProps = {
brand: null,
id: null,
invalid: false,
subTitle: null,
};
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ const RideButtons = ({
brand={selectedPaymentMethod?.brand}
icon={paymentMethodToIconMap[selectedPaymentMethod?.id]}
title={getSelectedPaymentMethodTitle()}
subTitle={businessAccountId && offlinePaymentText}
id={selectedPaymentMethod?.id}
invalid={paymentMethodNotAllowedOnService}
/>
Expand Down
36 changes: 36 additions & 0 deletions examples/client/Locomotion/src/services/appsflyer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Platform } from 'react-native';
import appsFlyer from 'react-native-appsflyer';
import Config from 'react-native-config';

const LOG_PREFIX = 'APPSFLYER INTEG';
const { ANDROID_APPSFLYER_DEV_KEY, IOS_APPSFLYER_DEV_KEY, IOS_APP_ID } = Config;
const PLATFORM_CONFIG: any = {
android: {
devKey: ANDROID_APPSFLYER_DEV_KEY,
},
ios: {
devKey: IOS_APPSFLYER_DEV_KEY,
appId: IOS_APP_ID,
timeToWaitForATTUserAuthorization: 10, // for iOS 14.5
},
};

export default () => {
const config = PLATFORM_CONFIG[Platform.OS];
if (config?.devKey) {
appsFlyer.initSdk(
{
...config,
isDebug: false,
onInstallConversionDataListener: true, // Optional
onDeepLinkListener: true, // Optional
},
(result) => {
console.log(`${LOG_PREFIX} SUCCESS`, result);
},
(error) => {
console.error(`${LOG_PREFIX} ERROR`, error);
},
);
}
};

0 comments on commit b2d4963

Please sign in to comment.