How to use the @shoutem/animation.makeZoomable function in @shoutem/animation

To help you get started, we’ve selected a few @shoutem/animation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shoutem / ui / components / ImagePreview.js View on Github external
import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
import {
  View,
  Modal,
  Image,
  TouchableOpacity,
} from 'react-native';

import Icon from 'react-native-vector-icons/MaterialIcons';

import { connectStyle } from '@shoutem/theme';

import { makeZoomable } from '@shoutem/animation';

const ZoomableImage = makeZoomable(Image);

const propTypes = {
  width: PropTypes.number,
  height: PropTypes.number,
  source: Image.propTypes.source,
  style: PropTypes.object,
};

const CLOSE_ICON_NAME = 'clear';
const CLOSE_ICON_SIZE = 25;

/**
 * Renders an ImagePreview which shows an inline image preview.
 * When clicked, the image is displayed in full screen.
 */
class ImagePreview extends PureComponent {