SingleImage.js 1001 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}
                messageResourceInfo={this.props.messageResourceInfo}
                resourceJumpWithUrl={this.props.resourceJumpWithUrl}
            />
        );
    }
}

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

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