npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-modal-photo-view

v0.1.1

Published

A modal image view support for react-native.

Downloads

6

Readme

React Native Modal Photo View

A modal image view support for react-native. This repository is fork from halilb/react-native-photo-browser library now and remove some functions and just left photo view.Then add and change some new functions.

The component has both iOS and Android support .

I haven't test it in IOS because i don,t have apple devices.

This repository may have a lot of issues in the beginning.

Known issues

1、While image loading,the loading component position is not in the center of the screen.

2、Some times if image load error or failed, the error image and tip text didn't show.

3、Maybe you can't touch anywhere of the screen to close modal, but you can touch the close button of the image position to close modal

Installation

npm install react-native-modal-photo-view --save

Properties

| Prop | Type | Description | Default | |---|---|---|---| |style|Style|Overrides default container style.|null| |mediaList|Array<Media>|List of media objects to display.|[]| |initialIndex|Number|Sets the visible photo initially.|0| |displayCloseBtn|Boolean|Show close button to close modal.|false| |displayBottomBar|Boolean|Whether to display the bottom text.|true| |useCircleProgressiOS|Boolean|Displays Progress.Circle instead of default Progress.Bar for full screen photos. Check Progress section for more info.|false| |onClose|Function|Function to control the modal visible or not.|() => {}| |visible|Boolean|Modal visible or not.|false| |onPhotoLongPress|Function|Called when a long press trigged on a photo.Plan to add in the future|() => {}| |delayPhotoLongPress|Number|The long press delay in ms.Plan to add in the future|1000| |imageErrorTitle|String|Text will show when image load error or failed.|Load failed|

Media Object

const media = {
  photo: '', // a remote photo or local media url
};

Progress Component

Android

Built-in ActivityIndicator component is used for Android. Any additional configuration is not needed.

iOS

react-native-progress component is used as progress indicator. The default progress component is Progress.Bar. You can also use Progress.Circle component by simply using useCircleProgress prop, and adding ReactART library to your Xcode project. For more information please check out react-native-progress repo and React Native documentation.

Examples

Follow those steps to run the example:

  1. Clone the repo git clone https://github.com/guopeng1994/react-native-modal-photo-view && cd react-native-modal-photo-view/Example
  2. Install dependencies npm install or yarn
  3. Follow official instructions to run the example project in a simulator or device.

Roadmap

  • [x] Android support
  • [ ] Improve performance for bigger collections
  • [ ] Video support
  • [ ] Photo zoom
  • [x] Zooming photos to fill the screen

Licence

MIT