Open RyanTG opened 5 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.
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:
On the "Info" tab in LocationDetails, we should do two things:
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