pinballmap / pbm-react

PBM React Native: iOS & Android Apps
https://pinballmap.com/app
GNU General Public License v3.0
34 stars 9 forks source link

Photo uploads #112

Open RyanTG opened 5 years ago

RyanTG commented 5 years ago

On the "Info" tab in LocationDetails, we should do two things:

  1. Show thumbnails of any uploaded photos (or do you think we should have a button/link that then opens a new screen that has the thumbnails??).
  2. Have a button for uploading photos.

When the "upload photos" button is clicked, a user can pick a picture from their photo library.

We've only ever had a photo upload feature on the website. So this is new for the app. We store photos on S3, and on the website we resize them using a rails plugin called Paperclip. We'll still want those different sizes, given that these photos will be available on the website, too.

Possible resources: how to upload files: https://github.com/g6ling/React-Native-Tips/tree/master/How_to_upload_photo%2Cfile_in%20react-native

Camera Roll: https://facebook.github.io/react-native/docs/cameraroll.html

Image picker: https://github.com/react-community/react-native-image-picker

Uploader: https://github.com/aroth/react-native-uploader

https://github.com/benjreinhart/react-native-aws3 https://github.com/leimd/react-native-aws-signature

bpoore commented 4 years ago

@RyanTG, how are the photos currently available on the site being shown for locations? I'm not seeing any endpoint support that would allow us to show photos we already have. Do you know what the endpoint to submit a photo would look like? Trying to think through if this would be a new pbm API route or how this would look.

RyanTG commented 8 months ago

API endpoints are here: https://github.com/pinballmap/pbm/blob/master/app/controllers/api/v1/location_picture_xrefs_controller.rb

This is not thoroughly tested.

Just pasting initial research: https://docs.expo.dev/versions/latest/sdk/imagepicker/ https://docs.expo.dev/versions/latest/sdk/image/ https://docs.expo.dev/versions/v50.0.0/sdk/camera-next/

Not sure about UI. I would think something like: