Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[MM-23517] - Fix channel header popover #5159

Merged
merged 5 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion components/channel_header/channel_header.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class ChannelHeader extends React.PureComponent {
}).isRequired,
teammateNameDisplaySetting: PropTypes.string.isRequired,
currentRelativeTeamUrl: PropTypes.string.isRequired,
newSideBarPreference: PropTypes.bool,
};

constructor(props) {
Expand Down Expand Up @@ -290,6 +291,7 @@ class ChannelHeader extends React.PureComponent {
rhsState,
hasGuests,
teammateNameDisplaySetting,
newSideBarPreference,
} = this.props;
const {formatMessage} = this.props.intl;
const ariaLabelChannelHeader = Utils.localizeMessage('accessibility.sections.channelHeader', 'channel header region');
Expand Down Expand Up @@ -437,7 +439,10 @@ class ChannelHeader extends React.PureComponent {
popoverSize='lg'
style={{maxWidth: `${this.state.popoverOverlayWidth}px`}}
placement='bottom'
className={classNames(['channel-header__popover', {'chanel-header__popover--lhs_offset': this.props.hasMoreThanOneTeam}])}
className={classNames(['channel-header__popover',
{'chanel-header__popover--dm': isDirect,
'chanel-header__popover--lhs_offset': this.props.hasMoreThanOneTeam,
'chanel-header__popover--new_sidebar': newSideBarPreference}])}
>
<span
onClick={this.handleFormattedTextClick}
Expand Down
5 changes: 3 additions & 2 deletions components/channel_header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
isCurrentChannelReadOnly,
getCurrentChannelStats,
} from 'mattermost-redux/selectors/entities/channels';
import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences';
import {getTeammateNameDisplaySetting, getNewSidebarPreference} from 'mattermost-redux/selectors/entities/preferences';
import {getCurrentRelativeTeamUrl, getCurrentTeamId, getMyTeams} from 'mattermost-redux/selectors/entities/teams';
import {
getCurrentUser,
Expand Down Expand Up @@ -79,7 +79,8 @@ function makeMapStateToProps() {
pinnedPostsCount: stats.pinnedpost_count,
hasMoreThanOneTeam,
teammateNameDisplaySetting: getTeammateNameDisplaySetting(state),
currentRelativeTeamUrl: getCurrentRelativeTeamUrl(state)
currentRelativeTeamUrl: getCurrentRelativeTeamUrl(state),
newSideBarPreference: getNewSidebarPreference(state)
};
};
}
Expand Down
17 changes: 17 additions & 0 deletions sass/components/_popover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,25 @@
margin-left: -4px;
font-size: em(12px);

&.chanel-header__popover--dm {
margin-left: 73px;
}

&.chanel-header__popover--lhs_offset {
margin-left: 61px;

&.chanel-header__popover--new_sidebar {
margin-left: 81px;
}
}

&.chanel-header__popover--new_sidebar {
margin-left: 16px;


&.chanel-header__popover--dm {
margin-left: 91px;
}
}

.popover-content {
Expand Down
3 changes: 2 additions & 1 deletion utils/markdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export function formatWithRenderer(text: string, renderer: marked.Renderer) {
sanitize: true,
gfm: true,
tables: true,
mangle: false
mangle: false,
breaks: true,
};

return marked(text, markdownOptions).trim();
Expand Down