MOB-512 no empty map

This commit is contained in:
sepeterson
2025-11-20 16:20:13 -06:00
parent e24a2df82c
commit 53915996cc
2 changed files with 10 additions and 30 deletions

View File

@@ -1,5 +1,4 @@
import { useNetInfo } from "@react-native-community/netinfo";
import EmptyMapSection from "components/Match/EmptyMapSection";
import MatchHeader from "components/Match/MatchHeader";
import PhotosSection from "components/Match/PhotosSection";
import LocationSection from "components/ObsDetailsDefaultMode/LocationSection/LocationSection";
@@ -19,15 +18,11 @@ const cardClassBottom
type Props = {
observation: RealmObservation,
navToTaxonDetails: ( ) => void,
isFetchingLocation: boolean,
handleAddLocationPressed: ( ) => void,
}
const SavedMatch = ( {
observation,
navToTaxonDetails,
isFetchingLocation,
handleAddLocationPressed
navToTaxonDetails
}: Props ) => {
const { t } = useTranslation( );
const { isConnected } = useNetInfo( );
@@ -35,6 +30,12 @@ const SavedMatch = ( {
const latitude = observation?.privateLatitude || observation?.latitude;
const { taxon } = observation;
/* left todo
- fill in functionality in container
- add edit pencil
- fix type errors
*/
return (
<ScrollViewWrapper>
<View className={cardClassTop}>
@@ -47,16 +48,9 @@ const SavedMatch = ( {
navToTaxonDetails={navToTaxonDetails}
/>
<View className="border-[1.5px] border-white" />
{!latitude
? (
<EmptyMapSection
handleAddLocationPressed={handleAddLocationPressed}
isFetchingLocation={isFetchingLocation}
/>
)
: (
<MapSection observation={observation} taxon={taxon} />
)}
{latitude && (
<MapSection observation={observation} taxon={taxon} />
)}
<LocationSection
belongsToCurrentUser
observation={observation}
@@ -75,18 +69,6 @@ const SavedMatch = ( {
/>
)
}
{!latitude && (
<Button
className="mx-4 mb-[30px]"
level="neutral"
text={t( "ADD-LOCATION-FOR-BETTER-IDS" )}
onPress={handleAddLocationPressed}
loading={isFetchingLocation}
disabled={isFetchingLocation}
accessibilityLabel={t( "Edit-location" )}
accessibilityHint={t( "Add-location-to-refresh-suggestions" )}
/>
)}
</ScrollViewWrapper>
);
};

View File

@@ -33,8 +33,6 @@ const SavedMatchContainer = ( {
<SavedMatch
observation={observation}
navToTaxonDetails={navToTaxonDetails}
isFetchingLocation={false}
handleAddLocationPressed={() => {}}
/>
);
};