mattermost-mobile/app/scenes/thread/thread_title.js
Chris Duarte e6a1c1a433 Plt 6044 plt 5971 plt 5934 (#405)
* Update post textbox design

* Hide team selection

* Added channel loader

* Update post textbox to new design

* Add channel loader animation

* Remove error bar

* Made image preview fullscreen

* Fix channel loader gradient

* Fix status icon

* Adjust loaded and profile

* Fix channel header wrap

* Add reply count icon

* Fix android styling

* Hide send button

* Fix thread header

* Fix thumbnail upload preview

* Fix preview retry and design
2017-03-27 16:47:52 -03:00

66 lines
1.8 KiB
JavaScript

// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React, {PropTypes} from 'react';
import {connect} from 'react-redux';
import {
View
} from 'react-native';
import {Constants} from 'mattermost-redux/constants';
import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels';
import {getTheme} from 'app/selectors/preferences';
import FormattedText from 'app/components/formatted_text';
function ThreadTitle(props) {
const {currentChannel, theme} = props;
let label;
if (currentChannel.type === Constants.DM_CHANNEL) {
label = (
<FormattedText
id='mobile.routes.thread_dm'
defaultMessage='Direct Message Thread'
ellipsizeMode='tail'
numberOfLines={1}
style={{color: theme.sidebarHeaderTextColor, fontSize: 15, fontWeight: 'bold'}}
/>
);
} else {
const channelName = currentChannel.display_name;
label = (
<FormattedText
id='mobile.routes.thread'
defaultMessage='{channelName} Thread'
ellipsizeMode='tail'
numberOfLines={1}
values={{channelName}}
style={{color: theme.sidebarHeaderTextColor, fontSize: 15, fontWeight: 'bold'}}
/>
);
}
return (
<View style={{justifyContent: 'center', flex: 1, marginHorizontal: 1}}>
{label}
</View>
);
}
ThreadTitle.propTypes = {
currentChannel: PropTypes.object.isRequired,
theme: PropTypes.object
};
ThreadTitle.defaultProps = {
theme: {}
};
function mapStateToProps(state) {
return {
currentChannel: getCurrentChannel(state),
theme: getTheme(state)
};
}
export default connect(mapStateToProps)(ThreadTitle);