jobtoday / react-native-image-viewing

Tiny, purely TS, modal component for viewing images 🏙
https://exp.host/@antonkalinin/react-native-image-viewing
MIT License
891 stars 291 forks source link

react-native-web support #82

Open Powersource opened 3 years ago

Powersource commented 3 years ago

Would be nice. Right now I'm getting this error because it's missing a web implementation for ImageItem

ERROR in ./node_modules/react-native-image-viewing/dist/ImageViewing.js
Module not found: Error: Can't resolve './components/ImageItem/ImageItem' in '/home/me/prj/ssb/manyverse/node_modules/react-native-image-viewing/dist'
 @ ./node_modules/react-native-image-viewing/dist/ImageViewing.js 1:1047-1090
 @ ./node_modules/react-native-image-viewing/dist/index.js
 @ ./lib/frontend/components/ZoomableImage.js
 @ ./lib/frontend/components/Markdown.js
 @ ./lib/frontend/components/messages/AboutMessage.js
 @ ./lib/frontend/components/messages/Message.js
 @ ./lib/frontend/components/FullThread.js
 @ ./lib/frontend/screens/thread/view.js
 @ ./lib/desktop/index.js
likeSo commented 3 years ago

I got the same problem on web

/Users/X/XX/XXX/node_modules/react-native-image-viewing/dist/ImageViewing.js
Module not found: Can't resolve './components/ImageItem/ImageItem' in '/Users/X/XX/XXX/node_modules/react-native-image-viewing/dist'

Please help!

staltz commented 2 years ago

Just to check if supporting react-native-web is easy, I did the following changes:

And it worked! In other words, supporting react-native-web in this repo is not too hard. I can make a PR, but wanted to inform about this already.

CavalcanteLeo commented 1 month ago

3 years for this issue, I need to reevaluate this, it seems this component is not ready for production