diff --git a/examples/client/Locomotion/ios/Podfile.lock b/examples/client/Locomotion/ios/Podfile.lock index f70b61ea0..abe752b0e 100644 --- a/examples/client/Locomotion/ios/Podfile.lock +++ b/examples/client/Locomotion/ios/Podfile.lock @@ -447,7 +447,7 @@ PODS: - Firebase/Crashlytics (= 8.15.0) - React-Core - RNFBApp - - RNGestureHandler (2.4.2): + - RNGestureHandler (2.12.1): - React-Core - RNLocalize (2.2.4): - React-Core @@ -816,9 +816,9 @@ SPEC CHECKSUMS: RNFastImage: 3207b9eb17c2425d574ca40db35185db6e324f4e RNFBApp: e4439717c23252458da2b41b81b4b475c86f90c4 RNFBCrashlytics: 94e1f78e2a9aa9e02edbfb0d3f1f0921ce00094b - RNGestureHandler: 61628a2c859172551aa2100d3e73d1e57878392f + RNGestureHandler: c0d04458598fcb26052494ae23dda8f8f5162b13 RNLocalize: ea02d6ee626a9239c9efe0b2b3f8a4660dff6df6 - RNReanimated: 51bba3f4b6dc13fbfe83d620fe20e82fcf6e9697 + RNReanimated: 1f117be601c59177816351a965bc57320b766c15 RNScreens: 34cc502acf1b916c582c60003dc3089fa01dc66d RNSVG: ecd661f380a07ba690c9c5929c475a44f432d674 SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d @@ -831,6 +831,6 @@ SPEC CHECKSUMS: StripeUICore: 08c1efbd7e3c54ee7fa74334a37a1d4c08ba944d Yoga: c4d61225a466f250c35c1ee78d2d0b3d41fe661c -PODFILE CHECKSUM: 702820324fe56b3916c3fc841fd20ce5daddfaf7 +PODFILE CHECKSUM: 42909390370d7a65830c84fab99e66e070f1b4f9 COCOAPODS: 1.12.1 diff --git a/examples/client/Locomotion/src/Components/BottomSheet/index.tsx b/examples/client/Locomotion/src/Components/BottomSheet/index.tsx index c84492103..529e0649c 100644 --- a/examples/client/Locomotion/src/Components/BottomSheet/index.tsx +++ b/examples/client/Locomotion/src/Components/BottomSheet/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */ // @ts-nocheck import React, { - useCallback, useContext, forwardRef, useEffect, + useCallback, useContext, forwardRef, } from 'react'; import BottomSheet, { BottomSheetFooter, @@ -9,13 +9,13 @@ import BottomSheet, { } from '@gorhom/bottom-sheet'; import styled from 'styled-components'; import { Text, View } from 'react-native'; -import { UserContext } from '../../context/user'; +import { Trans } from 'react-i18next'; // eslint-disable-next-line import/no-unresolved import SafeView from '../SafeView'; import { BottomSheetContext } from '../../context/bottomSheetContext'; -const BottomSheetTopInfo = styled(View)` -background-color: #989898; +const BottomSheetTopInfo = styled(View)<{backgroundColor: string}>` +background-color: ${props => props.backgroundColor || '#989898'}; /* position: absolute; height: 38px; top: -38px; */ @@ -49,7 +49,7 @@ const BottomSheetComponent = forwardRef(({ setIsExpanded, snapPoints, footerComponent, - topBarText, + topBarProps, } = useContext(BottomSheetContext); const onAnimate = useCallback((from: any, to: any) => { if (!closeable && from !== -1) { @@ -77,10 +77,10 @@ const BottomSheetComponent = forwardRef(({ const getTopBar = () => ( <> - {!!topBarText && ( - + {!!topBarProps.text && ( + - {topBarText} + )} diff --git a/examples/client/Locomotion/src/Components/BsPages/index.tsx b/examples/client/Locomotion/src/Components/BsPages/index.tsx index 5d5926d14..37717341c 100644 --- a/examples/client/Locomotion/src/Components/BsPages/index.tsx +++ b/examples/client/Locomotion/src/Components/BsPages/index.tsx @@ -284,6 +284,8 @@ export const ConfirmPickupTime = (props: any) => { chosenService, defaultService, setChosenService, + loadFutureBookingDays, + futureBookingDays, } = useContext(MewRidePageContext); const { changeBsPage, @@ -300,9 +302,12 @@ export const ConfirmPickupTime = (props: any) => { const minutes = await getSettingByKey(SETTINGS_KEYS.MIN_MINUTES_BEFORE_FUTURE_RIDE); setMinMinutesBeforeFutureRide(minutes); }; + useEffect(() => { checkMinutesBeforeFutureRideSetting(); + loadFutureBookingDays(); }, []); + useEffect(() => { setTempSelectedDate(startDate); }, [minMinutesBeforeFutureRide]); @@ -361,7 +366,7 @@ export const ConfirmPickupTime = (props: any) => { textColor="black" isVisible={isDatePickerOpen} date={tempSelectedDate} - maximumDate={getFutureRideMaxDate()} + maximumDate={getFutureRideMaxDate(futureBookingDays)} minimumDate={getFutureRideMinDate((minMinutesBeforeFutureRide || 0))} mode="datetime" title={renderDatePickerTitle()} diff --git a/examples/client/Locomotion/src/Components/CardRow/index.tsx b/examples/client/Locomotion/src/Components/CardRow/index.tsx index caf4e0b76..65aaab089 100644 --- a/examples/client/Locomotion/src/Components/CardRow/index.tsx +++ b/examples/client/Locomotion/src/Components/CardRow/index.tsx @@ -5,17 +5,16 @@ import { View, Text } from 'react-native'; import moment from 'moment'; import styled, { ThemeContext } from 'styled-components'; import { PaymentIcon } from 'react-native-payment-icons'; -import { PaymentMethodInterface } from 'context/payments/interface'; +import { PAYMENT_METHODS, paymentMethodToIconMap } from '../../pages/Payments/consts'; import Button from '../Button'; import { capitalizeFirstLetter, getLastFourForamttedShort } from '../../pages/Payments/cardDetailUtils'; import i18n from '../../I18n'; import SvgIcon from '../SvgIcon'; import selected from '../../assets/selected-v.svg'; import { Start, StartCapital } from '../../lib/text-direction'; -import cashIcon from '../../assets/cash.svg'; import chevronIcon from '../../assets/chevron.svg'; import { isCashPaymentMethod } from '../../lib/ride/utils'; - +import paymentContext from '../../context/payments'; type ContainerProps = { children: React.ReactNode, @@ -91,9 +90,15 @@ const style = { [StartCapital()]: 28, }; + const CardRow = (paymentMethod: any) => { const { primaryColor } = useContext(ThemeContext); + const { offlinePaymentText, loadOfflinePaymentText } = paymentContext.useContainer(); const [isCardExpired, setIsCardExpired] = useState(false); + + useEffect(() => { + loadOfflinePaymentText(); + }, []); useEffect(() => { let isExpired = false; setTimeout(() => { @@ -101,7 +106,26 @@ const CardRow = (paymentMethod: any) => { setIsCardExpired(isExpired); }, 100); }, [paymentMethod]); - const testID = paymentMethod.addNew ? `${paymentMethod.testIdPrefix || ''}AddPaymentMethod` : (`${paymentMethod.testIdPrefix || ''}ChoosePaymentMethod`); + const testID = paymentMethod.addNew + ? `${paymentMethod.testIdPrefix || ''}AddPaymentMethod` + : (`${paymentMethod.testIdPrefix || ''}ChoosePaymentMethod${paymentMethod.id === PAYMENT_METHODS.OFFLINE || paymentMethod.id === PAYMENT_METHODS.CASH ? `_${paymentMethod.id}` : ''}`); + + const getPaymentMethodIcon = () => { + const { brand, id, lastFour } = paymentMethod; + const isCard = lastFour; + if (isCard) { + return ; + } + return ( + + ); + }; + return ( <>