MOB-512 hide confidence metrics

This commit is contained in:
sepeterson
2025-11-20 17:59:57 -06:00
parent 3a2c110c93
commit cf53c791ad
2 changed files with 16 additions and 15 deletions

View File

@@ -19,9 +19,10 @@ interface Props {
score?: number;
taxon: RealmTaxon;
};
hideObservationStatus?: boolean
}
const MatchHeader = ( { topSuggestion }: Props ) => {
const MatchHeader = ( { topSuggestion, hideObservationStatus }: Props ) => {
const { t } = useTranslation( );
const taxon = topSuggestion?.taxon;
@@ -89,17 +90,19 @@ const MatchHeader = ( { topSuggestion }: Props ) => {
return (
<View>
<Body2 className="mb-2">{generateCongratulatoryText( )}</Body2>
{!hideObservationStatus && <Body2 className="mb-2">{generateCongratulatoryText( )}</Body2>}
<View className="flex-row justify-between items-center">
{showSuggestedTaxon( )}
<View className="justify-end items-center ml-5">
<Subheading2 className="text-inatGreen mb-2">
{t( "X-percent", { count: confidence } )}
</Subheading2>
<Body4 className="text-inatGreen">
{t( "Confidence--label" )}
</Body4>
</View>
{ !hideObservationStatus && (
<View className="justify-end items-center ml-5">
<Subheading2 className="text-inatGreen mb-2">
{t( "X-percent", { count: confidence } )}
</Subheading2>
<Body4 className="text-inatGreen">
{t( "Confidence--label" )}
</Body4>
</View>
)}
</View>
</View>
);

View File

@@ -32,17 +32,15 @@ const SavedMatch = ( {
const latitude = observation?.privateLatitude || observation?.latitude;
const { taxon } = observation;
/* left todo
- simplify match header
- add edit pencil
- fix type errors
/*
todo: globalize class strings and maybe some of the resused container functions
*/
return (
<ScrollViewWrapper>
<SavedMatchHeaderRight uuid={observation.uuid} />
<View className={cardClassTop}>
<MatchHeader topSuggestion={observation} />
<MatchHeader hideObservationStatus topSuggestion={observation} />
</View>
<PhotosSection
representativePhoto={taxon?.representative_photo}