MessageListCellHeader.js 1.19 KB
'use strict';

import React, {Component} from 'react';
import ReactNative, {
    View,
    Text,
    StyleSheet,
    Dimensions,
    Platform,
} from 'react-native';

export default class MessageListCellHeader extends Component {
    constructor(props) {
        super(props);
    }

    render(){
        let isEditing = this.props.isEditing;
        let marginLeft = isEditing ? 50*DEVICE_WIDTH_RATIO : 0;
        return(
            <View style={styles.container}>
                <Text style={styles.textStyle}>
                    {this.props.timestamp}
                </Text>
                <View style={[styles.separator, {marginLeft}]}/>
            </View>
        )
    }
}

let {width,height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 375;

let styles = StyleSheet.create({
    container: {
        flexDirection: 'column',
        width,
        height: 40,
        backgroundColor: '#f2f2f2',
    },
    textStyle: {
        fontSize: 13,
        backgroundColor: 'transparent',
        color: '#b0b0b0',
        textAlign: 'center',
        marginTop: 13
    },
    separator: {
        marginTop: 10.5,
        backgroundColor: '#e0e0e0',
        width,
        height: 0.5,
    }
})