Skip to content

Commit 03c2a94

Browse files
jwilanderccbrown
authored andcommitted
Add pluggable component in mobile channel header (mattermost#412)
* Add pluggable component in mobile channel header * Fix styling * Update snapshot
1 parent 0e6bd60 commit 03c2a94

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

components/navbar/navbar.jsx

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import RenameChannelModal from 'components/rename_channel_modal';
4040
import StatusIcon from 'components/status_icon.jsx';
4141
import ToggleModalButton from 'components/toggle_modal_button.jsx';
4242

43+
import Pluggable from 'plugins/pluggable';
44+
4345
import NavbarInfoButton from './navbar_info_button.jsx';
4446

4547
export default class Navbar extends React.Component {
@@ -914,6 +916,7 @@ export default class Navbar extends React.Component {
914916
channel={channel}
915917
showEditChannelHeaderModal={this.showEditChannelHeaderModal}
916918
/>
919+
<Pluggable pluggableName='MobileChannelHeaderButton'/>
917920
{channelMenuDropdown}
918921
</div>
919922
</div>

plugins/docs.json

+4
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,9 @@
3333
"ChannelHeaderButton": {
3434
"desc": "A component on the right side of the channel header, beside buttons such as the pinned posts button.",
3535
"props": {}
36+
},
37+
"MobileChannelHeaderButton": {
38+
"desc": "Same as ChannelHeaderButton, except shown in mobile view when the screen is less than 768 pixels wide.",
39+
"props": {}
3640
}
3741
}

tests/components/navbar/__snapshots__/navbar.test.jsx.snap

+15
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ exports[`components/navbar/Navbar should match snapshot, for private channel 1`]
8181
}
8282
showEditChannelHeaderModal={[Function]}
8383
/>
84+
<Connect(Pluggable)
85+
pluggableName="MobileChannelHeaderButton"
86+
/>
8487
<div
8588
className="navbar-brand"
8689
>
@@ -442,6 +445,9 @@ exports[`components/navbar/Navbar should match snapshot, if WebRTC is not enable
442445
}
443446
showEditChannelHeaderModal={[Function]}
444447
/>
448+
<Connect(Pluggable)
449+
pluggableName="MobileChannelHeaderButton"
450+
/>
445451
<div
446452
className="navbar-brand"
447453
>
@@ -804,6 +810,9 @@ exports[`components/navbar/Navbar should match snapshot, if enabled WebRTC and D
804810
}
805811
showEditChannelHeaderModal={[Function]}
806812
/>
813+
<Connect(Pluggable)
814+
pluggableName="MobileChannelHeaderButton"
815+
/>
807816
<div
808817
className="navbar-brand"
809818
>
@@ -1000,6 +1009,9 @@ exports[`components/navbar/Navbar should match snapshot, if not licensed 1`] = `
10001009
}
10011010
showEditChannelHeaderModal={[Function]}
10021011
/>
1012+
<Connect(Pluggable)
1013+
pluggableName="MobileChannelHeaderButton"
1014+
/>
10031015
<div
10041016
className="navbar-brand"
10051017
>
@@ -1363,6 +1375,9 @@ exports[`components/navbar/Navbar should match snapshot, valid state 1`] = `
13631375
}
13641376
showEditChannelHeaderModal={[Function]}
13651377
/>
1378+
<Connect(Pluggable)
1379+
pluggableName="MobileChannelHeaderButton"
1380+
/>
13661381
<div
13671382
className="navbar-brand"
13681383
>

0 commit comments

Comments
 (0)