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

Commit

Permalink
MM-12221: Pass channel and channel member to onClick handler for mobi…
Browse files Browse the repository at this point in the history
…le channel header plugins. (#1728)
  • Loading branch information
jtammen authored and jwilander committed Oct 1, 2018
1 parent 2e65f3b commit efa293b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class MobileChannelHeaderPlug extends React.PureComponent {
return (
<div
className='navbar-toggle navbar-right__icon pull-right'
onClick={plug.action}
onClick={() => this.fireAction(plug)}
>
<span className='icon navbar-plugin-button'>
{plug.icon}
Expand All @@ -49,7 +49,7 @@ export default class MobileChannelHeaderPlug extends React.PureComponent {
<a
role='menuitem'
href='#'
onClick={plug.action}
onClick={() => this.fireAction(plug)}
>
{plug.dropdownText}
</a>
Expand All @@ -58,6 +58,10 @@ export default class MobileChannelHeaderPlug extends React.PureComponent {
});
}

fireAction(plug) {
return plug.action(this.props.channel, this.props.channelMember);
}

render() {
const components = this.props.components || [];

Expand Down

0 comments on commit efa293b

Please sign in to comment.