mattermost-mobile/app/components/post_list/new_messages_divider.js
Chris Duarte afe09babfa PLT-5605 Fix logic for indicating start of new messages (#284)
* Fix placement of new messages separator

* Ignore your own posts when determining start of new messages

* Cache lastViewedAt in ChannelPostList until switching channels

* Increase padding around DateHeader & NewMessagesDivider

* Improve styling of new messages divider line

* Use async await for ChannelDrawerList.onSelectChannel

* Convert DateHeader to functional component
2017-02-21 23:59:27 -03:00

50 lines
1.2 KiB
JavaScript

// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React from 'react';
import {StyleSheet, View} from 'react-native';
import FormattedText from 'app/components/formatted_text';
const style = StyleSheet.create({
container: {
alignItems: 'center',
flexDirection: 'row',
height: 28
},
textContainer: {
marginHorizontal: 15
},
line: {
flex: 1,
height: StyleSheet.hairlineWidth,
backgroundColor: '#f80'
},
text: {
fontSize: 14,
fontWeight: '600',
color: '#ffaf53'
}
});
function NewMessagesDivider(props) {
return (
<View style={[style.container, props.style]}>
<View style={style.line}/>
<View style={style.textContainer}>
<FormattedText
id='post_list.newMsg'
defaultMessage='New Messages'
style={style.text}
/>
</View>
<View style={style.line}/>
</View>
);
}
NewMessagesDivider.propTypes = {
style: View.propTypes.style
};
export default NewMessagesDivider;