diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index 2841f30423..84091e8a68 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -31,8 +31,8 @@ export default class MessageComposer extends React.Component { this.onCallClick = this.onCallClick.bind(this); this.onHangupClick = this.onHangupClick.bind(this); this.onUploadClick = this.onUploadClick.bind(this); - this.onShowAppsClick = this.onShowAppsClick.bind(this); - this.onHideAppsClick = this.onHideAppsClick.bind(this); + this.onShowStickersClick = this.onShowStickersClick.bind(this); + this.onHideStickersClick = this.onHideStickersClick.bind(this); this.onUploadFileSelected = this.onUploadFileSelected.bind(this); this.uploadFiles = this.uploadFiles.bind(this); this.onVoiceCallClick = this.onVoiceCallClick.bind(this); @@ -53,6 +53,7 @@ export default class MessageComposer extends React.Component { wordCount: 0, }, showFormatting: SettingsStore.getValue('MessageComposer.showFormatting'), + showStickers: false, }; } @@ -189,18 +190,12 @@ export default class MessageComposer extends React.Component { // this._startCallApp(true); } - onShowAppsClick(ev) { - dis.dispatch({ - action: 'appsDrawer', - show: true, - }); + onShowStickersClick(ev) { + this.setState({showStickers: true}); } - onHideAppsClick(ev) { - dis.dispatch({ - action: 'appsDrawer', - show: false, - }); + onHideStickersClick(ev) { + this.setState({showStickers: false}); } onInputContentChanged(content: string, selection: {start: number, end: number}) { @@ -268,7 +263,7 @@ export default class MessageComposer extends React.Component { alt={e2eTitle} title={e2eTitle} />, ); - let callButton, videoCallButton, hangupButton, showAppsButton, hideAppsButton; + let callButton, videoCallButton, hangupButton, showStickersButton, hideStickersButton; if (this.props.callState && this.props.callState !== 'ended') { hangupButton =
@@ -286,15 +281,23 @@ export default class MessageComposer extends React.Component { } // Apps - if (this.props.showApps) { - hideAppsButton = -
- + if (this.state.showStickers) { + hideStickersButton = +
+
; } else { - showAppsButton = -
- + showStickersButton = +
+
; } @@ -343,8 +346,8 @@ export default class MessageComposer extends React.Component { hangupButton, callButton, videoCallButton, - showAppsButton, - hideAppsButton, + showStickersButton, + hideStickersButton, ); } else { controls.push( @@ -409,7 +412,4 @@ MessageComposer.propTypes = { // callback when a file to upload is chosen uploadFile: React.PropTypes.func.isRequired, - - // string representing the current room app drawer state - showApps: React.PropTypes.bool, };