MessageListCellHeader.js
1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'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,
}
})