Commit Graph

40 Commits

Author SHA1 Message Date
Amanda Bullington
5ee4a433df Add location picker to ObsEdit (#593)
* Crosshairs, location accuracy warnings, text input for location picker

* Add LocationPicker tests

* UI improvements and code refactor into smaller components; get GMaps working

* Add shadows to icons/text boxes

* Use debouncing to avoid map jitter when typing in location

* Show place results & let user pick new location from web api

* Add tests for location picker with remote results

* Add gmaps api key to github actions

* Try adding manifest placeholders for env variable to work in github actions

* Add key to printf in github actions

* Try accessing GMAPS_API_KEY a different way

* Update android e2e env file step

This updates the "Create .env file" step to use printf to print the Google Maps key into a newly created .env file in the GitHub Action runner. Using the same key as in env.example.

* Fix newline

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-04-26 10:51:05 -07:00
Ken-ichi
5747d4d1d9 Several minor UI fixes (#572)
* use `shrink` tailwind class instead of hard-coded max widths to control
  overflow in a few situations
* fixed some spacing issues with the Toolbar during upload
* center text in buttons by default
* export KebabMenu from SharedComponents (how was it working without this?)
* added some extra colors for debugging purposes
2023-04-17 15:50:39 -07:00
Angie
8ef2fbb89c 440 activityitem component (#564)
* ActivityItem component main styling, ActivityHeader added Body4

* ActivityItem component, onAgree icon

* Remove console logs

* onAgree prop

* Changes requested, text wrap, styling to match figma

* Add ActivityItem to UILibrary

* onAgree button shows conditionally

* onAgree button shows conditionally

---------

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2023-04-06 13:09:32 -07:00
Ken-ichi Ueda
4a621c2fb5 Wrap useTranslation to catch java.lang.NoClassDefFoundError in Android
This error seems to happen on the first few attempts to use i18next.translate
on Android when there are numerical interpolations, e.g. plurals. This
extends a bandaid fix by @Chrischuck in
https://github.com/inaturalist/iNaturalistReactNative/pull/515 to handle all
uses of translation.
2023-03-31 18:38:21 -07:00
Angie
18dcccc705 Snapshot and unit tests, and default color for QualityGradeStatus (#512) 2023-03-30 11:18:53 -07:00
Johannes Klein
868c95ee13 494 activity count (#495)
* Refactor to boolean prop for white or gray

* Rename prop

* Add component for comments count

* Reorder strings

* Use CommentsCount

* Add identifications count component

* Add snapshot test for ActivityCount

* Add tests TODO for component

* Updated with new icons

* Add snapshot tests

* Update ActivityCount.test.js.snap

* Unit test for count text

* Remove testing comments count in ObsList test

* Update with changes from main

* Update IdentificationsCount.test.js.snap

* Remove components from ObsStatus
2023-03-17 11:55:29 -07:00
Chris
5b35e83b5c Utilize floating action bar and sticky toolbar in group photos ui (#527)
* lint

* Fix shadow on fab android

* lint
2023-03-14 12:42:53 -07:00
Amanda Bullington
bbc5b9d67d MyObservations refactor (#510)
* WIP: very rough start at pulling state up into a container for MyObservations

I made a parallel MyObservations component and container so ObservationViews
can still be used as a working reference, but the ultimate goal here is to
focus MyObservations on presentation, and pull state and other business logic
up into a container component. This should make MyObservations a bit more
testable and clean up a very large and confusing file.

I'm also trying to move away from a generalized representation of observations
on all screens, which is why I want to name it MyObservations and not
ObservationViews. MyObservations has a lot of unique functionality that we
won't need elsewhere, and we can modularize stuff when we need to use it in
multiple places.

* UI updates for header, toolbar, empty component

* Add pressable component and login sheet

* UI improvements; get infinite scroll working

* UI improvements & additions for empty screen & bottom sheet

* Show login sheet when a user presses sync but is not logged in

* Fix backdrop close for AddObsModal

* Move UI elements to MyObservations

* Fix unit tests for MyObservations

* Fix for login sheet

* Set header height to a different height on Android to account for safe area

* Fix failing tests & rerender of user icon in navbar

* Remove scientific name from DisplayTaxonName to match Figma UI

* Set height above toolbar dynamically for sticky toolbar

* Add prop to display or hide second name in DisplayTaxonName

* Use RN styling to style grid view for MyObs flatlist

* Fix failing project obs test

* Create separate ToolbarContainer to separate presentation from logic; fix upload count

* Merge main and show onboarding based on user's total obs count

* Fix display taxon name styling and remove header fade on iOS

* Add header text for 0 observations, logged out state

* Update infinite scroll to 50 obs at a time; make loading wheel show faster

* Add uploaded status to toolbar

* Apply bandaid fix to stop Android from crashing on start

* Start adding new icons to MyObs

* Add circular progress; show upload icons at correct times during upload

* Add disabled props for accessibility state

* Fix tests; update snapshots

* Code cleanup

* Code cleanup & add inaturalist icon

* Fix merge conflict and add icon

* Add inaturalist icon

* Fix navigation to obs list and toolbar status when upload completes

* Move showLoginSheet code to MyObsContainer

* Fix toolbar status text

* Sync toolbar with upload status progress

* Clear toolbar after nav

* Tests passing

* Update e2e test

* Target login button in e2e tests

* Fix failing e2e tests with new testID for login button

* Update button snapshot to include new testID

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-03-14 10:54:33 -07:00
Ken-ichi
3320aec7f6 Add icons to repo & use script to generate font (#518)
This uses an npm package to convert SVGs into an icon font, allowing us to
not step on each others' toes when adding new icons in branches and
simplifying the icon addition process. It also allows us to track changes to
the icons, and embed them directly as SVGs if we need to.

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-03-10 12:21:09 -08:00
Chris
01099be1ce Create tab navigator (#507)
* Create tab navigator

* Add add obs button

* lint

* Wire up routes

* Fix login

* Add keys

* Fix delayed state bug

* Lint

* space parens

* Add details to tab nav

* Lint

* re-add back btn

* Rebase off main

* Fix format

* Fix back button

* Remove unused change

* Replace lowercase folder

* I don't know why that is needed

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-03-10 14:57:32 +01:00
Angie
fb23d925c4 400 uploadstatus component (#488)
* UploadStatus component

* Added UploadStatus to SharedComponents/index.js

* Change upload complete icon and color

* QualityGradeStatus accessibility labels

* Saved Observation Animation for UploadStatus

* Changed widths of component

* Unit test for UploadStatus

* Unit test and snapshot for UploadStatus

* Update snapshot tests

* Changes requested, accessibility labels for UploadStatus progress, accessibility tests

* Update snapshot tests

* Testing updated snapshot test

* Fix style

* And again

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-03-09 17:49:32 +01:00
Johannes Klein
a771a309ef Change PhotoCount in UiLib 2023-03-09 16:48:42 +01:00
Yahia Jabeur
3342dfa9e2 483 create PhotoCount component (#497)
* 483 create PhotoCount component

* 483 PhotoCount refinement

* 483 add PhotoCount component unit test

* 483 add shadow to PhotoCount component

* Use Body3 component instead of SVG text

* 483 fix unit tests

* Find component by text rather than by ID

* Remove unused test id

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-03-09 16:44:45 +01:00
Ken-ichi
6047a44241 Reverted icon names in Fontastic to match main (mostly) (#511)
Somehow many of the icon names in Fontastic were changed. This changes them
back to match what we use on the web and what we use in the main branch of
this repo, with a few exceptions to attempt to make names more consistent.

Also updated the README in the hopes of avoiding situations like this in the
future.

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-03-07 15:01:29 -08:00
Amanda Bullington
7d63206862 Move sticky toolbar above footer in UI library 2023-03-07 14:48:22 -08:00
Chris
3565bcfe9d 484 - Create sticky toolbar (#506)
* Create sticky toolbar

* Clean up code

* Rebase off main

* Fix shadows
2023-03-07 14:42:44 -08:00
Angie
c3ad393a0d 455 update colors and unify usage in the app (#505)
* Update tailwind colors to match current designs, update PaperProviderColors, unify usage

* Change snapshot test colors to match current design colors

* Added accessibility labels

* Edited accessibility labels

* Remove surface color, unify usage

* Update colors
2023-03-06 11:43:42 -08:00
Chris
0843b96eee Create Floating Action Bar component (#492)
* Create Floating Action Bar component
* Add fn to get shadow stylesheet

Closes #485
2023-02-24 17:31:57 -08:00
Johannes Klein
4ecac24e3c Default color for INatIcon component (#493)
* Move INatIcon file
* Create base component for icon
* Add icon to SharedComponents index
* Refactor imports
2023-02-21 16:34:06 -08:00
Johannes Klein
000e661ff5 Fix typo 2023-02-17 15:12:06 +01:00
Chris
e0606a0c20 453 Integrate reusable components into obs details (#478)
* Integrate reusable components into obs details

* Add map to shared component index

* Add map to shared components index

* Fix merge

* Add missing color

* Fix tests and comments

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-02-16 18:10:23 +01:00
Amanda Bullington
b25aa6953c Replace SecondaryCTAButton with Appbar; styling updates; closes #452 (#459)
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-02-15 12:54:21 +01:00
Johannes Klein
621c39dfda 415 snapshot testing for UI buttons (#458)
* Add font weight to Typography elements

* Add Heading5

* Typography snapshot tests

* Add letterSpacing to Heading 4 and 5

* Update Button padding

* Update Button styling

* Add rounded-lg

* Code style and comments

* Add button tests

* Added loading state color to buttons

* Add default color to text

* Use text class name instead

* Change text

* Add non default color text

* Snapshot for icon

* Default text color into button snap

* Update INatIcon.js

* Add Divider component

* Updates to Tabs UI

* Update color

* Add Divider test

* Show underline only when active

* Tabs snapshot

* Update Button UI

* Revert "Update Button UI"

This reverts commit 5361f57dac.

* Update ActivityCount.js

* Get color from theme in buttons

* Use translated string for hints in Tabs snapshots

* Refactor fct args

* Update Tabs

* Remove async

* Use .each in Button test

* Remove comment

* Structuring

* Remove duplicate application of style defaults

* Remove async from Typography
2023-02-15 11:31:16 +01:00
Amanda Bullington
7a98b6faf1 Timeless dates (#457)
* Add DateDisplay to ObsCard and make first pass at translation strings

* Add failing tests (due to lack of localization) for timeless dates

* WIP: trying to ensure i18next gets initialized before tests run

The remaining test failures might be legit. This probably breaks the actual
app, though.

* Got the rest of the tests working

* Updated tests to assume UTC
* Updated README to advise against using `npx jest` so test runs always have
  the env vars we specify in our `npm test` script
* Moved i18next initialization to an explicitly-named file
* Use i18next init function in app
* Fixed up remaining tests

* Added test for non-English localization of date format

* Cleanup

* Made DateDisplay explicitly handle strings not Dates

* Restore skipped localization tests for MyObservations

* Remove duplicative tests from DateDisplay unit test

* Added note to the README about initializing i18next

* Updated change to DateDisplay in main

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-02-14 22:14:38 +01:00
Ken-ichi
f76e02e4fb Support custom font in UserText (#454) 2023-02-09 15:10:59 -08:00
Chris
885f2e72d8 Location display component (#446)
Closes #438
2023-02-07 23:19:50 -05:00
Chris
41e7fb3ff7 Obs status component (#443)
Closes #443
2023-02-07 22:52:58 -05:00
Chris
dc53c47a2a Date display component (#445)
Closes #437
2023-02-07 20:54:59 -05:00
Ken-ichi
09ab2de8d6 Remove eslint rule requiring acc. hint with label and other minor changes (#447)
* Added identification-solid icon
* Used ActivityCount on obs detail to test out label without hint
* Minor fixes to the README
2023-02-07 18:58:28 -05:00
Johannes Klein
e57aac93f6 418 create an index.js file for importing shared components (#427)
* Update .eslintrc.js

* Create index.js

* Change Button usage in GridItem

* Replace imports

* Add strings

* Add hint prop to button

* Add a11y hint prop to EvidenceButton

* Add EvidenceButton to index

* Add a11y props to EvidenceButton

* Update UiLibrary.js

* Add a11y props to CloseButton

* Add CloseButton to index and UiLib

* Rename function

* Update string

* Add a11y props to AddObsButton

* Add Tabs to index

* Linebreak

* Add Typography to index

* Remove unused text

* Refactor UserIcon test coverage in it's own test

* Add UserIcon to index

* Add UserIcon to UiLib

* Add InlineUser to index

* Add Quality badge to index

* Update UiLibrary.js

* Remove unused component

* Change AddObsButton a11y label

* Change hint

* Use consistent uri in snapshots

* Add snapshot to InlineUser

* Fix wrong user key

* Update Tabs.test.js

* Snapshot TODO

* Update NavButton.js

* Update snapshot

* Add snapshot for active user icon

* Remove snapshot result

* Add ActivityCount to index

* Update UiLibrary.js
2023-02-04 15:18:42 +01:00
Amanda Bullington
5bd4fc7ea9 Activity Count component (#426)
* Create ActivityCount component and add to UI Library

* Add accessibility label

* Make ActivityCount component compatible with identifications

* Localize numbers; add large number to UI library

* Fix ObsCard tests with waitFor ActivityCount

* Make testID dynamic and optional in ActivityCount
2023-02-03 08:30:40 -08:00
Angie Ta
4d606fbcd2 import cleanup 2023-02-01 15:44:36 -08:00
Angie Ta
b71bc274e0 Merge branch 'main' into 397-qualitygradestatus-component 2023-02-01 15:15:45 -08:00
Amanda Bullington
7d39c0f919 UI redesign: Typography components (#402)
* Add heading typography components

* Add typography components for body, list, and subheading

* Add font sizes/line heights to tailwind css

* Replace Text components in UI library with new typography; closes #383

* Update pixel size of fonts and use Heading2 throughout UI library

* Remove repeated logic from code

* Fix sizes for typography components
2023-02-01 12:40:25 -08:00
Angie Ta
9d18e7a6b2 Merge branch 'main' into 397-qualitygradestatus-component 2023-01-31 20:27:13 -08:00
Angie Ta
4b26a44260 QualityGradeStatus component, replaced QualityBadge, import svg 2023-01-31 19:54:36 -08:00
Amanda Bullington
3f125beab6 Framework for adding custom icons to iNatRN (#414)
* Add custom iNat icon font to iOS and Android
* Add custom icon to iNat UI library
* Create custom iNat icons using IconButton for add obs modal & footer
* Add icon placeholders to observation edit screen
* Test fixes for accessibility
* Move paper provider into new component; fix names in UI library
* Update README with clarified directions about changing the name of the .ttf file
2023-01-31 16:45:11 -08:00
Chris
959a61316e Create base inline user component (#410)
* Create base inline user component

* make icon closer to spec

* use premade func

* Add unit tests

* Add unsaved changes

* Add unsaved changes

* Change a11y role to get branch to run without errors

* Fix comments

* Lint

* Add nav to user profile

* Move InlineUser in UiLib and use currentUser if true

* Add a11y label and testID

* Add currentUser to UiLib

* Reorder tests

* Rename mock

* Await photos in tests

* Fix order

* Refactor Inline to use UserIcon and add no internet icon

* Update UiLibrary.js

* Test also that unwanted images are not present

* Use InlineUser component in ObsDetail and ActivityItem

* Update UserIcon.js

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2023-01-31 21:41:26 +01:00
Amanda Bullington
4597245b38 Update Button component with new styling (#388)
* Update Button component with new styling; closes #384
* Change button to Pressable instead of RNPaper to get border to show on Android
* Add disabled buttons to UI library
* Add multiple buttons in row
* Add multiple button examples
2023-01-26 16:05:14 -08:00
Ken-ichi Ueda
b5ceba376a Added UI Library component 2023-01-24 14:06:49 -08:00