* Start using React Query to make remote data requests
* Renaming, standardized error handling from API calls, moving code
* Fixed messages test; changed useQuery mocking approach
* React Query should only retry for network issues
* Tried using useAuthenticatedRequest on TaxonDetail
* Clear the React Query cache on sign out
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Replaced several separate button components with a single, configurable Button component
* Removed RoundGreenButton and SecondaryButton
Closes#121
Co-authored-by: Merhawit Gubsa <merhawitgubsa@Merhawits-MacBook-Pro.local>
Prior to this commit, if I were to run `npm install` twice, I would get
this error:
```
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: inaturalistreactnative@0.1.1
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"17.0.2" from the root project
npm ERR! peer react@">= 16.8.0" from react-spring@8.0.27
npm ERR! node_modules/react-spring
npm ERR! react-spring@"^8.0.27" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^18.2.0" from react-dom@18.2.0
npm ERR! node_modules/react-dom
npm ERR! peer react-dom@">= 16.8.0" from react-spring@8.0.27
npm ERR! node_modules/react-spring
npm ERR! react-spring@"^8.0.27" from the root project
```
Because `react-dom` was eagerly trying to upgrade `react-dom` to version
18, but we want to lock it to 17 to match our React version.
* Remove photo gallery provider
* Get tests passing
* Remove use-between & ability to remove photos from GroupPhotos and reflect that in PhotoGallery selection
* Use goBack method since not passing params back to PhotoGallery
* Remove params when navigating to photo gallery
* Lint fix
* Simplify uploadObservation code by moving some logic into Obs model
* Eslint fix: remove unused import
* Use realm to filter by observationPhotos which haven't been synced
* Tests passing
* Eslint fixes
* Create helper functions to check for unsynced obs including photos; show in ObsList
* Show photo failure error if upload fails on obs_photo API call
* Fix test
* Guard against 500 errors
* Add swiping in media viewer for photos which are zoomed out; closes#43
* Make media viewer full screen by overriding safe areas
* Improve custom swiper component (aka flatlist)
* Fix eslint errors
* Use onScrollEndDrag to handle left/right scrolling and update selected photo index
* Switch event handler to onMomentumScrollEnd
* Fixes for getting photo index while swiping only halfway
* Use IconButton for standardized back button in media viewer
* Update translations
* Add a skeleton instantly when user taps shutter
* Update styling for photo preview to make flatlist of images scrollable within container
* Fix styling for media viewer modal
* Create animated view overlaying camera; closes#108
* Make fade duration shorter
* Fix animation for fade out/in when tapping shutter
* Fix hardcoded styles; move to stylesheets; remove extra comments
* Simplify stack navigation for observations flow
* Navigation code cleanup
* Fix upload bugs from new API v2 verification
* Restore useObservations to previous version
* Add icons to obs card comments/ids
* Show red icons when user has unviewed comments/ids
* Mark obs viewed locally and with server via obs detail
* Mock i18next; get tests passing
* More progress on progress bar; make sure for loop uses all observations
* Remove attributes for API v2 obs create, cancel upload if user taps x
* Fetch current user id from auth service, not API call
* Add error message to uploader progress bar
These rules are largely based on the AirBnB ones, which are not quite standard
for the React Native world, where Prettier seems to be more common, but I
think they add a lot of useful checks, and unlike Prettier we can customize
them. This also just makes it easier for people on the iNat team to work on
the mobile app.
Some specific changes:
* Added eslint-plugin-react-hooks to eslint rules
* Added eslint-plugin-simple-import-sort to eslint rules
* Bugfix: could not import photo from gallery
* Added support for react-native/no-inline-styles eslint rule
* useUser should not bother fetching a user for a blank userId
* Show logged out green card at top of my obs screen when user logged out
* Allow user to save obs locally without being signed in; show number of unuploaded obs in top banner:
* Show login prompt in bottom sheet; hide sync button when logged out
* Upload prompt uses same styling as login prompt
* Delete realm file if user is installing app after deletion
* Code cleanup; add comment to checkForSignedInUser; closes#98
* Update eslint-config package
* Update RN maps
* Update styling for empty list
* Use third-party bottom sheet modal for login prompt & upload prompt
* Get tests passing via transformIgnorePatterns
* Extended RoundGreenButton to accpept `style` and `loading` props
* Removed Tab Bar
* Make the form react to the presence of the keyboard
* Stop form loading on failure or success, not immediately
* Use RoundGreenButton instead of one-off styles
Configures fastlane to automate our current release process of making a git tag, making a git release, building, and pushing to the Play Store internal track and Testflight. See README.md for details on setup and usage.
Co-authored-by: Amanda Bullington <albullington@gmail.com>
* Adds a component for adding identifications, both from Obs Detail and Obs Edit
* Minor style and eslint change to disallow all-caps string literals
Closes#103
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Sign out user when encountering a 401 error while fetching JWT
* Save currently signed in user in Realm
* Check for logged in user on app start, add loading wheel to obs list, sign user out when no user ID
Closes#99
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Create basic media viewer with full sized image, selection, carousel, and header
* Create photo delete dialog component
* Wrap camera stack in Mortal component instead of resetting state on camera blur
* Use photo carousel in PhotoPreview for standardized photo sizes
* Make media viewer accessible from ObsEdit
* Remove evidencelist component and use photo carousel instead in ObsEdit/suggestions
* code tweaks
* Create realm ObsPhotos in standard camera for passing to media viewer, ObsEdit
* Move resize image function into Photo model
* Update photo preview to use delete photo functions from photo and obsphoto model
* Allow photo deletion in media viewer from ObsEdit, StandardCamera; switch to Modal view
* Swap in zoom functionality instead of carousel, media viewer
* Remove media viewer from nav, now that it's a modal
* Remove comment
* Update babel config with react-native-paper plugin for production
* Mock RN paper Portal component
* Media viewer takes photo uris; handles obsPhoto updates in ObsEdit and photo uri updates in StandardCamera
* Make sure tests pass with optional chaining for obsPhotos
* Update styling for StandardCamera
* Create obsPhotos attached to photos from camera
* Pass photos to StandardCamera from ObsEdit to reflect any changes made in MediaViewer
* Get tests passing
* Fix flow issues
* Change flow type for photoUris
* Add pre-commit hook for flow
* Fix flow erros