SingleImage.js 931 Bytes
'use strict';

import React from 'react';
import ReactNative from 'react-native';
import Immutable from 'immutable';
import ImageSingle from "../cell/ImageSingle";

const {Dimensions} = ReactNative;


export default class SingleImage extends React.Component {

    constructor(props) {
        super(props);
    }

    shouldComponentUpdate(nextProps) {
        if (Immutable.is(nextProps.data, this.props.data)) {
            return false;
        } else {
            return true;
        }
    }

    render() {
        return (
            <ImageSingle
                style={this.props.style}
                resource={this.props.data}
                resourceJumpWithUrl={this.props.resourceJumpWithUrl}
            />
        );
    }
}

let {width, height} = Dimensions.get('window');

const DEVICE_WIDTH_RATIO = width / 320;
let sliderHeight = Math.ceil(100 * DEVICE_WIDTH_RATIO);