Skip to content

Commit

Permalink
Merge pull request #1037 from msalcala11/fix-ios-carousel
Browse files Browse the repository at this point in the history
Ensure iOS build works well with new react-navigation
  • Loading branch information
JohnathanWhite authored Jan 31, 2024
2 parents 672601e + 849492e commit 8e7a953
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {useFocusEffect} from '@react-navigation/native';
import React from 'react';
import {Linking} from 'react-native';
import {TouchableOpacity} from 'react-native-gesture-handler';
import Braze, {ContentCard} from 'react-native-appboy-sdk';
import FastImage, {Source} from 'react-native-fast-image';
import styled, {useTheme} from 'styled-components/native';
Expand Down Expand Up @@ -34,7 +35,7 @@ interface QuickLinksCardProps {
ctaOverride?: () => void;
}

const QuickLinkCardContainer = styled.TouchableOpacity`
const QuickLinkCardContainer = styled(TouchableOpacity)`
justify-content: flex-start;
align-items: center;
flex-direction: row;
Expand Down
8 changes: 7 additions & 1 deletion src/navigation/tabs/shop/components/ShopCarouselList.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React from 'react';
import styled, {css} from 'styled-components/native';
import {TouchableHighlight} from 'react-native-gesture-handler';
import Carousel from 'react-native-reanimated-carousel';
import {
CardConfig,
DirectIntegrationApiObject,
} from '../../../../store/shop/shop.models';
import {ActiveOpacity} from '../../../../components/styled/Containers';

interface SlideContainerParams {
inLastSlide: boolean;
isSingleSlide: boolean;
Expand All @@ -24,7 +27,9 @@ interface TouchableHighlightParams {
width: number;
}

const ItemTouchableHighlight = styled.TouchableHighlight<TouchableHighlightParams>`
const ItemTouchableHighlight = styled(
TouchableHighlight,
)<TouchableHighlightParams>`
${({width}) =>
css`
width: ${width}px;
Expand Down Expand Up @@ -103,6 +108,7 @@ export default ({
? carouselItemWidthInLastSlide
: carouselItemWidth
}
activeOpacity={ActiveOpacity}
key={listItem.displayName}
onPress={() => {
console.log('press', listItem.displayName);
Expand Down
13 changes: 3 additions & 10 deletions src/navigation/wallet/screens/send/confirm/BillConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import {sleep, formatFiatAmount} from '../../../../../utils/helper-methods';
import {startOnGoingProcessModal} from '../../../../../store/app/app.effects';
import {dismissOnGoingProcessModal} from '../../../../../store/app/app.actions';
import {ShopActions, ShopEffects} from '../../../../../store/shop';
import {ShopEffects} from '../../../../../store/shop';
import {BuildPayProWalletSelectorList} from '../../../../../store/wallet/utils/wallet';
import {
Amount,
Expand Down Expand Up @@ -130,13 +130,6 @@ const BillConfirm: React.VFC<
[dispatch, invoice, keys],
);

useEffect(() => {
return () => {
dispatch(ShopActions.deletedUnsoldGiftCards());
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

useLayoutEffect(() => {
navigation.setOptions({
gestureEnabled: false,
Expand Down Expand Up @@ -538,11 +531,11 @@ const BillConfirm: React.VFC<
<PaymentSent
isVisible={showPaymentSentModal}
onCloseModal={async () => {
setShowPaymentSentModal(false);
await sleep(500);
navigation.dispatch(StackActions.popToTop());
navigation.dispatch(StackActions.pop());
navigator.navigate(BillScreens.PAYMENTS, {});
await sleep(0);
setShowPaymentSentModal(false);
}}
/>
</ConfirmContainer>
Expand Down
5 changes: 3 additions & 2 deletions src/navigation/wallet/screens/send/confirm/PayProConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ const PayProConfirm = () => {
<PaymentSent
isVisible={showPaymentSentModal}
onCloseModal={async () => {
setShowPaymentSentModal(false);
await sleep(500);
navigation.dispatch(StackActions.popToTop());
if (coinbaseAccount) {
navigation.dispatch(StackActions.pop(3));
Expand All @@ -473,8 +475,7 @@ const PayProConfirm = () => {
walletId: wallet!.id,
key,
});
await sleep(0);
setShowPaymentSentModal(false);

}}
/>
</ConfirmScrollView>
Expand Down

0 comments on commit 8e7a953

Please sign in to comment.