diff --git a/package-lock.json b/package-lock.json index 117d40ef8..9e0785405 100644 --- a/package-lock.json +++ b/package-lock.json @@ -91,7 +91,7 @@ "react-native-paper": "^5.12.3", "react-native-permissions": "^4.1.5", "react-native-reanimated": "^3.19.5", - "react-native-reanimated-carousel": "^3.5.1", + "react-native-reanimated-carousel": "^4.0.3", "react-native-render-html": "^6.3.4", "react-native-restart": "^0.0.27", "react-native-safe-area-context": "^5.6.2", @@ -7730,14 +7730,6 @@ "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, - "node_modules/@trysound/sax": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", - "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/@tsconfig/node10": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", @@ -20972,13 +20964,14 @@ } }, "node_modules/react-native-reanimated-carousel": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/react-native-reanimated-carousel/-/react-native-reanimated-carousel-3.5.1.tgz", - "integrity": "sha512-9BBQV6JAYSQm2lV7MFtT4mzapXmW4IZO6s38gfiJL84Jg23ivGB1UykcNQauKgtHyhtW2NuZJzItb1s42lM+hA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/react-native-reanimated-carousel/-/react-native-reanimated-carousel-4.0.3.tgz", + "integrity": "sha512-YZXlvZNghR5shFcI9hTA7h7bEhh97pfUSLZvLBAshpbkuYwJDKmQXejO/199T6hqGq0wCRwR0CWf2P4Vs6A4Fw==", + "license": "MIT", "peerDependencies": { - "react": ">=16.8.0", - "react-native": ">=0.6.0", - "react-native-gesture-handler": ">=2.0.0", + "react": ">=18.0.0", + "react-native": ">=0.70.3", + "react-native-gesture-handler": ">=2.9.0", "react-native-reanimated": ">=3.0.0" } }, @@ -21976,6 +21969,15 @@ "node": ">=0.10.0" } }, + "node_modules/sax": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.5.0.tgz", + "integrity": "sha512-21IYA3Q5cQf089Z6tgaUTr7lDAyzoTPx5HRtbhsME8Udispad8dC/+sziTNugOEx54ilvatQ9YCzl4KQLPcRHA==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=11.0.0" + } + }, "node_modules/scheduler": { "version": "0.26.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", @@ -22950,16 +22952,18 @@ "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" }, "node_modules/svgo": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz", - "integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.3.3.tgz", + "integrity": "sha512-+wn7I4p7YgJhHs38k2TNjy1vCfPIfLIJWR5MnCStsN8WuuTcBnRKcMHQLMM2ijxGZmDoZwNv8ipl5aTTen62ng==", + "license": "MIT", "dependencies": { - "@trysound/sax": "0.2.0", "commander": "^7.2.0", "css-select": "^5.1.0", - "css-tree": "^2.2.1", + "css-tree": "^2.3.1", + "css-what": "^6.1.0", "csso": "^5.0.5", - "picocolors": "^1.0.0" + "picocolors": "^1.0.0", + "sax": "^1.5.0" }, "bin": { "svgo": "bin/svgo" diff --git a/package.json b/package.json index 3737a0dfe..3456bb8a0 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "react-native-paper": "^5.12.3", "react-native-permissions": "^4.1.5", "react-native-reanimated": "^3.19.5", - "react-native-reanimated-carousel": "^3.5.1", + "react-native-reanimated-carousel": "^4.0.3", "react-native-render-html": "^6.3.4", "react-native-restart": "^0.0.27", "react-native-safe-area-context": "^5.6.2", diff --git a/src/components/Camera/AICamera/AICameraButtons.tsx b/src/components/Camera/AICamera/AICameraButtons.tsx index 19e395862..1ceb06216 100644 --- a/src/components/Camera/AICamera/AICameraButtons.tsx +++ b/src/components/Camera/AICamera/AICameraButtons.tsx @@ -8,7 +8,7 @@ import Zoom from "components/Camera/Buttons/Zoom"; import TabletButtons from "components/Camera/TabletButtons"; import { View } from "components/styledComponents"; import React from "react"; -import type { GestureResponderEvent, ViewStyle } from "react-native"; +import type { ViewStyle } from "react-native"; import DeviceInfo from "react-native-device-info"; import type { CameraDeviceFormat, TakePhotoOptions } from "react-native-vision-camera"; import { useLayoutPrefs } from "sharedHooks"; @@ -18,10 +18,10 @@ import AIDebugButton from "./AIDebugButton"; const isTablet = DeviceInfo.isTablet(); interface Props { - handleZoomButtonPress: ( _event: GestureResponderEvent ) => void; + handleZoomButtonPress: ( ) => void; confidenceThreshold?: number; cropRatio?: string; - flipCamera: ( _event: GestureResponderEvent ) => void; + flipCamera: ( ) => void; fps?: number; handleClose: ( ) => void; hasFlash: boolean; @@ -39,10 +39,10 @@ interface Props { takePhoto: () => Promise; takePhotoOptions: TakePhotoOptions; takingPhoto: boolean; - toggleFlash: ( _event: GestureResponderEvent ) => void; + toggleFlash: ( ) => void; zoomTextValue: string; useLocation: boolean; - toggleLocation: ( _event: GestureResponderEvent ) => void; + toggleLocation: ( ) => void; deleteSentinelFile: ( ) => Promise; } diff --git a/src/components/Camera/Buttons/Flash.tsx b/src/components/Camera/Buttons/Flash.tsx index c04d260fc..234bbaf51 100644 --- a/src/components/Camera/Buttons/Flash.tsx +++ b/src/components/Camera/Buttons/Flash.tsx @@ -3,13 +3,13 @@ import RotatableIconWrapper from "components/Camera/RotatableIconWrapper"; // eslint-disable-next-line max-len import TransparentCircleButton from "components/SharedComponents/Buttons/TransparentCircleButton"; import React from "react"; -import type { GestureResponderEvent, ViewStyle } from "react-native"; +import type { ViewStyle } from "react-native"; import type { TakePhotoOptions } from "react-native-vision-camera"; import { useTranslation } from "sharedHooks"; interface Props { rotatableAnimatedStyle: ViewStyle; - toggleFlash: ( _event: GestureResponderEvent ) => void; + toggleFlash: ( ) => void; hasFlash?: boolean; takePhotoOptions: TakePhotoOptions; flashClassName?: string; diff --git a/src/components/Camera/Buttons/Location.tsx b/src/components/Camera/Buttons/Location.tsx index 6d092744f..f746eb196 100644 --- a/src/components/Camera/Buttons/Location.tsx +++ b/src/components/Camera/Buttons/Location.tsx @@ -1,12 +1,12 @@ import RotatableIconWrapper from "components/Camera/RotatableIconWrapper"; import TransparentCircleButton from "components/SharedComponents/Buttons/TransparentCircleButton"; import React from "react"; -import type { GestureResponderEvent, ViewStyle } from "react-native"; +import type { ViewStyle } from "react-native"; import { useTranslation } from "sharedHooks"; interface Props { rotatableAnimatedStyle: ViewStyle; - toggleLocation: ( _event: GestureResponderEvent ) => void; + toggleLocation: ( ) => void; useLocation?: boolean; } diff --git a/src/components/Explore/SearchScreens/ExploreLocationSearch.tsx b/src/components/Explore/SearchScreens/ExploreLocationSearch.tsx index 5ce090db9..e5f7b0e71 100644 --- a/src/components/Explore/SearchScreens/ExploreLocationSearch.tsx +++ b/src/components/Explore/SearchScreens/ExploreLocationSearch.tsx @@ -15,6 +15,7 @@ import { } from "providers/ExploreContext"; import React, { useCallback, + useMemo, useState, } from "react"; import { FlatList } from "react-native"; @@ -29,6 +30,8 @@ const DROP_SHADOW = getShadow( { offsetHeight: 4, } ); +const Footer = ( ) => ; + interface Props { closeModal: () => void; hasPermissions?: boolean; @@ -124,15 +127,13 @@ const ExploreLocationSearch = ( { } }; - const renderEmptyList = ( ) => ( + const emptyListComponent = useMemo( ( ) => ( - ); - - const renderFooter = ( ) => ; + ), [isLoading, locationName, refetch] ); const buttons = [ { @@ -175,8 +176,8 @@ const ExploreLocationSearch = ( { data={data} renderItem={renderItem} keyExtractor={item => item.id} - ListEmptyComponent={renderEmptyList} - ListFooterComponent={renderFooter} + ListEmptyComponent={emptyListComponent} + ListFooterComponent={Footer} /> {renderPermissionsGate( { onPermissionGranted: setNearbyLocation } )} diff --git a/src/components/SharedComponents/Buttons/INatIconButton.tsx b/src/components/SharedComponents/Buttons/INatIconButton.tsx index eec379727..ced66c1fa 100644 --- a/src/components/SharedComponents/Buttons/INatIconButton.tsx +++ b/src/components/SharedComponents/Buttons/INatIconButton.tsx @@ -30,7 +30,7 @@ interface Props extends PropsWithChildren { icon?: string; // Only show the icon with all the same layout, don't make it a button iconOnly?: boolean; - onPress: ( _event?: GestureResponderEvent ) => void; + onPress: ( _event: GestureResponderEvent ) => void; // Inserts a white or colored view under the icon so an holes in the shape show as // white preventTransparency?: boolean; @@ -178,7 +178,7 @@ const INatIconButton = ( { ); } - const handlePressWithTracking = ( event?: GestureResponderEvent ) => { + const handlePressWithTracking = ( event: GestureResponderEvent ) => { if ( testID ) { const currentRoute = getCurrentRoute( ); logger.info( `Button tap: ${testID}-${currentRoute?.name || "undefined"}` );