Skip to content

Commit

Permalink
Add a + next to direct message on sidebar to open 'Direct Messages' m…
Browse files Browse the repository at this point in the history
…odal (mattermost#7159)

* Add a + next to direct message on sidebar to open 'Direct Messages' modal

* Change + cick to display direct message modal without group message.
  • Loading branch information
dmeza authored and jwilander committed Aug 22, 2017
1 parent 12a9180 commit 1ce079d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions webapp/components/sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,18 @@ export default class Sidebar extends React.Component {
</Tooltip>
);

const createDirectMessageTooltip = (
<Tooltip
id='new-group-tooltip'
className='hidden-xs'
>
<FormattedMessage
id='sidebar.createDirectMessage'
defaultMessage='Create new direct message'
/>
</Tooltip>
);

const above = (
<FormattedMessage
id='sidebar.unreads'
Expand Down Expand Up @@ -757,6 +769,23 @@ export default class Sidebar extends React.Component {
createPublicChannelIcon = null;
}

const createDirectMessageIcon = (
<OverlayTrigger
className='hidden-xs'
delayShow={500}
placement='top'
overlay={createDirectMessageTooltip}
>
<a
className='add-channel-btn'
href='#'
onClick={this.handleOpenMoreDirectChannelsModal}
>
{'+'}
</a>
</OverlayTrigger>
);

if (!ChannelUtils.showCreateOption(Constants.PRIVATE_CHANNEL, isTeamAdmin, isSystemAdmin)) {
createPrivateChannelIcon = null;
}
Expand Down Expand Up @@ -894,6 +923,7 @@ export default class Sidebar extends React.Component {
id='sidebar.direct'
defaultMessage='DIRECT MESSAGES'
/>
{createDirectMessageIcon}
</h4>
</li>
{directMessageItems}
Expand Down

0 comments on commit 1ce079d

Please sign in to comment.