diff --git a/.eslintrc.js b/.eslintrc.js
index 63633947e..a150efbff 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -170,6 +170,12 @@ module.exports = {
"import/consistent-type-specifier-style": "off"
}
},
+ {
+ files: ["*.test.js", "*.test.tsx"],
+ rules: {
+ "react/jsx-props-no-spreading": "off"
+ }
+ },
{
files: ["**/__mocks__/**/*", "**/*mock*", "**/*.mock.*"],
rules: {
diff --git a/src/api/types.d.ts b/src/api/types.d.ts
index 14285e2f7..b2a79dff6 100644
--- a/src/api/types.d.ts
+++ b/src/api/types.d.ts
@@ -105,12 +105,17 @@ export interface ApiUser {
export interface ApiComment {
body?: string;
user?: ApiUser;
+ id: number;
+ hidden?: boolean;
+ uuid: string;
+ created_at: string;
}
export interface ApiIdentification {
body?: string;
taxon?: ApiTaxon;
user?: ApiUser;
+ hidden?: boolean;
}
export interface ApiNotification {
@@ -137,6 +142,9 @@ export interface ApiObservation extends ApiRecord {
time_observed_at?: string;
user?: ApiUser;
uuid: string;
+ comments?: ApiComment[];
+ identifications?: ApiIdentification[];
+ taxon?: ApiTaxon;
}
export interface ApiSuggestion {
diff --git a/src/components/Match/MatchHeader.tsx b/src/components/Match/MatchHeader.tsx
index cef3596b3..533573e73 100644
--- a/src/components/Match/MatchHeader.tsx
+++ b/src/components/Match/MatchHeader.tsx
@@ -15,9 +15,10 @@ import { useTranslation } from "sharedHooks";
interface Props {
topSuggestion?: ApiSuggestion;
+ hideObservationStatus?: boolean
}
-const MatchHeader = ( { topSuggestion }: Props ) => {
+const MatchHeader = ( { topSuggestion, hideObservationStatus }: Props ) => {
const { t } = useTranslation( );
const taxon = topSuggestion?.taxon;
@@ -87,17 +88,19 @@ const MatchHeader = ( { topSuggestion }: Props ) => {
return (
- {generateCongratulatoryText( )}
+ {!hideObservationStatus && {generateCongratulatoryText( )}}
{showSuggestedTaxon( )}
-
-
- {t( "X-percent", { count: confidence } )}
-
-
- {t( "Confidence--label" )}
-
-
+ { !hideObservationStatus && (
+
+
+ {t( "X-percent", { count: confidence } )}
+
+
+ {t( "Confidence--label" )}
+
+
+ )}
);
diff --git a/src/components/Match/PhotosSection.tsx b/src/components/Match/PhotosSection.tsx
index b9b642038..93a63e9e0 100644
--- a/src/components/Match/PhotosSection.tsx
+++ b/src/components/Match/PhotosSection.tsx
@@ -17,14 +17,16 @@ type Props = {
representativePhoto: ApiPhoto,
taxon?: ApiTaxon | RealmTaxon,
obsPhotos: RealmObservationPhoto[],
- navToTaxonDetails: ( photo: ApiPhoto ) => void
+ navToTaxonDetails: ( photo: ApiPhoto ) => void,
+ hideTaxonPhotos?: boolean
}
const PhotosSection = ( {
representativePhoto,
taxon,
obsPhotos,
- navToTaxonDetails
+ navToTaxonDetails,
+ hideTaxonPhotos
}: Props ) => {
const [displayPortraitLayout, setDisplayPortraitLayout] = useState( null );
const [mediaViewerVisible, setMediaViewerVisible] = useState( false );
@@ -88,34 +90,36 @@ const PhotosSection = ( {
let observationPhotoClass = "w-full h-full";
let taxonPhotosContainerClass;
let taxonPhotoClass;
- // If there is only one taxon photo: obs photo a square,
- // taxon photo a square in the lower right corner of the obs photo
- if ( bestTaxonPhotos.length === 1 ) {
- containerClass = "flex-row relative";
- observationPhotoClass = "w-full h-full";
- taxonPhotosContainerClass = "absolute bottom-0 right-0 w-1/3 h-1/3";
- taxonPhotoClass = "w-full h-full border-l-[3px] border-t-[3px] border-white";
- }
- if ( bestTaxonPhotos.length > 1 ) {
- if ( displayPortraitLayout ) {
- containerClass = "flex-row";
- observationPhotoClass = "w-2/3 h-full pr-[3px]";
- if ( bestTaxonPhotos.length === 2 ) {
- taxonPhotosContainerClass = "flex-col w-1/3 h-full space-y-[3px]";
- taxonPhotoClass = "w-full h-1/2";
+ if ( !hideTaxonPhotos ) {
+ // If there is only one taxon photo: obs photo a square,
+ // taxon photo a square in the lower right corner of the obs photo
+ if ( bestTaxonPhotos.length === 1 ) {
+ containerClass = "flex-row relative";
+ observationPhotoClass = "w-full h-full";
+ taxonPhotosContainerClass = "absolute bottom-0 right-0 w-1/3 h-1/3";
+ taxonPhotoClass = "w-full h-full border-l-[3px] border-t-[3px] border-white";
+ }
+ if ( bestTaxonPhotos.length > 1 ) {
+ if ( displayPortraitLayout ) {
+ containerClass = "flex-row";
+ observationPhotoClass = "w-2/3 h-full pr-[3px]";
+ if ( bestTaxonPhotos.length === 2 ) {
+ taxonPhotosContainerClass = "flex-col w-1/3 h-full space-y-[3px]";
+ taxonPhotoClass = "w-full h-1/2";
+ } else {
+ taxonPhotosContainerClass = "flex-col w-1/3 h-full space-y-[3px]";
+ taxonPhotoClass = "w-full h-1/3";
+ }
} else {
- taxonPhotosContainerClass = "flex-col w-1/3 h-full space-y-[3px]";
- taxonPhotoClass = "w-full h-1/3";
- }
- } else {
- containerClass = "flex-col";
- observationPhotoClass = "w-full h-2/3 pb-[3px]";
- if ( bestTaxonPhotos.length === 2 ) {
- taxonPhotosContainerClass = "flex-row w-full h-1/3 space-x-[3px]";
- taxonPhotoClass = "w-1/2 h-full";
- } else {
- taxonPhotosContainerClass = "flex-row w-full h-1/3 space-x-[3px]";
- taxonPhotoClass = "w-1/3 h-full";
+ containerClass = "flex-col";
+ observationPhotoClass = "w-full h-2/3 pb-[3px]";
+ if ( bestTaxonPhotos.length === 2 ) {
+ taxonPhotosContainerClass = "flex-row w-full h-1/3 space-x-[3px]";
+ taxonPhotoClass = "w-1/2 h-full";
+ } else {
+ taxonPhotosContainerClass = "flex-row w-full h-1/3 space-x-[3px]";
+ taxonPhotoClass = "w-1/3 h-full";
+ }
}
}
}
@@ -191,9 +195,9 @@ const PhotosSection = ( {
}
return (
-
+
{renderObservationPhoto( )}
- {bestTaxonPhotos.length > 0 && renderTaxonPhotos( )}
+ {!hideTaxonPhotos && bestTaxonPhotos.length > 0 && renderTaxonPhotos( )}
setMediaViewerVisible( false )}
diff --git a/src/components/ObsDetailsDefaultMode/CommunitySection/CommunitySection.js b/src/components/ObsDetailsDefaultMode/CommunitySection/CommunitySection.js
index d7a3d087e..7554d05a6 100644
--- a/src/components/ObsDetailsDefaultMode/CommunitySection/CommunitySection.js
+++ b/src/components/ObsDetailsDefaultMode/CommunitySection/CommunitySection.js
@@ -14,7 +14,7 @@ type Props = {
activityItems: Array