question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue Description

There is a previous issue already but it seems that it was closed as stale. The current lightbox lib is not updated anymore and doesn’t support gestures like pinch to zoom … double tap…

react-native-image-zoom-viewer works very well and is easy to implement.

I have seen it used in another chat library as well.

Happy to work on a PR if there is interest?

Cheers,

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
nonotestcommented, Sep 16, 2019

Does not seem to be too much interest.

This should get you started for those who want…

Create your own MessageImage component and …

/* eslint no-use-before-define: ["error", { "variables": false }] */

import React from 'react';
import { Text, View, Modal, SafeAreaView, StyleSheet, TouchableOpacity } from 'react-native';
import ImageViewer from 'react-native-image-zoom-viewer';
import FastImage from 'react-native-fast-image';

export default class MessageImage extends React.PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      viewerModalOpen: false,
    };
  }
  render() {
    const { containerStyle, lightboxProps, imageProps, imageStyle, currentMessage } = this.props;
    return (
      <React.Fragment>
        <TouchableOpacity
          onPress={() => {
            this.setState({ viewerModalOpen: true });
          }}
          onLongPress={() => {
            this.props.onLongPress();
          }}
          alignment={this.props.alignment}
          style={[styles.container, containerStyle]}
        >
          <FastImage
            {...imageProps}
            resizeMode={FastImage.resizeMode.cover}
            style={[styles.image, imageStyle]}
            source={{ uri: currentMessage.image }}
          />
        </TouchableOpacity>
        <Modal visible={this.state.viewerModalOpen} transparent={true} onRequestClose={() => {}}>
          <SafeAreaView style={{ flex: 1, backgroundColor: 'transparent' }}>
            <ImageViewer
              imageUrls={[{ url: currentMessage.image }]}
              onCancel={() => {
                this.setState({ viewerModalOpen: false });
              }}
              enableSwipeDown
              renderHeader={() => (
                <TouchableOpacity
                  onPress={() => {
                    this.setState({ viewerModalOpen: false });
                  }}
                >
                  <Text style={styles.closeButton}>Close</Text>
                </TouchableOpacity>
              )}
            />
          </SafeAreaView>
        </Modal>
      </React.Fragment>
    );
  }
}

 
5reactions
pierroocommented, Sep 13, 2019

Issue Description

There is a previous issue already but it seems that it was closed as stale. The current lightbox lib is not updated anymore and doesn’t support gestures like pinch to zoom … double tap…

react-native-image-zoom-viewer works very well and is easy to implement.

I have seen it used in another chat library as well.

Happy to work on a PR if there is interest?

Cheers,

Hello @nonotest ,

There is DEFINITELY interest.

I do miss the pink to zoom feature, would be awesome to have it added in the future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Replace Your Dated Lightbox | Kitchen ceiling, Diy ...
Mar 14, 2019 - Easy DIY tips to replace fluorescent light in the kitchen ceiling.
Read more >
Replacing Fluorescent Light Boxes in Your Kitchen
There is hope for your fluorescent light fixture and light box—I'm living proof you can rid yourself of it and it's not as...
Read more >
What do I use to replace lights in a sign light box ? - YouTube
Led light barsRLBN-x30X3SMD series narrow rigid light bars with 3-chip 5050SMD LEDs. 22.5 inch long non-weatherproof light bars, ...
Read more >
How to Remove an Old Ceiling Light Box | eHow
Go into your attic to identify and remove an old ceiling light box. Both metal and plastic boxes can be mounted to the...
Read more >
Amazon.com: My Cinema Lightbox - RGB Color Changing ...
COLOR-CHANGE: Colour-changing LED backlit mode gradually cycles through a full RGB range of colors; FREEZE: hold on any color when cycling.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found