Skip to content

Instantly share code, notes, and snippets.

@vishalnarkhede
Last active April 7, 2020 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishalnarkhede/bd682b394c7dc9a606484f97a548b896 to your computer and use it in GitHub Desktop.
Save vishalnarkhede/bd682b394c7dc9a606484f97a548b896 to your computer and use it in GitHub Desktop.
import React from 'react';
import {View, Text, StyleSheet} from 'react-native';
import moment from 'moment';
export const DateSeparator = ({message}) => {
return (
<View style={styles.container}>
<Text style={styles.date}>{moment(message.date).calendar()}</Text>
<View style={styles.line} />
</View>
);
};
const styles = StyleSheet.create({
container: {
flexDirection: 'column',
marginBottom: 10,
marginTop: 10,
},
date: {
fontWeight: 'bold',
paddingBottom: 5,
fontSize: 12,
},
line: {
flex: 1,
height: 0.5,
backgroundColor: '#E8E8E8',
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment