diff --git a/.detoxrc.js b/.detoxrc.js index 8f4849f34..df5e4261d 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -44,7 +44,7 @@ module.exports = { simulator: { type: "ios.simulator", device: { - type: "iPhone 13", + type: "iPhone 14 Plus", }, }, emulator: { diff --git a/android/app/src/main/assets/fonts/INatIcon.ttf b/android/app/src/main/assets/fonts/INatIcon.ttf index 8d10d15d3..92c325b69 100644 Binary files a/android/app/src/main/assets/fonts/INatIcon.ttf and b/android/app/src/main/assets/fonts/INatIcon.ttf differ diff --git a/android/app/src/main/assets/fonts/inaturalisticons.ttf b/android/app/src/main/assets/fonts/inaturalisticons.ttf new file mode 100644 index 000000000..4b27b8045 Binary files /dev/null and b/android/app/src/main/assets/fonts/inaturalisticons.ttf differ diff --git a/android/link-assets-manifest.json b/android/link-assets-manifest.json index 40970cc47..8b12586a6 100644 --- a/android/link-assets-manifest.json +++ b/android/link-assets-manifest.json @@ -3,7 +3,7 @@ "data": [ { "path": "assets/fonts/INatIcon.ttf", - "sha1": "47a247e3585aec0da80245083a706f676a7e01c0" + "sha1": "2691c217d3dfbcba545ce985c306fa93f9610606" }, { "path": "assets/fonts/Whitney-BookItalic-Pro.otf", @@ -16,6 +16,10 @@ { "path": "assets/fonts/Whitney-Medium-Pro.otf", "sha1": "33ca073c11f46dc266a7dc1adeaa102891bd76d1" + }, + { + "path": "assets/fonts/inaturalisticons.ttf", + "sha1": "d5a9b116c0d7857ec446f4f045fe5316196d22ec" } ] } diff --git a/assets/fonts/INatIcon.ttf b/assets/fonts/INatIcon.ttf index 8d10d15d3..92c325b69 100644 Binary files a/assets/fonts/INatIcon.ttf and b/assets/fonts/INatIcon.ttf differ diff --git a/assets/fonts/inaturalisticons.ttf b/assets/fonts/inaturalisticons.ttf new file mode 100644 index 000000000..4b27b8045 Binary files /dev/null and b/assets/fonts/inaturalisticons.ttf differ diff --git a/e2e/addObservationWithoutData.e2e.js b/e2e/addObservationWithoutData.e2e.js index 1deab8d4b..fdeeeaf44 100644 --- a/e2e/addObservationWithoutData.e2e.js +++ b/e2e/addObservationWithoutData.e2e.js @@ -28,7 +28,7 @@ describe( "Add observation without evidence", () => { } ); it( "should open app with the observation list screen", async () => { - const loginText = element( by.id( "log-in-to-iNaturalist-text" ) ); + const loginText = element( by.id( "log-in-to-iNaturalist-button.text" ) ); await waitFor( loginText ).toBeVisible( ).withTimeout( 10000 ); await expect( loginText ).toBeVisible( ); } ); diff --git a/e2e/signIn.e2e.js b/e2e/signIn.e2e.js index a66bd477e..1030af652 100644 --- a/e2e/signIn.e2e.js +++ b/e2e/signIn.e2e.js @@ -29,12 +29,12 @@ describe( "Sign into app as logged-in user", () => { } ); it( "should open app with the observation list screen", async () => { - const loginText = element( by.id( "log-in-to-iNaturalist-text" ) ); + const loginText = element( by.id( "log-in-to-iNaturalist-button.text" ) ); // 10000 timeout is for github actions, which was failing with a // shorter timeout period await waitFor( loginText ).toBeVisible().withTimeout( 10000 ); await expect( loginText ).toBeVisible(); - await element( by.id( "log-in-to-iNaturalist-text" ) ).tap(); + await element( by.id( "log-in-to-iNaturalist-button.text" ) ).tap(); const usernameInput = element( by.id( "Login.email" ) ); await waitFor( usernameInput ).toBeVisible().withTimeout( 10000 ); await expect( usernameInput ).toBeVisible(); diff --git a/ios/iNaturalistReactNative.xcodeproj/project.pbxproj b/ios/iNaturalistReactNative.xcodeproj/project.pbxproj index e3ac9b875..8a70afc36 100644 --- a/ios/iNaturalistReactNative.xcodeproj/project.pbxproj +++ b/ios/iNaturalistReactNative.xcodeproj/project.pbxproj @@ -8,13 +8,14 @@ /* Begin PBXBuildFile section */ 00E356F31AD99517003FC87E /* iNaturalistReactNativeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* iNaturalistReactNativeTests.m */; }; - 07603705D89842DD91992F31 /* INatIcon.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3810FCEF1E284915A5A23AF5 /* INatIcon.ttf */; }; + 015B74B1048846199E2104BF /* INatIcon.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C9904C04E3DD410FA07BB0A1 /* INatIcon.ttf */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 374CB22F29943E63005885ED /* Whitney-BookItalic-Pro.otf in Resources */ = {isa = PBXBuildFile; fileRef = 374CB22E29943E63005885ED /* Whitney-BookItalic-Pro.otf */; }; 7EBBE0515B6D88FD724A5C47 /* libPods-iNaturalistReactNative.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7DD42FAECED8C66268DDB37F /* libPods-iNaturalistReactNative.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + 862E651A41DD461AAE4331B2 /* inaturalisticons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 142B10AEC7284E94AE0D2300 /* inaturalisticons.ttf */; }; A252B2AEA64E47C9AC1D20E8 /* Whitney-Light-Pro.otf in Resources */ = {isa = PBXBuildFile; fileRef = BA9D41ECEBFA4C38B74009B3 /* Whitney-Light-Pro.otf */; }; BA2479FA3D7B40A7BEF7B3CD /* Whitney-Medium-Pro.otf in Resources */ = {isa = PBXBuildFile; fileRef = D09FA3A0162844FF80A5EF96 /* Whitney-Medium-Pro.otf */; }; /* End PBXBuildFile section */ @@ -39,14 +40,15 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = iNaturalistReactNative/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iNaturalistReactNative/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iNaturalistReactNative/main.m; sourceTree = ""; }; + 142B10AEC7284E94AE0D2300 /* inaturalisticons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = inaturalisticons.ttf; path = ../assets/fonts/inaturalisticons.ttf; sourceTree = ""; }; 19A5877328F8E3310016D128 /* iNaturalistReactNative-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iNaturalistReactNative-Bridging-Header.h"; sourceTree = ""; }; 27F9BBBBAB49ABBAF88433C9 /* Pods-iNaturalistReactNative.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iNaturalistReactNative.debug.xcconfig"; path = "Target Support Files/Pods-iNaturalistReactNative/Pods-iNaturalistReactNative.debug.xcconfig"; sourceTree = ""; }; 374CB22E29943E63005885ED /* Whitney-BookItalic-Pro.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Whitney-BookItalic-Pro.otf"; path = "../assets/fonts/Whitney-BookItalic-Pro.otf"; sourceTree = ""; }; - 3810FCEF1E284915A5A23AF5 /* INatIcon.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = INatIcon.ttf; path = ../assets/fonts/INatIcon.ttf; sourceTree = ""; }; 7DD42FAECED8C66268DDB37F /* libPods-iNaturalistReactNative.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-iNaturalistReactNative.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = iNaturalistReactNative/LaunchScreen.storyboard; sourceTree = ""; }; BA9D41ECEBFA4C38B74009B3 /* Whitney-Light-Pro.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Whitney-Light-Pro.otf"; path = "../assets/fonts/Whitney-Light-Pro.otf"; sourceTree = ""; }; C544256CF572EB52B9E2B9CB /* Pods-iNaturalistReactNative.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iNaturalistReactNative.release.xcconfig"; path = "Target Support Files/Pods-iNaturalistReactNative/Pods-iNaturalistReactNative.release.xcconfig"; sourceTree = ""; }; + C9904C04E3DD410FA07BB0A1 /* INatIcon.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = INatIcon.ttf; path = ../assets/fonts/INatIcon.ttf; sourceTree = ""; }; D09FA3A0162844FF80A5EF96 /* Whitney-Medium-Pro.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Whitney-Medium-Pro.otf"; path = "../assets/fonts/Whitney-Medium-Pro.otf"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -157,7 +159,8 @@ BA9D41ECEBFA4C38B74009B3 /* Whitney-Light-Pro.otf */, D09FA3A0162844FF80A5EF96 /* Whitney-Medium-Pro.otf */, 374CB22E29943E63005885ED /* Whitney-BookItalic-Pro.otf */, - 3810FCEF1E284915A5A23AF5 /* INatIcon.ttf */, + 142B10AEC7284E94AE0D2300 /* inaturalisticons.ttf */, + C9904C04E3DD410FA07BB0A1 /* INatIcon.ttf */, ); name = Resources; sourceTree = ""; @@ -258,7 +261,8 @@ 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, A252B2AEA64E47C9AC1D20E8 /* Whitney-Light-Pro.otf in Resources */, BA2479FA3D7B40A7BEF7B3CD /* Whitney-Medium-Pro.otf in Resources */, - 07603705D89842DD91992F31 /* INatIcon.ttf in Resources */, + 862E651A41DD461AAE4331B2 /* inaturalisticons.ttf in Resources */, + 015B74B1048846199E2104BF /* INatIcon.ttf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/ios/iNaturalistReactNative/Info.plist b/ios/iNaturalistReactNative/Info.plist index ef992379c..3fa15f9e2 100644 --- a/ios/iNaturalistReactNative/Info.plist +++ b/ios/iNaturalistReactNative/Info.plist @@ -58,6 +58,7 @@ Whitney-Light-Pro.otf Whitney-Medium-Pro.otf Whitney-BookItalic-Pro.otf + inaturalisticons.ttf INatIcon.ttf UILaunchStoryboardName diff --git a/ios/link-assets-manifest.json b/ios/link-assets-manifest.json index 40970cc47..8b12586a6 100644 --- a/ios/link-assets-manifest.json +++ b/ios/link-assets-manifest.json @@ -3,7 +3,7 @@ "data": [ { "path": "assets/fonts/INatIcon.ttf", - "sha1": "47a247e3585aec0da80245083a706f676a7e01c0" + "sha1": "2691c217d3dfbcba545ce985c306fa93f9610606" }, { "path": "assets/fonts/Whitney-BookItalic-Pro.otf", @@ -16,6 +16,10 @@ { "path": "assets/fonts/Whitney-Medium-Pro.otf", "sha1": "33ca073c11f46dc266a7dc1adeaa102891bd76d1" + }, + { + "path": "assets/fonts/inaturalisticons.ttf", + "sha1": "d5a9b116c0d7857ec446f4f045fe5316196d22ec" } ] } diff --git a/src/components/AddObsModal.js b/src/components/AddObsModal.js index e287d9c9a..e42bade9c 100644 --- a/src/components/AddObsModal.js +++ b/src/components/AddObsModal.js @@ -60,7 +60,7 @@ const AddObsModal = ( { closeModal }: Props ): React.Node => { ); return ( - + <> {t( "Evidence" )} @@ -112,7 +112,7 @@ const AddObsModal = ( { closeModal }: Props ): React.Node => { "record-sound-button" )} - + ); }; diff --git a/src/components/DisplayTaxonName.js b/src/components/DisplayTaxonName.js index d22e1fc96..0170bd5b6 100644 --- a/src/components/DisplayTaxonName.js +++ b/src/components/DisplayTaxonName.js @@ -71,9 +71,12 @@ const DisplayTaxonName = ( { return ( { const renderBackButton = ( ) => ( navigation.goBack( )} className="absolute top-8 right-8" > diff --git a/src/components/MyObservations/Header.js b/src/components/MyObservations/Header.js new file mode 100644 index 000000000..4c1a1ce98 --- /dev/null +++ b/src/components/MyObservations/Header.js @@ -0,0 +1,125 @@ +// @flow +import { useNavigation } from "@react-navigation/native"; +import ToolbarContainer from "components/MyObservations/ToolbarContainer"; +import { + Button, Heading1, Subheading1 +} from "components/SharedComponents"; +import { View } from "components/styledComponents"; +import type { Node } from "react"; +import React from "react"; +import { Trans, useTranslation } from "react-i18next"; +import { IconButton, useTheme } from "react-native-paper"; +import User from "realmModels/User"; +import useNumUnuploadedObservations from "sharedHooks/useNumUnuploadedObservations"; + +import Onboarding from "./Onboarding"; + +type Props = { + setLayout: Function; + layout: string, + currentUser: ?Object, + numObservations: number, + setHeightAboveToolbar: Function, + uploadStatus: Object, + setShowLoginSheet: Function +} + +const Header = ( { + setLayout, + layout, + currentUser, + numObservations, + setHeightAboveToolbar, + uploadStatus, + setShowLoginSheet +}: Props ): Node => { + const theme = useTheme( ); + const navigation = useNavigation( ); + const numUnuploadedObs = useNumUnuploadedObservations( ); + const { t } = useTranslation( ); + const hideToolbar = numObservations === 0; + + const signedInContent = ( ) => ( + , + + ]} + /> + ); + + const signedOutContent = ( ) => ( + <> + + + {numUnuploadedObs > 0 ? ( + + + {t( "Log-in-to-contribute-and-sync" )} + + + {t( "X-observations", { count: numUnuploadedObs } )} + + + ) : ( + + {t( "Log-in-to-contribute-your-observations" )} + + )} + +