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 1 commit
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
Next Next commit
[MM-23517] - Fix channel header popover
  • Loading branch information
Nevyana Angelova authored and Nevyana Angelova committed Mar 25, 2020
commit 42fef4111fa4848dfc1a3756ef21a0a53fcc3a1c
6 changes: 5 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,9 @@ 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--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
8 changes: 8 additions & 0 deletions sass/components/_popover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@

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

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

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

.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