diff --git a/src/components/Explore/BottomCard.js b/src/components/Explore/BottomCard.js
index be3a23f6e..9016accba 100644
--- a/src/components/Explore/BottomCard.js
+++ b/src/components/Explore/BottomCard.js
@@ -1,10 +1,10 @@
// @flow
-import TranslatedText from "components/SharedComponents/TranslatedText";
+import { Text, View } from "components/styledComponents";
+import { t } from "i18next";
import { ExploreContext } from "providers/contexts";
import type { Node } from "react";
import React, { useContext } from "react";
-import { View } from "react-native";
import { viewStyles } from "styles/explore/explore";
import DropdownPicker from "./DropdownPicker";
@@ -38,7 +38,7 @@ const Explore = ( ): Node => {
return (
-
+ {t( "Explore" )}
{
<>
-
+ {t( "Sort-by" )}
{
}}
/>
-
+ {t( "Filters" )}
-
+ {t( "Quality-Grade" )}
{renderQualityGradeCheckbox( "research" )}
-
+ {t( "Research-Grade" )}
{renderQualityGradeCheckbox( "needs_id" )}
-
+ {t( "Needs-ID" )}
{renderQualityGradeCheckbox( "casual" )}
-
+ {t( "Casual" )}
-
-
+ {t( "User" )}
+ {t( "Search-for-a-user" )}
{
sources="users"
value={userId}
/>
-
-
+ {t( "Projects" )}
+ {t( "Search-for-a-project" )}
{
sources="projects"
value={projectId}
/>
-
-
+ {t( "Rank" )}
+ {t( "Low" )}
{renderRankPicker( "lrank" )}
-
+ {t( "High" )}
{renderRankPicker( "hrank" )}
-
-
+ {t( "Date" )}
+ {t( "Months" )}
{renderMonthsPicker( )}
-
+ {t( "Media" )}
{renderMediaCheckbox( "photos" )}
-
+ {t( "Has-Photos" )}
{renderMediaCheckbox( "sounds" )}
-
+ {t( "Has-Sounds" )}
-
+ {t( "Status" )}
{renderStatusCheckbox( "introduced" )}
-
+ {t( "Introduced" )}
{renderStatusCheckbox( "native" )}
-
+ {t( "Native" )}
{renderStatusCheckbox( "threatened" )}
-
+ {t( "Threatened" )}
{renderStatusCheckbox( "captive" )}
-
+ {t( "Captive-Cultivated" )}
-
+ {t( "Reviewed" )}
{
}
}}
/>
-
+ {t( "Photo-Licensing" )}
{
setUnappliedFilters( {
@@ -413,7 +412,7 @@ const ExploreFilters = ( ): Node => {
: "all"
}
/>
-
+ {t( "Description-Tags" )}
{
setUnappliedFilters( {
diff --git a/src/components/Explore/ExploreFooter.js b/src/components/Explore/ExploreFooter.js
index ec31ace96..9b464a547 100644
--- a/src/components/Explore/ExploreFooter.js
+++ b/src/components/Explore/ExploreFooter.js
@@ -3,6 +3,7 @@
import { HeaderBackButton } from "@react-navigation/elements";
import { useNavigation } from "@react-navigation/native";
import Button from "components/SharedComponents/Buttons/Button";
+import { t } from "i18next";
import { ExploreContext } from "providers/contexts";
import type { Node } from "react";
import React from "react";
@@ -29,7 +30,7 @@ const ExploreFooter = ( ): Node => {
diff --git a/src/components/Explore/ExploreLanding.js b/src/components/Explore/ExploreLanding.js
index 1c7e04c70..ae59359b8 100644
--- a/src/components/Explore/ExploreLanding.js
+++ b/src/components/Explore/ExploreLanding.js
@@ -2,13 +2,12 @@
import { useNavigation } from "@react-navigation/native";
import Button from "components/SharedComponents/Buttons/Button";
-import TranslatedText from "components/SharedComponents/TranslatedText";
import ViewWithFooter from "components/SharedComponents/ViewWithFooter";
-// import DropdownPicker from "./DropdownPicker";
+import { Text, View } from "components/styledComponents";
+import { t } from "i18next";
import { ExploreContext } from "providers/contexts";
import type { Node } from "react";
import React, { useContext } from "react";
-import { View } from "react-native";
import { textStyles, viewStyles } from "styles/explore/explore";
import FiltersIcon from "./FiltersIcon";
@@ -30,13 +29,15 @@ const Explore = ( ): Node => {
return (
-
+
+ {t( "Visually-search-iNaturalist-data" )}
+
>
diff --git a/src/components/ObsDetails/ObsDetails.js b/src/components/ObsDetails/ObsDetails.js
index 0e87ccc16..46095b298 100644
--- a/src/components/ObsDetails/ObsDetails.js
+++ b/src/components/ObsDetails/ObsDetails.js
@@ -16,13 +16,13 @@ import {
Image, Pressable, Text, View
} from "components/styledComponents";
import { formatISO } from "date-fns";
+import { t } from "i18next";
import _ from "lodash";
import { RealmContext } from "providers/contexts";
import type { Node } from "react";
import React, {
useEffect, useState
} from "react";
-import { useTranslation } from "react-i18next";
import {
Alert, LogBox
} from "react-native";
@@ -55,7 +55,6 @@ LogBox.ignoreLogs( [
const ObsDetails = ( ): Node => {
const currentUser = useCurrentUser( );
const userId = currentUser?.id;
- const { t } = useTranslation( );
const [refetch, setRefetch] = useState( false );
const [showCommentBox, setShowCommentBox] = useState( false );
const { params } = useRoute( );
diff --git a/src/components/ObsEdit/BottomModal.js b/src/components/ObsEdit/BottomModal.js
index a0ddc9092..1fedd2b66 100644
--- a/src/components/ObsEdit/BottomModal.js
+++ b/src/components/ObsEdit/BottomModal.js
@@ -3,6 +3,7 @@
import { useNavigation } from "@react-navigation/native";
import PlaceholderText from "components/PlaceholderText";
import Button from "components/SharedComponents/Buttons/Button";
+import { t } from "i18next";
import { ObsEditContext } from "providers/contexts";
import type { Node } from "react";
import React, { useContext } from "react";
@@ -34,15 +35,14 @@ const BottomModal = ( ): Node => {
diff --git a/src/components/ObsEdit/IdentificationSection.js b/src/components/ObsEdit/IdentificationSection.js
index 066e50917..987e1b257 100644
--- a/src/components/ObsEdit/IdentificationSection.js
+++ b/src/components/ObsEdit/IdentificationSection.js
@@ -4,10 +4,10 @@ import { useNavigation } from "@react-navigation/native";
import Button from "components/SharedComponents/Buttons/Button";
import { Text, View } from "components/styledComponents";
import { iconicTaxaIds, iconicTaxaNames } from "dictionaries/iconicTaxaIds";
+import { t } from "i18next";
import { ObsEditContext } from "providers/contexts";
import type { Node } from "react";
import React, { useContext } from "react";
-import { useTranslation } from "react-i18next";
import { FlatList } from "react-native";
import { Avatar, useTheme } from "react-native-paper";
import { textStyles, viewStyles } from "styles/obsEdit/obsEdit";
@@ -18,7 +18,6 @@ const IdentificationSection = ( ): Node => {
updateTaxon
} = useContext( ObsEditContext );
const navigation = useNavigation( );
- const { t } = useTranslation( );
const { colors } = useTheme( );
const identification = currentObservation.taxon;
@@ -65,7 +64,7 @@ const IdentificationSection = ( ): Node => {
diff --git a/src/components/ObsEdit/LocationPicker.js b/src/components/ObsEdit/LocationPicker.js
index 37e270494..c8e1b5cff 100644
--- a/src/components/ObsEdit/LocationPicker.js
+++ b/src/components/ObsEdit/LocationPicker.js
@@ -4,6 +4,7 @@ import Button from "components/SharedComponents/Buttons/Button";
import InputField from "components/SharedComponents/InputField";
import Map from "components/SharedComponents/Map";
import ViewNoFooter from "components/SharedComponents/ViewNoFooter";
+import { t } from "i18next";
import type { Node } from "react";
import React, { useEffect, useState } from "react";
import { View } from "react-native";
@@ -65,7 +66,7 @@ const LocationPicker = ( { closeLocationPicker, updateLocation }: Props ): Node
diff --git a/src/components/ObsEdit/ObsEdit.js b/src/components/ObsEdit/ObsEdit.js
index 39a909eb9..f0e307617 100644
--- a/src/components/ObsEdit/ObsEdit.js
+++ b/src/components/ObsEdit/ObsEdit.js
@@ -6,13 +6,13 @@ import MediaViewerModal from "components/MediaViewer/MediaViewerModal";
import Button from "components/SharedComponents/Buttons/Button";
import KebabMenu from "components/SharedComponents/KebabMenu";
import { Text, View } from "components/styledComponents";
+import { t } from "i18next";
import { ObsEditContext, RealmContext } from "providers/contexts";
import type { Node } from "react";
import React, {
useCallback, useContext, useEffect, useRef,
useState
} from "react";
-import { useTranslation } from "react-i18next";
import { BackHandler } from "react-native";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import { Menu } from "react-native-paper";
@@ -47,7 +47,6 @@ const ObsEdit = ( ): Node => {
) : [];
const navigation = useNavigation( );
const { params } = useRoute( );
- const { t } = useTranslation( );
const localObservation = useLocalObservation( params?.uuid );
const isLoggedIn = useLoggedIn( );
const [mediaViewerVisible, setMediaViewerVisible] = useState( false );
@@ -106,7 +105,7 @@ const ObsEdit = ( ): Node => {
/>
>
- ), [deleteDialogVisible, t] );
+ ), [deleteDialogVisible] );
useEffect( ( ) => {
const renderHeaderTitle = ( ) => ;
@@ -181,7 +180,7 @@ const ObsEdit = ( ): Node => {
/>
{
- if ( numOfUnuploadedObs === 0 ) { return null; }
-
if ( isLoggedIn === false ) {
return (
@@ -145,15 +143,18 @@ const ObservationViews = ( {
/>
);
}
- return (
-
-
-
- );
+ if ( numOfUnuploadedObs > 0 && isLoggedIn ) {
+ return (
+
+
+
+ );
+ }
+ return null;
};
const renderFooter = ( ) => {
@@ -200,7 +201,7 @@ const ObservationViews = ( {
bounces={false}
contentContainerStyle={{ minHeight: flatListHeight }}
/>
- {renderBottomSheet( )}
+ {numOfUnuploadedObs > 0 && renderBottomSheet( )}
>
);
};
diff --git a/src/components/PhotoImporter/GroupPhotosFooter.js b/src/components/PhotoImporter/GroupPhotosFooter.js
index 27c05e4e8..96bc134b4 100644
--- a/src/components/PhotoImporter/GroupPhotosFooter.js
+++ b/src/components/PhotoImporter/GroupPhotosFooter.js
@@ -74,7 +74,7 @@ const GroupPhotosFooter = ( {
diff --git a/src/components/PhotoImporter/PhotoGallery.js b/src/components/PhotoImporter/PhotoGallery.js
index 170b507be..d0b526f88 100644
--- a/src/components/PhotoImporter/PhotoGallery.js
+++ b/src/components/PhotoImporter/PhotoGallery.js
@@ -226,8 +226,7 @@ const PhotoGallery = ( ): Node => {
diff --git a/src/components/SharedComponents/Buttons/Button.js b/src/components/SharedComponents/Buttons/Button.js
index 9374d3a5d..de68c584d 100644
--- a/src/components/SharedComponents/Buttons/Button.js
+++ b/src/components/SharedComponents/Buttons/Button.js
@@ -1,6 +1,6 @@
// @flow
-import TranslatedText from "components/SharedComponents/TranslatedText";
+import { Text } from "components/styledComponents";
import * as React from "react";
import { Button as ButtonRNP } from "react-native-paper";
@@ -9,7 +9,6 @@ type ButtonProps = {
disabled?: boolean,
onPress: any,
level?: string,
- count?: number,
testID?: string,
loading?: boolean,
style?: any,
@@ -49,7 +48,7 @@ const setStyles = ( {
};
const Button = ( {
- text, onPress, disabled, testID, count, level, loading, style, className
+ text, onPress, disabled, testID, level, loading, style, className
}: ButtonProps ): React.Node => {
const { buttonClass } = setStyles( { disabled, level, className } );
@@ -62,11 +61,9 @@ const Button = ( {
testID={testID}
loading={loading}
>
-
+
+ {text}
+
);
};
diff --git a/src/components/SharedComponents/Buttons/RoundGrayButton.js b/src/components/SharedComponents/Buttons/RoundGrayButton.js
deleted file mode 100644
index adae30ed6..000000000
--- a/src/components/SharedComponents/Buttons/RoundGrayButton.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// @flow
-import TranslatedText from "components/SharedComponents/TranslatedText";
-import * as React from "react";
-import { Button } from "react-native-paper";
-import { textStyles, viewStyles } from "styles/sharedComponents/buttons/roundGrayButton";
-
-type Props = {
- buttonText: string,
- count?: number,
- disabled?: boolean,
- handlePress: any,
- loading?: boolean,
- style?: any,
- testID: string
-}
-
-const RoundGrayButton = ( {
- buttonText,
- count,
- disabled,
- handlePress,
- loading,
- style,
- testID
-}: Props ): React.Node => (
-
-
-
-);
-
-export default RoundGrayButton;
diff --git a/src/components/SharedComponents/TranslatedText.js b/src/components/SharedComponents/TranslatedText.js
deleted file mode 100644
index 38a577ffe..000000000
--- a/src/components/SharedComponents/TranslatedText.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// @flow
-
-import type { Node } from "react";
-import React from "react";
-import { useTranslation } from "react-i18next";
-import { Text } from "react-native";
-
-type Props = {
- text: string,
- style?: any,
- className?: string,
- count?: number
-}
-
-const TranslatedText = ( {
- text, style, className, count
-}: Props ): Node => {
- const { t } = useTranslation( );
-
- // $FlowIgnore
- return {t( text, { count } )};
-};
-
-export default TranslatedText;
diff --git a/src/components/UserProfile/UserProfile.js b/src/components/UserProfile/UserProfile.js
index c58143d41..3591d0f95 100644
--- a/src/components/UserProfile/UserProfile.js
+++ b/src/components/UserProfile/UserProfile.js
@@ -102,7 +102,7 @@ const UserProfile = ( ): React.Node => {
@@ -110,7 +110,7 @@ const UserProfile = ( ): React.Node => {
console.log( "open messages" )}
testID="UserProfile.messagesButton"
/>