From fce5acea46a321857eca47328976ea51ace132ed Mon Sep 17 00:00:00 2001 From: Chris Duarte Date: Wed, 29 Mar 2017 19:53:48 -0700 Subject: [PATCH] PLT-6015 RN grey vertical line on left of replies is sometimes too short (#427) --- app/actions/views/load_team.js | 10 ++-- .../file_attachment_list.js | 2 +- app/components/post/post.js | 52 ++++++++++--------- app/reducers/views/channel.js | 4 +- app/scenes/channel/channel_drawer_button.js | 6 +++ app/scenes/channel/channel_title.js | 6 +++ app/scenes/load_team/load_team.js | 3 +- 7 files changed, 51 insertions(+), 32 deletions(-) diff --git a/app/actions/views/load_team.js b/app/actions/views/load_team.js index 04d09672b..765e27a68 100644 --- a/app/actions/views/load_team.js +++ b/app/actions/views/load_team.js @@ -21,16 +21,18 @@ export function goToChannelView() { dispatch({ type: ViewTypes.APPLICATION_INITIALIZED }, getState); - }, 800); // modal close takes 400ms + }, 400); } else { dispatch({ type: NavigationTypes.NAVIGATION_RESET, routes: [Routes.ChannelView] }, getState); - dispatch({ - type: ViewTypes.APPLICATION_INITIALIZED - }, getState); + setTimeout(() => { + dispatch({ + type: ViewTypes.APPLICATION_INITIALIZED + }, getState); + }, 400); } }; } diff --git a/app/components/file_attachment_list/file_attachment_list.js b/app/components/file_attachment_list/file_attachment_list.js index 1cb5bdcb3..3152cab9f 100644 --- a/app/components/file_attachment_list/file_attachment_list.js +++ b/app/components/file_attachment_list/file_attachment_list.js @@ -54,7 +54,7 @@ export default class FileAttachmentList extends Component { )); return ( - + {fileAttachments} ); diff --git a/app/components/post/post.js b/app/components/post/post.js index 48a380cc9..18ebd34d3 100644 --- a/app/components/post/post.js +++ b/app/components/post/post.js @@ -155,6 +155,10 @@ class Post extends PureComponent { replyBarStyle.push(style.replyBarFirst); } + if (this.props.isLastReply) { + replyBarStyle.push(style.replyBarLast); + } + return ; }; @@ -226,22 +230,24 @@ class Post extends PureComponent { if (Platform.OS === 'ios') { messageContainer = ( - + {replyBar && this.renderReplyBar(style)} - - {message} - {this.renderFileAttachments()} - + + + {message} + {this.renderFileAttachments()} + + ); } else { messageContainer = ( - + {replyBar && this.renderReplyBar(style)} this.toggleSelected(false)} @@ -249,8 +255,9 @@ class Post extends PureComponent { onPress={this.handlePress} onShowUnderlay={() => this.toggleSelected(true)} underlayColor='transparent' + style={{flex: 1}} > - + {message} {this.renderReplyBar(style)} - + {displayName} @@ -454,6 +461,9 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { flexDirection: 'column', marginRight: 12 }, + rightColumnPadding: { + paddingBottom: 3 + }, postInfoContainer: { alignItems: 'center', flexDirection: 'row', @@ -473,22 +483,14 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { backgroundColor: theme.centerChannelColor, opacity: 0.1, marginRight: 10, - ...Platform.select({ - ios: { - width: 3, - flexBasis: 3 - }, - android: { - width: 6, - flexBasis: 6 - } - }) + width: 3, + flexBasis: 3 }, replyBarFirst: { - marginTop: 10 + paddingTop: 10 }, replyBarLast: { - marginBottom: 10 + paddingBottom: 10 }, displayName: { color: theme.centerChannelColor, diff --git a/app/reducers/views/channel.js b/app/reducers/views/channel.js index ed38f35a2..cc560e0e3 100644 --- a/app/reducers/views/channel.js +++ b/app/reducers/views/channel.js @@ -2,7 +2,7 @@ // See License.txt for license information. import {combineReducers} from 'redux'; -import {ChannelTypes, FilesTypes} from 'mattermost-redux/constants'; +import {ChannelTypes, FilesTypes, UsersTypes} from 'mattermost-redux/constants'; import {ViewTypes} from 'app/constants'; @@ -128,6 +128,8 @@ function appInitializing(state = true, action) { switch (action.type) { case ViewTypes.APPLICATION_INITIALIZED: return false; + case UsersTypes.RESET_LOGOUT_STATE: + return true; default: return state; } diff --git a/app/scenes/channel/channel_drawer_button.js b/app/scenes/channel/channel_drawer_button.js index fa8c50af8..e4adc36be 100644 --- a/app/scenes/channel/channel_drawer_button.js +++ b/app/scenes/channel/channel_drawer_button.js @@ -20,6 +20,7 @@ import EventEmitter from 'mattermost-redux/utils/event_emitter'; class ChannelDrawerButton extends PureComponent { static propTypes = { + applicationInitializing: PropTypes.bool.isRequired, emitter: PropTypes.func.isRequired, theme: PropTypes.object, messageCount: PropTypes.number, @@ -68,6 +69,10 @@ class ChannelDrawerButton extends PureComponent { }; render() { + if (this.props.applicationInitializing) { + return null; + } + let badge; let badgeCount = this.props.mentionCount; @@ -146,6 +151,7 @@ const style = StyleSheet.create({ function mapStateToProps(state) { return { + applicationInitializing: state.views.channel.appInitializing, theme: getTheme(state), ...getUnreads(state) }; diff --git a/app/scenes/channel/channel_title.js b/app/scenes/channel/channel_title.js index e7ca27cb0..beb9e536a 100644 --- a/app/scenes/channel/channel_title.js +++ b/app/scenes/channel/channel_title.js @@ -14,6 +14,10 @@ import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; import {getTheme} from 'app/selectors/preferences'; function ChannelTitle(props) { + if (props.applicationInitializing) { + return null; + } + const channelName = props.currentChannel.display_name; let icon; if (channelName) { @@ -50,6 +54,7 @@ function ChannelTitle(props) { } ChannelTitle.propTypes = { + applicationInitializing: PropTypes.bool.isRequired, currentChannel: PropTypes.object, emitter: PropTypes.func.isRequired, theme: PropTypes.object @@ -62,6 +67,7 @@ ChannelTitle.defaultProps = { function mapStateToProps(state) { return { + applicationInitializing: state.views.channel.appInitializing, currentChannel: getCurrentChannel(state), theme: getTheme(state) }; diff --git a/app/scenes/load_team/load_team.js b/app/scenes/load_team/load_team.js index d5788e8ef..2941596d8 100644 --- a/app/scenes/load_team/load_team.js +++ b/app/scenes/load_team/load_team.js @@ -25,7 +25,8 @@ export default class LoadTeam extends PureComponent { }; static navigationProps = { - renderBackButton: () => null + renderBackButton: () => null, + renderTitleComponent: () => } componentDidMount() {