From f76c8f856e12f88ee7f48444908d04c0acbb2098 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Mon, 22 Jul 2024 22:06:35 -0400 Subject: [PATCH] DEL: Remove redundant prop --- components/WalletsCarousel.tsx | 57 ++++++++++--------- .../xcshareddata/swiftpm/Package.resolved | 42 -------------- ios/Podfile.lock | 2 +- screen/wallets/DrawerList.tsx | 1 - screen/wallets/WalletsList.tsx | 1 - 5 files changed, 31 insertions(+), 72 deletions(-) delete mode 100644 ios/BlueWallet.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/components/WalletsCarousel.tsx b/components/WalletsCarousel.tsx index 7afd61456..68fe1e022 100644 --- a/components/WalletsCarousel.tsx +++ b/components/WalletsCarousel.tsx @@ -288,7 +288,6 @@ interface WalletsCarouselProps extends Partial> { handleLongPress?: () => void; data: TWallet[]; scrollEnabled?: boolean; - showNewWalletPanel?: boolean; // New prop } type FlatListRefType = FlatList & { @@ -317,7 +316,7 @@ const cStyles = StyleSheet.create({ const ListHeaderComponent: React.FC = () => ; const WalletsCarousel = forwardRef((props, ref) => { - const { horizontal, data, handleLongPress, onPress, selectedWallet, scrollEnabled, showNewWalletPanel, onNewWalletPress } = props; + const { horizontal, data, handleLongPress, onPress, selectedWallet, scrollEnabled, onNewWalletPress } = props; const renderItem = useCallback( ({ item, index }: ListRenderItemInfo) => item ? ( @@ -334,31 +333,35 @@ const WalletsCarousel = forwardRef((props const flatListRef = useRef>(null); - useImperativeHandle(ref, (): any => { - return { - scrollToEnd: (params: { animated?: boolean | null | undefined } | undefined) => flatListRef.current?.scrollToEnd(params), - scrollToIndex: (params: { - animated?: boolean | null | undefined; - index: number; - viewOffset?: number | undefined; - viewPosition?: number | undefined; - }) => flatListRef.current?.scrollToIndex(params), - scrollToItem: (params: { - animated?: boolean | null | undefined; - item: any; - viewOffset?: number | undefined; - viewPosition?: number | undefined; - }) => flatListRef.current?.scrollToItem(params), - scrollToOffset: (params: { animated?: boolean | null | undefined; offset: number }) => flatListRef.current?.scrollToOffset(params), - recordInteraction: () => flatListRef.current?.recordInteraction(), - flashScrollIndicators: () => flatListRef.current?.flashScrollIndicators(), - getNativeScrollRef: () => flatListRef.current?.getNativeScrollRef(), - }; - }, []); + useImperativeHandle( + ref, + (): any => { + return { + scrollToEnd: (params: { animated?: boolean | null | undefined } | undefined) => flatListRef.current?.scrollToEnd(params), + scrollToIndex: (params: { + animated?: boolean | null | undefined; + index: number; + viewOffset?: number | undefined; + viewPosition?: number | undefined; + }) => flatListRef.current?.scrollToIndex(params), + scrollToItem: (params: { + animated?: boolean | null | undefined; + item: any; + viewOffset?: number | undefined; + viewPosition?: number | undefined; + }) => flatListRef.current?.scrollToItem(params), + scrollToOffset: (params: { animated?: boolean | null | undefined; offset: number }) => flatListRef.current?.scrollToOffset(params), + recordInteraction: () => flatListRef.current?.recordInteraction(), + flashScrollIndicators: () => flatListRef.current?.flashScrollIndicators(), + getNativeScrollRef: () => flatListRef.current?.getNativeScrollRef(), + }; + }, + [], + ); const onScrollToIndexFailed = (error: { averageItemLength: number; index: number }): void => { - console.log('onScrollToIndexFailed'); - console.log(error); + console.debug('onScrollToIndexFailed'); + console.debug(error); flatListRef.current?.scrollToOffset({ offset: error.averageItemLength * error.index, animated: true }); setTimeout(() => { if (data.length !== 0 && flatListRef.current !== null) { @@ -390,7 +393,7 @@ const WalletsCarousel = forwardRef((props ListHeaderComponent={ListHeaderComponent} style={{ minHeight: sliderHeight + 12 }} onScrollToIndexFailed={onScrollToIndexFailed} - ListFooterComponent={showNewWalletPanel && onNewWalletPress ? : null} + ListFooterComponent={onNewWalletPress ? : null} {...props} /> ) : ( @@ -406,7 +409,7 @@ const WalletsCarousel = forwardRef((props /> ) : null, )} - {showNewWalletPanel && onNewWalletPress && } + {onNewWalletPress && } ); }); diff --git a/ios/BlueWallet.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/BlueWallet.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index dc603f84c..000000000 --- a/ios/BlueWallet.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,42 +0,0 @@ -{ - "originHash" : "52530e6b1e3a85c8854952ef703a6d1bbe1acd82713be2b3166476b9b277db23", - "pins" : [ - { - "identity" : "bugsnag-cocoa", - "kind" : "remoteSourceControl", - "location" : "https://github.com/bugsnag/bugsnag-cocoa", - "state" : { - "revision" : "16b9145fc66e5296f16e733f6feb5d0e450574e8", - "version" : "6.28.1" - } - }, - { - "identity" : "efqrcode", - "kind" : "remoteSourceControl", - "location" : "https://github.com/EFPrefix/EFQRCode.git", - "state" : { - "revision" : "2991c2f318ad9529d93b2a73a382a3f9c72c64ce", - "version" : "6.2.2" - } - }, - { - "identity" : "keychain-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/evgenyneu/keychain-swift.git", - "state" : { - "revision" : "5e1b02b6a9dac2a759a1d5dbc175c86bd192a608", - "version" : "24.0.0" - } - }, - { - "identity" : "swift_qrcodejs", - "kind" : "remoteSourceControl", - "location" : "https://github.com/ApolloZhu/swift_qrcodejs.git", - "state" : { - "revision" : "374dc7f7b9e76c6aeb393f6a84590c6d387e1ecb", - "version" : "2.2.2" - } - } - ], - "version" : 3 -} diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 89048e46f..5e77ca2df 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -858,4 +858,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: f19eea438501edfe85fb2fa51d40ba1b57540758 -COCOAPODS: 1.15.2 +COCOAPODS: 1.14.3 diff --git a/screen/wallets/DrawerList.tsx b/screen/wallets/DrawerList.tsx index f34b0210e..6cf7ca8ab 100644 --- a/screen/wallets/DrawerList.tsx +++ b/screen/wallets/DrawerList.tsx @@ -145,7 +145,6 @@ const DrawerList: React.FC = memo(({ navigation }) => {
{ handleLongPress={handleLongPress} onMomentumScrollEnd={onSnapToItem} ref={walletsCarousel} - showNewWalletPanel onNewWalletPress={handleClick} testID="WalletsList" horizontal